Johannes Waldmann | 2 Apr 19:34 2013

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

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

Re: mueval, interpreter options

On Tue, Apr 2, 2013 at 1:34 PM, Johannes Waldmann <waldmann <at>> 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
    $ mueval -e "let f (id -> x) = x in f 1" -XMultiParamTypeClasses
     Illegal view pattern:  id -> x
     Use -XViewPatterns to enable view patterns

Haskell-Cafe mailing list
Haskell-Cafe <at>