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

Extension MultiParameterTypeClasses required by stylish-haskell but not by ghc

Open meditans opened this issue 7 years ago • 3 comments

Hi, on top of my file I had the language options:

{-# LANGUAGE DataKinds, FlexibleContexts #-}
{-# LANGUAGE OverloadedLabels, ScopedTypeVariables, TypeFamilies #-}
{-# LANGUAGE TypeOperators, UndecidableInstances                 #-}

For a file which compiled with ghc. However, stylish-haskell refuses to format the code unless I add also the option MultiParamTypeClasses. This is confusing because the file compiles fine, and in emacs when I try to format it just says that stylish-haskell found some errors in the buffer.

Why does this happen? How are the implied extensions processed?

meditans avatar Aug 26 '16 17:08 meditans

This happens because we use haskell-src-exts as a library to parse the Haskell file. More info can be found in this issue: https://github.com/haskell-suite/haskell-src-exts/issues/304

jaspervdj avatar Aug 27 '16 14:08 jaspervdj

hlint has taken the decision to move away from haskell-src-exts to using ghc-lib-parser instead, in ndmitchell/hlint#892

infinity0 avatar Mar 10 '20 16:03 infinity0

See here for a workaround

infinity0 avatar Mar 10 '20 16:03 infinity0