
Ok, sorry for the spam, accidentaly hit the send button =/.
On Wed, Dec 14, 2011 at 11:03 PM, Felipe Almeida Lessa
On Wed, Dec 14, 2011 at 4:09 PM, James Cook
wrote: So a case could be made that, just as "forever (Just 1)" being nonsensical doesn't invalidate "instance Monad Maybe", "some (Just 1)" being nonsensical doesn't invalidate "instance Alternative Maybe". And on the other hand, a case could be made that the importance of "some" and "many" justifies the creation of a subclass of Alternative where they actually are mandated to be meaningful rather than just definable.
Being in the same typeclass means that you can define instance Alternative Maybe where ... some Nothing = Nothing some (Just _) = error "Alternative.some: used with Just (loops forever)" many Nothing = Nothing many (Just _) = error "Alternative.many: used with Just (loops forever)" Cheers, -- Felipe.