Re: [Haskell-cafe] MonadPeelIO instance for monad transformers on top of "forall"

2011-02-04 Thread Anders Kaseorg
On Fri, 4 Feb 2011, Anders Kaseorg wrote: > but isn’t M isomorphic to ReaderT () IO (via unM :: M a -> ReaderT () IO > a, M . mapReaderT liftIO :: IO a -> M a)? Er, M . mapReaderT liftIO :: ReaderT () IO a -> M a. Of course that doesn’t actually type check until you eta-expa

Re: [Haskell-cafe] MonadPeelIO instance for monad transformers on top of "forall"

2011-02-04 Thread Anders Kaseorg
On Fri, 4 Feb 2011, Max Bolingbroke wrote: > On 4 February 2011 21:41, Anders Kaseorg wrote: > > On Fri, 4 Feb 2011, Max Bolingbroke wrote: > >> data M a = M { unM :: forall m. MonadPeelIO m => Reader.ReaderT () m a } > > > > Maybe this won’t help in your actual c

Re: [Haskell-cafe] MonadPeelIO instance for monad transformers on top of "forall"

2011-02-04 Thread Anders Kaseorg
On Fri, 4 Feb 2011, Max Bolingbroke wrote: > data M a = M { unM :: forall m. MonadPeelIO m => Reader.ReaderT () m a } Maybe this won’t help in your actual code, but isn’t M isomorphic to IO (via unM :: M a -> IO a, M . liftIO :: IO a -> M a)? instance MonadPeelIO M where peelIO = M (liftIO (li

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-08 Thread Anders Kaseorg
On Wed, 8 Dec 2010, Brandon S Allbery KF8NH wrote: > Then build your CGIs restricted. Restricting the runtime by default, > *especially* when setting runtime options at compile time is so much of > a pain, is just going to cause problems. I'm already thinking that I > may have to skip ghc7. O

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-07 Thread Anders Kaseorg
On Sat, 2010-12-04 at 13:42 -0500, Brandon S Allbery KF8NH wrote: > We went over this some time back; the GHC runtime is wrong here, it > should only disable flags when running with geteuid() == 0. No. +RTS flags on the command line, at least, need to stay disabled in all cases, not just setuid b

Re: [Haskell-cafe] Generalized monadic exception handling with monad-peel

2010-11-03 Thread Anders Kaseorg
On Wed, 3 Nov 2010, Bas van Dijk wrote: > Something else: In the soon to be released base-4.3 the block and > unblock functions will be deprecated in favor of mask. It would be great > if you can also add these new functions to Control.Exception.Peel: Yeah, I was putting off learning how to deal

[Haskell-cafe] Generalized monadic exception handling with monad-peel

2010-11-03 Thread Anders Kaseorg
I just released the monad-peel library to Hackage. http://hackage.haskell.org/package/monad-peel MonadPeelIO is a simple class that allows lifting monadic control operations, such as those in Control.Exception and Foreign.Marshal.Alloc, through layers of monad transformers. It comes with inst

[Haskell-cafe] Re: using Network.CGI

2010-08-06 Thread Anders Kaseorg
On Fri, 6 Aug 2010, Andrew U. Frank wrote: > i think this limits what network.cgi can be used for: it will work only > on systems, where the output from the ghc can execute. That’s not a limitation of Network.CGI; it’s just the way CGI always works, no matter what language you use. http://en.wik

[Haskell-cafe] Re: using Network.CGI

2010-08-05 Thread Anders Kaseorg
On Thu, 5 Aug 2010, Andrew U. Frank wrote: > which is clearly not producing the second part of the code, namely > output a greeting. That’s what it’s supposed to output. Have you considered typing in a name and submitting the form? It works fine for me: . >

Re: [Haskell-cafe] Re: Move MonadIO to base

2010-04-20 Thread Anders Kaseorg
On Tue, 20 Apr 2010, wren ng thornton wrote: > -- | The isomorphic Haskell98 version > class Monad m => MonadJoinIO m where > -- | Embed the IO into the monad m > joinIO :: IO (m a) -> m a > > -- | Extract the IO computation to the top level, > -- r

[Haskell-cafe] Re: Move MonadIO to base

2010-04-19 Thread Anders Kaseorg
On Mon, 19 Apr 2010, Isaac Dupree wrote: > Do you see the difference? Yes; my question is more whether Wren has a more clever way to get an isomorphism (forall b. (m a -> IO b) -> IO b) <-> IO (m a) that would make the simpler interface work out. (Or maybe I misunderstood what he was getting a

[Haskell-cafe] Re: Move MonadIO to base

2010-04-18 Thread Anders Kaseorg
On Sun, 18 Apr 2010, wren ng thornton wrote: > lift ma = morph (\k -> join (fmap (k . return) ma)) Monad laws simplify that to lift ma = morph (\k -> ma >>= k . return) > The type of morph requires us to Church-encode things needlessly; what > we mean to say is: morph (fmap return ma).

[Haskell-cafe] Re: Cabal Compiler Flag Problem

2010-03-23 Thread Anders Kaseorg
On Wed, 24 Mar 2010, Ben Derrett wrote: > Control/Monad/CatchIO.hs:146:34: >     Illegal signature in pattern: E.SomeException >         Use -XPatternSignatures to permit it A fix is to avoid using a pattern signature in Control/Monad/CatchIO.hs: -onException a onEx = a `catch` (\(e::E.SomeExcept