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.

 

发表评论

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