Personal tools


From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(This is a wild guess! Somebody check it...)

Revision as of 22:01, 16 March 2007

Monomorphism is the opposite of polymorphism. That is, a function is polymorphic if it works for several different types - and thus, a function is monomorphic if it works only for one type.

As an example,
is polymorphic. It's type is simply

However, the function

foo :: (Int -> Int) -> [Int] -> [Int]
foo = map
performs an identical operation to
(as is evident from the second line), but has a monomorphic type; it will only accept lists of
and functions over them.

Perhaps you were looking for monomorphism restriction?