Functor => Pointed => Applicative => Monad

Henning Thielemann lemming at henning-thielemann.de
Wed Dec 22 15:23:04 CET 2010


David Menendez wrote:
> On Mon, Nov 29, 2010 at 11:26 AM, Isaac Dupree
 >
>> Is it useful to have Pointed non-Functors?
> 
> Is Pointed useful at all? The last time this discussion came up, I
> asked for algorithms which were generic over pointed functors (in the
> same way that traverse is generic over applicative functors) and no
> one could think of any.

I remember that I have recently abused Applicative in connection with 
Traversable in order to get the 'pure' method.

First example: A general implementation of a 'peek' for traversable 
structures:
http://hackage.haskell.org/packages/archive/storable-record/0.0.2.3/doc/html/src/Foreign-Storable-Traversable.html#peekApplicative

Second example: The liftPoint function in
http://code.haskell.org/~thielema/streamed/src/Sound/MIDI/ALSA/Causal.hs
that lifts a not-quite arrow (T a b) to a (T (t a) (t b)) where 't' is 
Traversable.



More information about the Libraries mailing list