Skip to content

Commit 6aac1c5

Browse files
author
Serhii Khoma
committed
feat: update to purs 0.14, fix warnings, change deprecated memoize package to open-memoize (https://github.com/purescript-open-community/purescript-open-memoize)
1 parent 597acb9 commit 6aac1c5

File tree

13 files changed

+115
-73
lines changed

13 files changed

+115
-73
lines changed

packages.dhall

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
11
let upstream =
2-
https://github.com/purescript/package-sets/releases/download/psc-0.14.0-20210311/packages.dhall sha256:3da8be2b7b4a0e7de6186591167b363023695accffb98a8639e9e7d06e2070d6
2+
https://github.com/purescript/package-sets/releases/download/psc-0.14.0-20210409/packages.dhall sha256:e81c2f2ce790c0e0d79869d22f7a37d16caeb5bd81cfda71d46c58f6199fd33f
3+
with open-memoize =
4+
{ dependencies =
5+
[ "console"
6+
, "effect"
7+
, "psci-support"
8+
, "strings"
9+
, "lists"
10+
, "either"
11+
, "integers"
12+
, "lazy"
13+
, "maybe"
14+
, "partial"
15+
, "prelude"
16+
, "tuples"
17+
]
18+
, repo =
19+
"https://github.com/purescript-open-community/purescript-memoize.git"
20+
, version =
21+
"master"
22+
}
323

424
in upstream

spago.dhall

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,34 @@
44
, "effect"
55
, "exitcodes"
66
, "strings"
7-
, "ordered-collections"
87
, "arrays"
98
, "console"
10-
, "memoize"
9+
, "open-memoize"
1110
, "transformers"
1211
, "exists"
1312
, "node-process"
1413
, "free"
1514
, "quickcheck"
1615
, "spec"
16+
, "aff"
17+
, "bifunctors"
18+
, "control"
19+
, "either"
20+
, "enums"
21+
, "foldable-traversable"
22+
, "gen"
23+
, "integers"
24+
, "lazy"
25+
, "lists"
26+
, "maybe"
27+
, "newtype"
28+
, "node-buffer"
29+
, "node-streams"
30+
, "nonempty"
31+
, "numbers"
32+
, "partial"
33+
, "tailrec"
34+
, "tuples"
1735
]
1836
, packages = ./packages.dhall
1937
, sources = [ "src/**/*.purs", "test/**/*.purs" ]

src/Options/Applicative.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Options.Applicative
1+
module Options.Applicative
22
( module Options.Applicative.Builder
33
, module Options.Applicative.Builder.Completer
44
, module Options.Applicative.Extra

src/Options/Applicative/Builder.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module Options.Applicative.Builder
6060
, disabled
6161

6262
-- * Builder for 'ParserInfo'
63-
, InfoMod
63+
, InfoMod(..)
6464
, fullDesc
6565
, briefDesc
6666
, header
@@ -75,7 +75,7 @@ module Options.Applicative.Builder
7575
, info
7676

7777
-- * Builder for 'ParserPrefs'
78-
, PrefsMod
78+
, PrefsMod(..)
7979
, multiSuffix
8080
, disambiguate
8181
, showHelpOnError

src/Options/Applicative/Builder/Completer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ exports.execSyncCommand = function(command) {
55
return function() {
66
return execSync(command);
77
};
8-
};
8+
};

src/Options/Applicative/Builder/Internal.purs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import Data.Tuple (Tuple, fst)
3333
import Data.Foldable (lookup)
3434
import Data.Tuple.Nested (Tuple3, (/\))
3535

36+
newtype OptionFields :: forall k. k -> Type
3637
newtype OptionFields a = OptionFields
3738
{ optNames :: Array OptName
3839
, optCompleter :: Completer
@@ -49,10 +50,12 @@ newtype CommandFields a = CommandFields
4950
, cmdGroup :: Maybe String }
5051
derive instance newtypeCommandFields :: Newtype (CommandFields a) _
5152

53+
newtype ArgumentFields :: forall k. k -> Type
5254
newtype ArgumentFields a = ArgumentFields
5355
{ argCompleter :: Completer }
5456
derive instance newtypeArgumentFields :: Newtype (ArgumentFields a) _
5557

58+
class HasName :: forall k. (k -> Type) -> Constraint
5659
class HasName f where
5760
name :: forall a. OptName -> f a -> f a
5861

@@ -63,6 +66,7 @@ instance optionFieldsHasName :: HasName OptionFields where
6366
instance flagFieldsHasName :: HasName FlagFields where
6467
name n = over FlagFields \fields -> fields{ flagNames = [n] <> fields.flagNames }
6568

69+
class HasCompleter :: forall k. (k -> Type) -> Constraint
6670
class HasCompleter f where
6771
modCompleter :: forall a. (Completer -> Completer) -> f a -> f a
6872

@@ -72,6 +76,7 @@ instance optionFieldsHasCompleter :: HasCompleter OptionFields where
7276
instance argumentFieldsHasCompleter :: HasCompleter ArgumentFields where
7377
modCompleter f = over ArgumentFields \p -> p{ argCompleter = f p.argCompleter }
7478

79+
class HasValue :: forall k. (k -> Type) -> Constraint
7580
class HasValue f where
7681
-- this is just so that it is not necessary to specify the kind of f
7782
hasValueDummy :: forall a. f a -> Unit
@@ -80,6 +85,7 @@ instance optionFieldsHasValue :: HasValue OptionFields where
8085
instance argumentFieldsHasValue :: HasValue ArgumentFields where
8186
hasValueDummy _ = unit
8287

88+
class HasMetavar :: forall k. (k -> Type) -> Constraint
8389
class HasMetavar f where
8490
hasMetavarDummy :: forall a. f a -> Unit
8591
instance optionFieldsHasMetavar :: HasMetavar OptionFields where

src/Options/Applicative/Help/Core.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ parserHelp pprefs p = bodyHelp <<< vsepChunks $
174174
cs :: Array (NonEmptyArray (Tuple (Maybe String) (Chunk Doc)))
175175
cs = Array.groupBy ((==) `on` fst) $ cmdDesc p
176176

177-
group_title arr =
177+
group_title arr =
178178
let {head, tail} = (NEA.uncons arr)
179179
in with_title (fromMaybe def $ fst head) $ vcatChunks ([snd head] <> (snd <$> tail))
180180

src/Options/Applicative/Help/Levenshtein.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ editDistance xs ys = dist' (Array.length xs) (Array.length ys)
3333

3434
dist 0 j = j
3535
dist i 0 = i
36-
dist i j = minimum $
36+
dist i j = minimum $
3737
(dist' (i-1) j + 1) `NonEmpty`
3838
[ dist' i (j-1) + 1
3939
, unsafePartial $ if xs `unsafeIndex` (i - 1) == ys `unsafeIndex` (j - 1)

src/Options/Applicative/Internal.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,4 +288,4 @@ disamb allow_amb xs = do
288288
<<< runNondetT $ xs
289289
pure $ case xs' of
290290
List.Cons x List.Nil -> Just x
291-
_ -> Nothing
291+
_ -> Nothing

src/Options/Applicative/Internal/Utils.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Options.Applicative.Internal.Utils
1+
module Options.Applicative.Internal.Utils
22
( unLines
33
, unWords
44
, lines
@@ -47,4 +47,4 @@ startsWith p s = String.indexOf p s == Just 0
4747
infixl 4 apApplyFlipped as <**>
4848

4949
apApplyFlipped :: forall f b a. Apply f => f a -> f (a -> b) -> f b
50-
apApplyFlipped = lift2 (#)
50+
apApplyFlipped = lift2 (#)

0 commit comments

Comments
 (0)