atom-haskell / ide-haskell

Haskell IDE plugin for Atom editor
https://atom.io/packages/ide-haskell
Other
232 stars 30 forks source link

Prettify swallows stylish-haskell errors #180

Closed ramirez7 closed 7 years ago

ramirez7 commented 7 years ago

Example file:

module Example where
import Control.Monad.Except (MonadError(..))

orFail :: MonadError e m => Maybe a -> e -> m a
orFail (Just a) _ = pure a
orFail Nothing e = throwError e

If I Prettify this file in Atom, nothing happens, and I don't get any indication of why.

If I run stylish-haskell on this file, I get the following output:

Armandos-MacBook-Pro% stylish-haskell src/Example.hs                
Language.Haskell.Stylish.Parse.parseModule: could not parse src/Example.hs: \
ParseFailed (SrcLoc "<unknown>.hs" 4 29) "MultiParamTypeClasses language \
extension is not enabled. Please add {-# LANGUAGE MultiParamTypeClasses #-} \
pragma at the top of your module."
module Example where
import Control.Monad.Except (MonadError(..))

orFail :: MonadError e m => Maybe a -> e -> m a
orFail (Just a) _ = pure a
orFail Nothing e = throwError e

Once I add {-# LANGUAGE MultiParamTypeClasses #-} to my file, Prettify works in Atom.

It looks like this might be stylish-haskell's fault, as it returns 0 despite failing to parse the file.

lierdakil commented 7 years ago

Seems to be fixed upstream. Also fixed in ide-haskell a while ago.