
On 5 September 2010 03:34, David Menendez
On Fri, Sep 3, 2010 at 8:23 AM, John Lato
wrote: Do you have a kind * implementation of Foldable? I'd be interested in seeing it, because I was unable to create a usable implementation (based upon the RMonad scheme) on my last attempt.
I always figured it would look something like:
class Foldable f where type Elem f :: * foldMap :: Monoid m => (Elem f -> m) -> f -> m
with the usual definitions for foldr, foldl, etc.
+1 for using the proper constraints, and especially for bringing over Pointed (and anything else that applies).
What's the argument for Pointed? Are there many types which are instances of Pointed but not Applicative? Are there many algorithms which require Pointed but not Applicative?
Presumably just that it's another possible abstraction. -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com