Just to make a couple of obvious observations:
Graeme Moss wrote:
> A question born out only of curiosity:
>
> Can anyone provide a definition of `thread' equivalent to this:
>
> > thread :: Monad m => [a -> m a] -> a -> m a
> > thread [] a = return a
> > thread (k:ks) a = k a >>= thread k
Graeme Moss writes
> A question born out only of curiosity:
>
> Can anyone provide a definition of `thread' equivalent to this:
>
> > thread :: Monad m => [a -> m a] -> a -> m a
> > thread [] a = return a
> > thread (k:ks) a = k a >>= thread ks
>
> not using pattern matching (eg. using map
Ralf Hinze answers my question:
|> Can anyone provide a definition of `thread' equivalent to this:
|>
|> > thread :: Monad m => [a -> m a] -> a -> m a
|> > thread [] a = return a
|> > thread (k:ks) a = k a >>= thread ks
|>
|> not using pattern matching (eg. using map or fold) that does not
A question born out only of curiosity:
Can anyone provide a definition of `thread' equivalent to this:
> thread :: Monad m => [a -> m a] -> a -> m a
> thread [] a = return a
> thread (k:ks) a = k a >>= thread ks
not using pattern matching (eg. using map or fold) that does not have
a space l