> I obtain a new monad composing monad transformers through the IO monad:
> 
> type MyMonad = MT1 (MT2 (... (MTn IO)))
> 
> And now, if I want to lift "putStrLn" I must write:
> 
> myPutStrLn = lift . lift . ... lift . putStrLn
> 
> This works but looks ugly. 
> 
> The question is:
> Is there a way that the system could detect how many 
> lifts are necessary to select the right function?

Of course this is no problem for operators introduced by the monad
transformers, as they are automatically lifted by the class
mechanism.  In my Masters thesis I ended up having to create an IO
monad *transformer*, so that its operators were also automatically
lifted.  Unfortunately, the idea doesn't seem to have caught on.

> Another problem is when some of the monad transformers provide the same 
> functions, for example, if MTi also provides "putStrLn", How could I tell 
> the system to select the first "putStrLn" found, or the last?

Good question.

> Thanks, Jose Labra

--KW 8-)
-- 
: Keith Wansbrough, MSc, BSc(Hons) (Auckland) -------------------------:
: PhD Student, Computing Science, University of Glasgow, Scotland.     :
: Native of Antipodean Auckland, New Zealand: 174d47' E, 36d55' S.     :
: http://www.dcs.gla.ac.uk/~keithw/  mailto:[EMAIL PROTECTED]       :
:----------------------------------------------------------------------:


Reply via email to