stylish-haskell
stylish-haskell copied to clipboard
Extension MultiParameterTypeClasses required by stylish-haskell but not by ghc
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?
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
hlint has taken the decision to move away from haskell-src-exts to using ghc-lib-parser instead, in ndmitchell/hlint#892
See here for a workaround