
Yes, but HaRe *is* extremely clever :-)
I just wish I could use it, but since it doesn't support many GHC
extensions, I haven't.
On Wed, Aug 12, 2009 at 11:26 AM, Bayley,
Alistair
From: haskell-cafe-bounces@haskell.org [mailto:haskell-cafe-bounces@haskell.org] On Behalf Of Pavel Perikov
unless you have some insanely clever refactoring tool ready that can convert pure into monadic functions and vice versa.
Not trying to attack the idea, just some thoughts:
I don't see much problem converting pure function into an "effectfull" form :) Having pure function myPureFunction::a1->a2->a3->res .... myPureFunction a1 a2 a3 -- pure call myPureFunction <$> a1 <*> a2 <*> a3 -- call using Applicative
Probably, introducing some conventions and using some language extensions you can write a function taking pure function and converting it into monadic version (a-la SPJ' work on polyvariadic composition etc [1])
Have monadic function but needs to call it from pure code? use Control.Monad.Identity.
Not a big deal to me but maybe I'm missing the point
In the HaRe catalogue ( http://www.cs.kent.ac.uk/projects/refactor-fp/catalogue/ ) there exists a "Monadification" refactoring:
http://www.cs.kent.ac.uk/projects/refactor-fp/catalogue/Monadification1. html
Alistair ***************************************************************** Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. *****************************************************************
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe