Skip to content

Commit

Permalink
Use isTrue/isFalse
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonchinn178 committed Jun 11, 2024
1 parent dea2aa5 commit ae397f9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ormolu.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ library
base >=4.14 && <5,
binary >=0.8 && <0.9,
bytestring >=0.2 && <0.13,
choice >=0.1 && <0.3,
choice >=0.2.4.1 && <0.3,
containers >=0.5 && <0.8,
deepseq >=1.4 && <1.6,
directory ^>=1.3,
Expand Down
2 changes: 1 addition & 1 deletion src/Ormolu/Fixity/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ inferFixity ::
-- | The resulting fixity approximation
FixityApproximation
inferFixity debug rdrName (ModuleFixityMap m) =
if Choice.toBool debug
if Choice.isTrue debug
then
trace
(renderFixityJustification opName moduleName m result)
Expand Down
2 changes: 1 addition & 1 deletion src/Ormolu/Printer/Meat/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ p_hsDoc hstyle needsNewline (L l str) = do
else newline >> txt "--"
space
unless (T.null x) (txt x)
when (Choice.toBool needsNewline) newline
when (Choice.isTrue needsNewline) newline
case l of
UnhelpfulSpan _ ->
-- It's often the case that the comment itself doesn't have a span
Expand Down
6 changes: 3 additions & 3 deletions src/Ormolu/Printer/Meat/Declaration/Data.hs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ p_dataDecl style name tyVars getTyVarLoc p_tyVar fixity HsDataDefn {..} = do
if hasHaddocks dd_cons'
then newline
else
if Choice.toBool singleRecCon && compactLayoutAroundEquals
if Choice.isTrue singleRecCon && compactLayoutAroundEquals
then space
else breakpoint
equals
Expand All @@ -126,7 +126,7 @@ p_dataDecl style name tyVars getTyVarLoc p_tyVar fixity HsDataDefn {..} = do
then newline >> txt "|" >> space
else space >> txt "|" >> space
sitcc' =
if hasHaddocks dd_cons' || not (Choice.toBool singleRecCon)
if hasHaddocks dd_cons' || Choice.isFalse singleRecCon
then sitcc
else id
sep s (sitcc' . located' (p_conDecl singleRecCon)) dd_cons'
Expand Down Expand Up @@ -215,7 +215,7 @@ p_conDecl singleRecCon = \case
RecCon l -> do
p_rdrName con_name
breakpoint
inciIf (not (Choice.toBool singleRecCon)) (located l p_conDeclFields)
inciIf (Choice.isFalse singleRecCon) (located l p_conDeclFields)
InfixCon (HsScaled _ x) (HsScaled _ y) -> do
located x p_hsType
breakpoint
Expand Down

0 comments on commit ae397f9

Please sign in to comment.