Equational constraint produces syntactically invalid result #267

Closed
opened 2019-11-26 15:30:55 +01:00 by mx-psi · 4 comments
mx-psi commented 2019-11-26 15:30:55 +01:00 (Migrated from github.com)

Running brittany 0.12.1.0 with the following program

{-# LANGUAGE TypeFamilies #-}

f :: ((~) a b) => a -> b
f = id

outputs ERROR: brittany pretty printer returned syntactically invalid result.

Running brittany 0.12.1.0 with the following program ```haskell {-# LANGUAGE TypeFamilies #-} f :: ((~) a b) => a -> b f = id ``` outputs `ERROR: brittany pretty printer returned syntactically invalid result.`
tfausak commented 2019-11-26 16:45:09 +01:00 (Migrated from github.com)

Here's what Brittany outputs with --output-on-errors:

{-# LANGUAGE TypeFamilies #-}
f :: ((Data.Type.Equality~) a b) => a -> b
f = id

Also worth noting that the following equivalent program works fine:

{-# language TypeFamilies #-}
f :: a ~ b => a -> b
f = id

Might be somewhat related to #258.

Here's what Brittany outputs with `--output-on-errors`: ``` hs {-# LANGUAGE TypeFamilies #-} f :: ((Data.Type.Equality~) a b) => a -> b f = id ``` Also worth noting that the following equivalent program works fine: ``` hs {-# language TypeFamilies #-} f :: a ~ b => a -> b f = id ``` Might be somewhat related to #258.
lspitzner commented 2019-11-27 21:48:24 +01:00 (Migrated from github.com)

We already have some special-casing around this at

059bb9402e/src/Language/Haskell/Brittany/Internal/LayouterBasics.hs (L235-L239)

I wonder why this does not trigger here.

We already have some special-casing around this at https://github.com/lspitzner/brittany/blob/059bb9402e207c1be0a2f7a9f0673238240531fe/src/Language/Haskell/Brittany/Internal/LayouterBasics.hs#L235-L239 I wonder why this does not trigger here.
lspitzner commented 2019-11-27 22:26:39 +01:00 (Migrated from github.com)

Should be fixed in 77d6d5b553, will merge into master if CI is green in a few minutes.

Should be fixed in 77d6d5b553720102f05b3977f89566f2c5c1960b, will merge into master if CI is green in a few minutes.
lspitzner commented 2019-12-09 22:59:26 +01:00 (Migrated from github.com)

fixed in 0.12.1.1

fixed in 0.12.1.1
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: hexagoxel/brittany#267
There is no content yet.