[Haskell-cafe] Monadic vs "pure" style

Bulat Ziganshin bulatz at HotPOP.com
Thu Sep 1 12:22:54 EDT 2005


Hello Jacques,

Thursday, September 01, 2005, 6:55:43 PM, you wrote:


>>instance (Monad m, MyNum v) => MyNum (m v) where
>>    (.+) = liftM2 (.+)
>>  
>>
JC> Such simplified forms then occur often enough that, in a scrapping 
JC> boilerplate kind of way, I would really like to be able to write 
JC> something like

JC> instance (Monad m, MyNum v) => MyNum (m v) via lifting

JC> where all the operations from MyNum are obtained via applying the correct arity liftM function from the Monad class.

Template Haskell is a good instrument to do it


-- 
Best regards,
 Bulat                            mailto:bulatz at HotPOP.com





More information about the Haskell-Cafe mailing list