Building with the latest version of haskeline

33 views
Skip to first unread message

Jason Dagit

unread,
Oct 27, 2012, 9:40:58 PM10/27/12
to idris...@googlegroups.com
I started looking at what it would take to build Idris with the latest release of Haskeline.

It looks like the latest version very explicitly prefers the strict version of StateT, as you can see from the import list: http://hackage.haskell.org/packages/archive/haskeline/latest/doc/html/src/System-Console-Haskeline-MonadException.html

import Control.Monad.Trans.State.Strict
instance MonadException m => MonadException (StateT s m) where
    controlIO f = StateT $ \s -> controlIO $ \(RunIO run) -> let
                    run' = RunIO (fmap (StateT . const) . run . flip runStateT s)
                    in fmap (flip runStateT s) $ f run'

Idris on the other hand, uses StateT from Control.Monad.State: http://hackage.haskell.org/packages/archive/mtl/latest/doc/html/src/Control-Monad-State.html
module Control.Monad.State (
  module Control.Monad.State.Lazy
  ) where

Which, as you can see, is a re-export of the lazy StateT transformer. I changed just the imports in Idris to use strict StateT and I was able to build against the latest Haskeline. I'm on windows so I ran into other build problems (I need gmp installed), but the basic idris interpreter can be built and the standard libs can be built as well. I can send a pull request on github if you're interested. I haven't tested my changes against older haskelines.

Jason

Edwin Brady

unread,
Oct 28, 2012, 6:39:13 AM10/28/12
to idris...@googlegroups.com
Hi Jason,
That's great! If you can send me a pull request I'll check it works on Mac/Linux and apply it if so. Would be nice to have everything up to date.

Thanks.
Edwin.

Jason Dagit

unread,
Oct 28, 2012, 7:42:08 PM10/28/12
to idris...@googlegroups.com
Sent!

The only things that I think we can break with this are:
  * If you really depend on lazy StateT then possibly switching to strict is bad.
  * Might not work on older haskelines. I didn't check that they have proper instances for strict StateT.

But really, this should be harmless and lazy StateT is usually not what people want due to building up thunks.

Jason

Jason Dagit

unread,
Oct 29, 2012, 3:09:00 PM10/29/12
to idris...@googlegroups.com
I just sent you a new pull request. My intent was to only include changes to the makefile, but because of the way I submitted the pull request it includes changes I made _after_ the pull request.  Notably, I figured out the problem with the travis-ci configuration.


It takes about 2 seconds once you have an account with travis-ci.

If you didn't already figure it out, travis-ci is a continuous integration service. You can also do fancy things like including a build status icon on the github page and get email notification when builds fail. As you can see here, my latest patches build: https://travis-ci.org/#!/dagit/Idris-dev

Thanks!
Jason
Reply all
Reply to author
Forward
0 new messages