lspitzner / brittany

haskell source code formatter
GNU Affero General Public License v3.0
690 stars 72 forks source link

Fails with arrow syntax and line break #306

Open chrissound opened 4 years ago

chrissound commented 4 years ago

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 -< ()