문제

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
도움이 되었습니까?

해결책

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

{-# LANGUAGE ImplicitParams #-}

pragma.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top