[Haskell-cafe] Capped lists and |append|

Felipe Lessa felipe.lessa at gmail.com
Sat Jan 9 06:33:30 EST 2010


On Fri, Jan 08, 2010 at 09:10:38PM -0800, John Millikin wrote:
> > Also, you may want to have CappedList an instance of
> > Control.Functor.Bifunctor from category-extras:
> > [...]
>
> This is probably a good idea, but, I am nervous about making such a
> small package depend on the huge category-extras and mtl.

Well, then just provide the plain function in the module

  bimap :: (a -> b) -> (cap -> cap') -> CappedList cap a -> CappedList cap' b
  bimap f g = foldr (Next . f) (Cap . g)

:)

--
Felipe.


More information about the Haskell-Cafe mailing list