Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant parse template haskell #21

Closed
srghma opened this issue Oct 16, 2017 · 1 comment
Closed

Cant parse template haskell #21

srghma opened this issue Oct 16, 2017 · 1 comment

Comments

@srghma
Copy link

srghma commented Oct 16, 2017

file src

module Lib where

import           Data.Aeson.TH as Aeson
import           Protolude

data Freeplay = Freeplay
  { freeplay :: !Bool
  , operator :: !Text
  , token    :: !Text
  , site     :: !Text
  }

data AuthRequest = AuthRequest
  { cmd        :: !Text
  , gameId     :: !Text
  , launchVars :: Freeplay
  }

$(Aeson.deriveJSON Aeson.defaultOptions ''Freeplay)
$(Aeson.deriveJSON Aeson.defaultOptions ''AuthRequest)
 ~/projects/hask-test   master  hfmt -w src/Lib.hs
Error reformatting src/Lib.hs: Language.Haskell.Stylish.Parse.parseModule: could not parse <unknown>: ParseFailed (SrcLoc "<unknown>.hs" 19 1) "Parse error: $"
hfmt: app/Main.hs:(71,1)-(73,41): Non-exhaustive patterns in function sourceChangedOrHasSuggestions

though project compiled fine

@srghma
Copy link
Author

srghma commented Oct 17, 2017

resolved
solution:

stylish-haskell -d > .stylish-haskell.yaml
# edit .stylish-haskell.yaml
language_extensions:
  - TemplateHaskell
  - QuasiQuotes

I think it should be noted somewhere that hfmt can use config files of wrapped formatters

@srghma srghma closed this as completed Oct 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant