News for hackers. Stuff that matters.
Re:What I Wish I Knew When Learning Haskell by gizmo686 on Saturday December 07, 2013 @11:04PM (#6868911)
Why can't you define a set monad? The first definition I can think of is making behave like Haskell's list monad?

That is to say that "xs ==> (\x -> f x)" Would take every element in the set "xs", pass each of them into f, and union the results into a single set.

Re:What I Wish I Knew When Learning Haskell by velis_vel on Sunday December 08, 2013 @01:02AM (#6869109)
Set basically has an Ord constraint on the type of things you have a Set of since most of the functions on it have an Ord a constraint, and Monads can't be constrained in what types they wrap. This is also why it's not a Functor; you can define

  setMap :: (Ord a, Ord b) => (a -> b) -> Set a -> Set b
but that's still more restricted than fmap.
Re:What I Wish I Knew When Learning Haskell by elliotlai on Tuesday December 10, 2013 @01:33PM (#6882599)
Because a monad is also a functor, but a set failed to be a functor.