0

Why does -XImplicitParams work from the command line but not the OPTIONS_GHC pragma?

I've found that ghc t.hs throws a parse error on input 'a' if t.hs contains the following code, while ghc -XImplicitParams t.hs works fine. Ditto ghci.

{- OPTIONS_GHC -XImplicitParams -}
f :: (?a :: Int) => Int -> Int
f b = ?a + b
g c = f $ c+1
imz -- Ivan Zakharyaschev
  • 4,921
  • 6
  • 53
  • 104
Jeff Burdges
  • 4,204
  • 23
  • 46

1 Answers1

8

That would need to be a pragma, with {-# ... #-} delimiters. Better than an OPTIONS_GHC pragma is a

{-# LANGUAGE ImplicitParams #-}

pragma.

Daniel Fischer
  • 181,706
  • 17
  • 308
  • 431