[Haskell-cafe] Lifting IO actions into Applicatives

Jose A. Lopes jabolopes
Tue Oct 1 07:42:24 UTC 2013


On Tue, Oct 01, 2013 at 09:29:00AM +0200, Niklas Haas wrote:
> On Tue, 1 Oct 2013 02:21:13 -0500, John Lato <jwlato at gmail.com> wrote:
> > It's not a solution per se, but it seems to me that there's no need for the
> > Monad superclass constraint on MonadIO.  If that were removed, we could
> > just have
> > 
> > class LiftIO t where
> >     liftIO :: IO a -> t a
> > 
> > and it would Just Work.
> 
> One concern with this is that it's not exactly clear what the semantics
> are on LiftIO (is liftIO a >> liftIO b equal to liftIO (a >> b) or not?)
> and the interaction between LiftIO and Applicative/Monad would have to
> be some sort of ugly ad-hoc law like we have with Bounded/Enum etc.

What is this 'ad-hoc law' you are talking about ?

> 
> Furthermore, you might end up specifying a lot of ?redundant?
> constraints like (Monad m, LiftIO m) that way, just a thing to keep in
> mind.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

-- 
Jose Antonio Lopes
Ganeti Engineering
Google Germany GmbH
Dienerstr. 12, 80331, M?nchen

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Gesch?ftsf?hrer: Graham Law, Christine Elizabeth Flores
Steuernummer: 48/725/00206
Umsatzsteueridentifikationsnummer: DE813741370




More information about the Haskell-Cafe mailing list