Haskell笔记 (18)—— Polymorphic function和oveloaded function

A function is called polymorphic (“of many forms”) if its type contains one or more type variables. E.g.: length :: [a] -> Int

A polymorphic function is called overloaded if its type contains one or more class constraints. E.g.: (+) :: Num a => a -> a -> a.

 

发表评论

邮箱地址不会被公开。 必填项已用*标注

This site uses Akismet to reduce spam. Learn how your comment data is processed.