
26 Aug
2013
26 Aug
'13
12:59 p.m.
There was a lot of discussion about separating "pure" from Applicative and putting it into a Pointed class. If I remember correctly, the main counter argument was that 'pure' alone does not satisfy interesting laws. There are only such laws in connection with the Applicative class. Now, in some situations I liked to have a generalized unfoldr. I can build this from "pure" and "sequenceA" using the State monad: unfoldr :: (Pointed t, Traversable t) => (s -> (a, s)) -> s -> t a unfoldr = evalState . sequenceA . pure . state One could state a law like: traverse f (pure a) == traverse id (pure (f a)) Would this justify to move "pure" into a new Pointed class?