haskell / haskell/stylish-haskell

Language.Haskell.Stylish.Parse.parseModule: could not parse <unknown>: ParseFailed (SrcLoc "<unknown>.hs" 4 3) "Parse error: prompt"

Aperta
#181 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Haskell
Stelle
1k
Fork
153
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I'm getting the following error using Atom

> Failed to prettify
>
> Command failed: stylish-haskell
> Language.Haskell.Stylish.Parse.parseModule: could not parse : ParseFailed (SrcLoc ".hs" 4 3) "Parse error: prompt"
>
> Hide Stack Trace
>
> Error: Command failed: stylish-haskell
> Language.Haskell.Stylish.Parse.parseModule: could not parse : ParseFailed (SrcLoc ".hs" 4 3) "Parse error: prompt"
> at ChildProcess.exithandler (child_process.js:223:12)
> at emitTwo (events.js:106:13)
> at ChildProcess.emit (events.js:191:7)
> at maybeClose (internal/child_process.js:885:16)
> at Socket. (internal/child_process.js:334:11)
> at emitOne (events.js:96:13)
> at Socket.emit (events.js:188:7)
> at Pipe._handle.close [as _onclose] (net.js:501:12)

or this (simplified) error from the terminal

> Language.Haskell.Stylish.Parse.parseModule: could not parse app/Main.hs: ParseFailed (SrcLoc ".hs" 4 3) "Parse error: prompt"

when I try to use `stylish-haskell` to prettify the file `Main.hs` under `app` of a cabal/stack
Haskell package.

`Main.hs` is the following simple file

```
module Main where
import System.IO

prompt :: String -> IO String
prompt text = do
putStr text
hFlush stdout
getLine

main :: IO ()
main = do

input <- prompt "Enter your name: "
putStrLn ("Hello " ++ input ++ "!")
```

Version of stylish-haskell: 0.8.1.0.

Is this the expected behaviour or is this a bug? If this is the expected behaviour, what's the rationale behind having chosen `stylish-haskell` to work like this?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.