On Jul 22, 7:44 pm, Felipe Lessa <[email protected]> wrote:
> > type TypeOfF a = a -> Maybe (TypeOfF' a)
> > newtype TypeOfF' a = F {unF :: TypeOfF a}

An interesting observation is that "ListT ((->) a) ()" would also do
the job.
If one would want to also generalize "filter" this way,
a more appropriate type would be "ListT ((->) a) Bool",
which could still be used for the generalized takeWhile, dropWhile,
etc.

You need to import Control.Monad.Reader for the Monad instance of "(-
>) a".
ListT here isn't the one from mtl, but rather the one from "http://
www.haskell.org/haskellwiki/ListT_done_right"
or from the "generator" package in hackage.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to