stylish-haskell icon indicating copy to clipboard operation
stylish-haskell copied to clipboard

Bad requirement of MultiParamTypeClasses

Open cblp opened this issue 9 years ago • 5 comments

{-# LANGUAGE FlexibleContexts #-}

module Test where

import Control.Monad.Reader

test :: MonadReader a m => m a
test = undefined

This code is OK for GHC, but stylish-haskell requires additional MultiParamTypeClasses.

The error is Language.Haskell.Stylish.Parse.parseModule: could not parse a.hs: ParseFailed (SrcLoc "<unknown>.hs" 7 28) "MultiParamTypeClasses language extension is not enabled. Please add {-# LANGUAGE MultiParamTypeClasses #-} pragma at the top of your module."

UPD. Depends on https://github.com/haskell-suite/haskell-src-exts/issues/304

cblp avatar Apr 25 '16 08:04 cblp

This is a haskell-src-exts issue.

jaspervdj avatar Apr 25 '16 09:04 jaspervdj

I opened corresponding https://github.com/haskell-suite/haskell-src-exts/issues/304

cblp avatar Apr 25 '16 12:04 cblp

For user, this is a bug in stylish-haskell, because (1) it doesn't do what it promised and (2) it was stylish-haskell's author who decided to use haskell-src-exts as a parser.

cblp avatar Apr 25 '16 12:04 cblp

Thank you for reopening.

cblp avatar Apr 25 '16 12:04 cblp

See here for a workaround

infinity0 avatar Mar 10 '20 16:03 infinity0