Skip to content

Commit 27a0c26

Browse files
authored
Upgrade to PS 0.15.10, fix warnings (#27)
1 parent 923962f commit 27a0c26

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

src/Options/Applicative/Builder.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ subparser :: forall a. Mod CommandFields a -> Parser a
272272
subparser m = mkParser d g rdr
273273
where
274274
Mod _ d g = metavar "COMMAND" `append` m
275-
groupName /\ cmds /\ subs /\ unit = mkCommand m
275+
groupName /\ cmds /\ subs /\ _ = mkCommand m
276276
rdr = CmdReader groupName cmds subs
277277

278278
-- | Builder for an argument parser.

src/Options/Applicative/Extra.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ hsubparser :: forall a. Mod CommandFields a -> Parser a
8888
hsubparser m = mkParser d g rdr
8989
where
9090
Mod _ d g = metavar "COMMAND" `append` m
91-
groupName /\ cmds /\ subs /\ unit = mkCommand m
91+
groupName /\ cmds /\ subs /\ _ = mkCommand m
9292
rdr = CmdReader groupName cmds (map add_helper <<< subs)
9393
add_helper = over ParserInfo \pinfo -> pinfo
9494
{ infoParser = pinfo.infoParser <**> helper}
@@ -299,5 +299,5 @@ parserFailure pprefs pinfo msg ctx = ParserFailure $ \progn ->
299299

300300
renderFailure :: ParserFailure ParserHelp -> String -> Tuple String ExitCode
301301
renderFailure failure progn =
302-
let h /\ exit /\ cols /\ unit = un ParserFailure failure progn
302+
let h /\ exit /\ cols /\ _ = un ParserFailure failure progn
303303
in Tuple (renderHelp cols h) exit

src/Text/PrettyPrint/Leijen.purs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -694,11 +694,11 @@ flatAlt :: Doc -> Doc -> Doc
694694
flatAlt = FlatAlt
695695

696696
flatten :: Doc -> Doc
697-
flatten (FlatAlt x y) = y
697+
flatten (FlatAlt _ y) = y
698698
flatten (Cat x y) = Cat (flatten x) (flatten y)
699699
flatten (Nest i x) = Nest i (flatten x)
700700
flatten Line = Fail
701-
flatten (Union x y) = flatten x
701+
flatten (Union x _) = flatten x
702702
flatten (Column f) = Column (flatten <<< f)
703703
flatten (Columns f) = Columns (flatten <<< f)
704704
flatten (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.
819819
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
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
837837
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)
844844
| otherwise = true
845845

846846
-----------------------------------------------------------
@@ -859,7 +859,7 @@ renderCompact :: Doc -> SimpleDoc
859859
renderCompact
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
894894
displayS SFail = unsafeCrashWith $ "@SFail@ can not appear uncaught in a rendered @SimpleDoc@"
895895
displayS SEmpty = ""
896896
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
898898
displayS (SLine i x) = "\n" <> indentation i <> displayS x
899899

900900
instance docShow :: Show Doc where

test/Main.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ spec = describe "optparse" $ do
684684
<*> many ( strArgument ( metavar "ARGS..." ) )
685685
i = info p noIntersperse
686686
result = run i ["--foo", "myfile", "-a", "-b", "-c"]
687-
isOK $ assertResult result $ \(b /\ f /\ as /\ unit) ->
687+
isOK $ assertResult result $ \(b /\ f /\ as /\ _) ->
688688
conjoin [ ["-a", "-b", "-c"] === Array.fromFoldable as
689689
, true === b
690690
, "myfile" === f ]

0 commit comments

Comments
 (0)