[Haskell-cafe] Splitting off many/some from Alternative

Carl Howells chowells79 at gmail.com
Mon Dec 12 18:23:13 CET 2011


> There is absolutely no implication of consuming anything in the definitions
> of many or some. This is how they happen to behave when used in the context
> of some parsing libraries, but that's all. If many or some always go into an
> infinite loop for some Alternative instance, then I suspect that the
> instance itself is either broken or shouldn't exist.

So, then...  The instance for Maybe shouldn't exist?

Prelude Control.Applicative> some Nothing
Nothing
Prelude Control.Applicative> some $ Just ()
^CInterrupted.

Carl



More information about the Haskell-Cafe mailing list