[Haskell-cafe] Re: The Proliferation of List-Like Types
David Menendez
dave at zednenem.com
Thu Feb 21 02:05:46 EST 2008
On Wed, Feb 20, 2008 at 10:46 PM, <ajb at spamcop.net> wrote:
> Quoting Neil Mitchell <ndmitchell at gmail.com>:
>
> > Yes, its the projection onto another type:
> >
> > [] = Nothing
> > (x:xs) = Just (x, xs)
>
> Also known as msplit:
>
> http://www.haskell.org/haskellwiki/New_monads/MonadSplit
Almost. The projection has type f a -> Maybe (a, f a), but msplit has
type f a -> f (Maybe (a, f a)).
--
Dave Menendez <dave at zednenem.com>
<http://www.eyrie.org/~zednenem/>
More information about the Haskell-Cafe
mailing list