mirror of
https://github.com/ilyakooo0/ormolu.git
synced 2024-11-09 15:42:12 +03:00
More compact rendering of type family injectivity constraints
This commit is contained in:
parent
a37765cbcb
commit
84c2a53349
@ -8,6 +8,9 @@
|
||||
other cases of rendering of operators. [Issue
|
||||
500](https://github.com/tweag/ormolu/issues/500).
|
||||
|
||||
* More compact rendering of type family injectivity constraints. [Issue
|
||||
482](https://github.com/tweag/ormolu/issues/482).
|
||||
|
||||
## Ormolu 0.0.3.1
|
||||
|
||||
* Fixed rendering of record updates with the record dot preprocessor syntax
|
||||
|
@ -1,7 +1,6 @@
|
||||
type family
|
||||
Id a =
|
||||
result
|
||||
| result -> a where
|
||||
result | result -> a where
|
||||
Id a =
|
||||
a
|
||||
|
||||
@ -10,8 +9,7 @@ type family
|
||||
(a :: k)
|
||||
b
|
||||
c =
|
||||
foo
|
||||
| foo -> k b where
|
||||
foo | foo -> k b where
|
||||
G a b c =
|
||||
(a, b)
|
||||
|
||||
|
@ -11,7 +11,7 @@ where
|
||||
|
||||
import BasicTypes (LexicalFixity (..))
|
||||
import Control.Monad
|
||||
import Data.Maybe (isJust, isNothing)
|
||||
import Data.Maybe (isNothing)
|
||||
import GHC
|
||||
import Ormolu.Printer.Combinators
|
||||
import Ormolu.Printer.Meat.Common
|
||||
@ -36,11 +36,11 @@ p_famDecl style FamilyDecl {fdTyVars = HsQTvs {..}, ..} = do
|
||||
inci
|
||||
(p_rdrName fdLName)
|
||||
(located' p_hsTyVarBndr <$> hsq_explicit)
|
||||
let rsig = p_familyResultSigL fdResultSig
|
||||
unless (isNothing rsig && isNothing fdInjectivityAnn) space
|
||||
let resultSig = p_familyResultSigL fdResultSig
|
||||
unless (isNothing resultSig && isNothing fdInjectivityAnn) space
|
||||
inci $ do
|
||||
sequence_ rsig
|
||||
when (isJust rsig && isJust fdInjectivityAnn) breakpoint
|
||||
sequence_ resultSig
|
||||
space
|
||||
forM_ fdInjectivityAnn (located' p_injectivityAnn)
|
||||
case mmeqs of
|
||||
Nothing -> return ()
|
||||
|
Loading…
Reference in New Issue
Block a user