parent
00c7384d20
commit
7dc6c525eb
|
@ -325,6 +325,30 @@ func (x:+:xr) = x
|
||||||
#test simple guard
|
#test simple guard
|
||||||
func | True = x
|
func | True = x
|
||||||
|
|
||||||
|
#test multiple-clauses-1
|
||||||
|
func x | x = simple expression
|
||||||
|
| otherwise = 0
|
||||||
|
|
||||||
|
#test multiple-clauses-2
|
||||||
|
func x
|
||||||
|
| a somewhat longer guard x = "and a somewhat longer expession that does not"
|
||||||
|
| otherwise = "fit without putting the guards in new lines"
|
||||||
|
|
||||||
|
#test multiple-clauses-3
|
||||||
|
func x
|
||||||
|
| very long guard, another rather long guard that refers to x
|
||||||
|
= nontrivial expression foo bar alsdkjlasdjlasj
|
||||||
|
| otherwise
|
||||||
|
= 0
|
||||||
|
|
||||||
|
#test multiple-clauses-4
|
||||||
|
func x
|
||||||
|
| very loooooooooooooooooooooooooooooong guard
|
||||||
|
, another rather long guard that refers to x
|
||||||
|
= nontrivial expression foo bar alsdkjlasdjlasj
|
||||||
|
| otherwise
|
||||||
|
= 0
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@ -443,31 +467,6 @@ func = do
|
||||||
stmt x
|
stmt x
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
###############################################################################
|
|
||||||
###############################################################################
|
|
||||||
#group equations
|
|
||||||
###############################################################################
|
|
||||||
###############################################################################
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
#test multiple-clauses-1
|
|
||||||
func x | x = simple expression
|
|
||||||
| otherwise = 0
|
|
||||||
|
|
||||||
#test multiple-clauses-2
|
|
||||||
func x
|
|
||||||
| a somewhat longer guard x = "and a somewhat longer expession that does not"
|
|
||||||
| otherwise = "fit without putting the guards in new lines"
|
|
||||||
|
|
||||||
#test multiple-clauses-3
|
|
||||||
func x
|
|
||||||
| very long guard, another rather long guard that refers to x
|
|
||||||
= nontrivial expression foo bar alsdkjlasdjlasj
|
|
||||||
| otherwise
|
|
||||||
= 0
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
###############################################################################
|
###############################################################################
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
|
@ -356,9 +356,12 @@ layoutPatternBindFinal alignmentToken binderDoc mPatDoc clauseDocs mWhereDocs =
|
||||||
( case guardDocs of
|
( case guardDocs of
|
||||||
[] -> []
|
[] -> []
|
||||||
[g] ->
|
[g] ->
|
||||||
[docSeq [appSep $ docLit $ Text.pack "|", return g]]
|
[ docForceSingleline
|
||||||
|
$ docSeq [appSep $ docLit $ Text.pack "|", return g]
|
||||||
|
]
|
||||||
gs ->
|
gs ->
|
||||||
[ docSeq
|
[ docForceSingleline
|
||||||
|
$ docSeq
|
||||||
$ [appSep $ docLit $ Text.pack "|"]
|
$ [appSep $ docLit $ Text.pack "|"]
|
||||||
++ List.intersperse docCommaSep (return <$> gs)
|
++ List.intersperse docCommaSep (return <$> gs)
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue