[Haskell-beginners] Re: some terminology
mauricio.antunes at gmail.com
Thu Aug 13 13:34:12 EDT 2009
> I was looking at some code, saw a variable x, and said to myself, "Ah
> that variable is a monad." Then I realized "Monad" is the name of a type
> class. So maybe x should be called "an instance of a Monad." I think the
> word "instance" in this case is OO-like; but in Haskell "instance"
> refers to a type that is an instance of a type class. [...]
In general, it helps to know that the current "de facto" Haskell standard
actually accepts classes and instances built on top of many types:
class SomeClass a b c where
someF :: a -> b -> c
anotherF :: b -> c -> a
instance SomeClass T1 T2 T3 where
someF = ...
anotherF = ...
This way it becomes clear that saying that some type "is of" or
"instantiate" some class isn't apropriate.
More information about the Beginners