[Haskell] Mixing monadic and non-monadic functions
Jeremy Gibbons
Jeremy.Gibbons at comlab.ox.ac.uk
Thu Sep 8 04:09:28 EDT 2005
On Wed, 7 Sep 2005, Frederik Eaton wrote:
> I want the type system to be able to do "automatic lifting" of monads,
> i.e., since [] is a monad, I should be able to write the following:
>
> [1,2]+[3,4]
>
> and have it interpreted as "do {a<-[1,2]; b<-[3,4]; return (a+b)}".
You might want to take a look at "Monadification of Functional Programs"
by Erwig and Ren (Science of Computer Programming, 52:101-129, 2004):
http://web.engr.oregonstate.edu/~erwig/papers/abstracts.html
which describes the transformation that introduces such a monadic
structure.
Jeremy
Jeremy.Gibbons at comlab.ox.ac.uk
Oxford University Computing Laboratory, TEL: +44 1865 283508
Wolfson Building, Parks Road, FAX: +44 1865 273839
Oxford OX1 3QD, UK.
URL: http://www.comlab.ox.ac.uk/oucl/people/jeremy.gibbons.html
More information about the Haskell
mailing list