[Haskell-beginners] Monad for Pair

Mike Houghton mike_k_houghton at yahoo.co.uk
Thu Nov 19 18:30:54 UTC 2015


"But how do you take an arbitrary type and turn it into a monoid?”

I didn’t -  I must have been dreaming about Haskell at that point :)   (My wife once dreamt she was a C compiler - go figure… C !!??) 
No, just Monad, Applicative and Functor - my mistake.

Thanks 

Mike



> On 19 Nov 2015, at 06:34, Kim-Ee Yeoh <ky3 at atamo.com> wrote:
> 
> 
> On Thu, Nov 19, 2015 at 1:33 AM, Mike Houghton <mike_k_houghton at yahoo.co.uk <mailto:mike_k_houghton at yahoo.co.uk>> wrote:
> 
> The source is just me exploring. 
> 
> Nice.
>  
> I first looked at 
> 
> data C a = C a deriving (Show)
> 
> and made Monad, Applicative, Monoid and Functors for it.
> 
> Even though the null-effect instances for the identity functor are trivial, there's value in writing them out, especially for the motivated.
> 
> But how do you take an arbitrary type and turn it into a monoid?
> 
> -- Kim-Ee
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20151119/3689f09f/attachment.html>


More information about the Beginners mailing list