Johannes Waldmann | 2 Apr 19:34 2013
Picon

mueval, interpreter options

What am I missing? 

I want to use mueval to read a file
that contains "instance Serial m a => Serial m (Tree a)"

(as in
http://hackage.haskell.org/packages/archive/smallcheck/1.0.2/doc/html/Test-SmallCheck-Series.html)

so I put in my call of mueval:         

            let Right opts = M.interpreterOpts []
            keepCurrentDir $ do
                System.Directory.setCurrentDirectory d
                I.runInterpreter $ Mueval.Interpreter.interpreter $ opts
                    { M.timeLimit = 10 -- seconds?
                    , M.modules = Just [ "Prelude"
                        , "Test.SmallCheck.Drivers", "Test.SmallCheck.Series"
                        , "GHC.Generics" ]
                    , M.namedExtensions = [ "MultiParamTypeClasses"
                          , "FlexibleInstances", "DeriveGeneric" ]

but it gives me "MultiParamTypeClasses is not enabled" on inputs like

{-# language MultiParamTypeClasses #-}

import  Test.SmallCheck.Series
import GHC.Generics

data Tree a = Null | Fork (Tree a) a (Tree a)
    deriving Generic
(Continue reading)

Gwern Branwen | 2 Apr 20:32 2013
Picon

Re: mueval, interpreter options


On Tue, Apr 2, 2013 at 1:34 PM, Johannes Waldmann <waldmann <at> imn.htwk-leipzig.de> wrote:
I don't understand mueval's design anyway here:
do the interpreter options mean that these are automatically on,
or just that the source text will be allowed to switch then on?
(I'd prefer the latter.)

I'm not clear on what you're doing there (I don't recognize your snippet), but extensions are enabled as options:

  -X EXTENSION   --extension=EXTENSION    Pass additional flags enabling extensions just like you would to ghc. Example: -XViewPatterns

So for example:

    $ mueval -e "let f (id -> x) = x in f 1" -XViewPatterns
     1
    $ mueval -e "let f (id -> x) = x in f 1" -XMultiParamTypeClasses
     Illegal view pattern:  id -> x
     Use -XViewPatterns to enable view patterns

--
gwern
http://www.gwern.net
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane