lspitzner / lspitzner/brittany
Fails with arrow syntax and line break
Open
Nobody has claimed this yet.
bug
hs:arrows
language extension support
layouting
- Dominant language
- Haskell
- Stars
- 686
- Forks
- 69
- PR merge metrics
- No merged PRs in 30d
Description
Not 100% sure this is a bug - not too familiar with the Arrows lang ext.
{-# LANGUAGE Arrows #-}
{-# LANGUAGE OverloadedStrings #-}
module MyModel where
import Data.Time
personSelect :: Select UserMatchA
personSelect =
proc () -> row -< ()
outputs
brittany --output-on-errors MyModel.hs
ERROR: brittany pretty printer returned syntactically invalid result.
ERROR: encountered unknown syntactical constructs:
HsProc{} at MyModel.hs:10:3-22
{-# LANGUAGE Arrows #-}
{-# LANGUAGE OverloadedStrings #-}
module MyModel where
import Data.Time
personSelect :: Select UserMatchA
personSelect = {- BRITTANY ERROR UNHANDLED SYNTACTICAL CONSTRUCT -}
The above fails while if we remove a line break it works:
{-# LANGUAGE Arrows #-}
{-# LANGUAGE OverloadedStrings #-}
module MyModel where
import Data.Time
personSelect :: Select UserMatchA
personSelect = proc () -> row -< ()
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with the MyModel.hs example using brittany --output-on-errors, comparing the versions with and without the line break. Start by tracing how the formatter handles the HsProc construct; done means the multiline arrow syntax formats without producing syntactically invalid output or an unhandled-construct marker.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100