@@ -694,11 +694,11 @@ flatAlt :: Doc -> Doc -> Doc
694694flatAlt = FlatAlt
695695
696696flatten :: Doc -> Doc
697- flatten (FlatAlt x y) = y
697+ flatten (FlatAlt _ y) = y
698698flatten (Cat x y) = Cat (flatten x) (flatten y)
699699flatten (Nest i x) = Nest i (flatten x)
700700flatten Line = Fail
701- flatten (Union x y ) = flatten x
701+ flatten (Union x _ ) = flatten x
702702flatten (Column f) = Column (flatten <<< f)
703703flatten (Columns f) = Columns (flatten <<< f)
704704flatten (Nesting f) = Nesting (flatten <<< f)
@@ -783,7 +783,7 @@ renderFits fits rfrac w headNode
783783 -- k = current column
784784 -- (ie. (k >= n) && (k - n == count of inserted characters)
785785 best :: Int -> Int -> Docs -> LazySimpleDoc
786- best n k Nil = SEmpty'
786+ best _ _ Nil = SEmpty'
787787 best n k (Cons i d ds)
788788 = case d of
789789 Fail -> SFail'
@@ -817,12 +817,12 @@ renderFits fits rfrac w headNode
817817
818818-- | @fits1@ does 1 line lookahead.
819819fits1 :: 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
826826
827827-- | @fitsR@ has a little more lookahead: assuming that nesting roughly
828828-- | corresponds to syntactic depth, @fitsR@ checks that not only the current line
@@ -835,12 +835,12 @@ fits1 _ _ w (SLine' i x) = true
835835-- | m = minimum nesting level to fit in
836836-- | w = the width in which to fit the first line
837837fitsR :: 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)
844844 | otherwise = true
845845
846846-- ---------------------------------------------------------
@@ -859,7 +859,7 @@ renderCompact :: Doc -> SimpleDoc
859859renderCompact
860860 = scan 0 <<< List .singleton
861861 where
862- scan k List.Nil = SEmpty
862+ scan _ List.Nil = SEmpty
863863 scan k (d List .: ds) = case d of
864864 Fail -> SFail
865865 Empty -> scan k ds
@@ -868,8 +868,8 @@ renderCompact
868868 FlatAlt x _ -> scan k (x List .: ds)
869869 Line -> SLine 0 (scan 0 ds)
870870 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)
873873 Column f -> scan k (f k List .: ds)
874874 Columns f -> scan k (f Nothing List .: ds)
875875 Nesting f -> scan k (f 0 List .:ds)
@@ -894,7 +894,7 @@ displayS :: SimpleDoc -> String
894894displayS SFail = unsafeCrashWith $ " @SFail@ can not appear uncaught in a rendered @SimpleDoc@"
895895displayS SEmpty = " "
896896displayS (SChar c x) = fromCharArray [c] <> displayS x
897- displayS (SText l s x) = s <> displayS x
897+ displayS (SText _ s x) = s <> displayS x
898898displayS (SLine i x) = " \n " <> indentation i <> displayS x
899899
900900instance docShow :: Show Doc where
0 commit comments