haskell / haskell/stylish-haskell

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

Abierto
#181 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Haskell
Estrellas
1k
Forks
153
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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?

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.