@@ -694,11 +694,11 @@ flatAlt :: Doc -> Doc -> Doc
694
694
flatAlt = FlatAlt
695
695
696
696
flatten :: Doc -> Doc
697
- flatten (FlatAlt x y) = y
697
+ flatten (FlatAlt _ y) = y
698
698
flatten (Cat x y) = Cat (flatten x) (flatten y)
699
699
flatten (Nest i x) = Nest i (flatten x)
700
700
flatten Line = Fail
701
- flatten (Union x y ) = flatten x
701
+ flatten (Union x _ ) = flatten x
702
702
flatten (Column f) = Column (flatten <<< f)
703
703
flatten (Columns f) = Columns (flatten <<< f)
704
704
flatten (Nesting f) = Nesting (flatten <<< f)
@@ -783,7 +783,7 @@ renderFits fits rfrac w headNode
783
783
-- k = current column
784
784
-- (ie. (k >= n) && (k - n == count of inserted characters)
785
785
best :: Int -> Int -> Docs -> LazySimpleDoc
786
- best n k Nil = SEmpty'
786
+ best _ _ Nil = SEmpty'
787
787
best n k (Cons i d ds)
788
788
= case d of
789
789
Fail -> SFail'
@@ -817,12 +817,12 @@ renderFits fits rfrac w headNode
817
817
818
818
-- | @fits1@ does 1 line lookahead.
819
819
fits1 :: Int -> Int -> Int -> LazySimpleDoc -> Boolean
820
- fits1 _ _ w x | w < 0 = false
821
- fits1 _ _ w SFail' = false
822
- fits1 _ _ w SEmpty' = true
823
- fits1 p m w (SChar' c x) = fits1 p m (w - 1 ) (force x)
824
- fits1 p m w (SText' l s x) = fits1 p m (w - l) (force x)
825
- fits1 _ _ w (SLine' i x ) = true
820
+ fits1 _ _ w _ | w < 0 = false
821
+ fits1 _ _ _ SFail' = false
822
+ fits1 _ _ _ SEmpty' = true
823
+ fits1 p m w (SChar' _ x) = fits1 p m (w - 1 ) (force x)
824
+ fits1 p m w (SText' l _ x) = fits1 p m (w - l) (force x)
825
+ fits1 _ _ _ (SLine' _ _ ) = true
826
826
827
827
-- | @fitsR@ has a little more lookahead: assuming that nesting roughly
828
828
-- | corresponds to syntactic depth, @fitsR@ checks that not only the current line
@@ -835,12 +835,12 @@ fits1 _ _ w (SLine' i x) = true
835
835
-- | m = minimum nesting level to fit in
836
836
-- | w = the width in which to fit the first line
837
837
fitsR :: Int -> Int -> Int -> LazySimpleDoc -> Boolean
838
- fitsR p m w x | w < 0 = false
839
- fitsR p m w SFail' = false
840
- fitsR p m w SEmpty' = true
841
- fitsR p m w (SChar' c x) = fitsR p m (w - 1 ) (force x)
842
- fitsR p m w (SText' l s x) = fitsR p m (w - l) (force x)
843
- fitsR p m w (SLine' i x) | m < i = fitsR p m (p - i) (force x)
838
+ fitsR _ _ w _ | w < 0 = false
839
+ fitsR _ _ _ SFail' = false
840
+ fitsR _ _ _ SEmpty' = true
841
+ fitsR p m w (SChar' _ x) = fitsR p m (w - 1 ) (force x)
842
+ fitsR p m w (SText' l _ x) = fitsR p m (w - l) (force x)
843
+ fitsR p m _ (SLine' i x) | m < i = fitsR p m (p - i) (force x)
844
844
| otherwise = true
845
845
846
846
-- ---------------------------------------------------------
@@ -859,7 +859,7 @@ renderCompact :: Doc -> SimpleDoc
859
859
renderCompact
860
860
= scan 0 <<< List .singleton
861
861
where
862
- scan k List.Nil = SEmpty
862
+ scan _ List.Nil = SEmpty
863
863
scan k (d List .: ds) = case d of
864
864
Fail -> SFail
865
865
Empty -> scan k ds
@@ -868,8 +868,8 @@ renderCompact
868
868
FlatAlt x _ -> scan k (x List .: ds)
869
869
Line -> SLine 0 (scan 0 ds)
870
870
Cat x y -> scan k (x List .: y List .: ds)
871
- Nest j x -> scan k (x List .: ds)
872
- Union x y -> scan k (y List .: ds)
871
+ Nest _ x -> scan k (x List .: ds)
872
+ Union _ y -> scan k (y List .: ds)
873
873
Column f -> scan k (f k List .: ds)
874
874
Columns f -> scan k (f Nothing List .: ds)
875
875
Nesting f -> scan k (f 0 List .:ds)
@@ -894,7 +894,7 @@ displayS :: SimpleDoc -> String
894
894
displayS SFail = unsafeCrashWith $ " @SFail@ can not appear uncaught in a rendered @SimpleDoc@"
895
895
displayS SEmpty = " "
896
896
displayS (SChar c x) = fromCharArray [c] <> displayS x
897
- displayS (SText l s x) = s <> displayS x
897
+ displayS (SText _ s x) = s <> displayS x
898
898
displayS (SLine i x) = " \n " <> indentation i <> displayS x
899
899
900
900
instance docShow :: Show Doc where
0 commit comments