Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

haskal nomad?

Name: Anonymous 2011-12-19 8:54

Modelling monads with a typeclass is stupid. There isn't one true monad for a given type. It makes no sense that when you use bind with lists you automatically get concatmap.

Name: Anonymous 2011-12-19 12:53

If you need multiple monad implementations for lists, you can do something like this:

data D a = A [a] | B [a] | C [a]

instance Monad D where
A xs >>= f = ...
B xs >>= f = ...
C xs >>= f = ...
...


I agree, though, it is ugly.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List