On Fri, Sep 28, 2007 at 05:54:23PM +0100, Brian Hulley wrote:
> Yes this type should be fine. To implement reversor though you'd still need 
> to first convert from the concrete list to whatever foldable you're using, 
> before reversing the foldable, or implement something more general eg:
>
>     reversor :: (Foldable f, Foldable g) :: f a -> g a

One cannot define such a function, as Foldable provides no way to build
things.  However one can define

        reversor :: Traversable f => f a -> f a

which returns something of the same shape, but with the contents reversed.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to