From 89c4d303485306666310b8692eece844fc76cd4f Mon Sep 17 00:00:00 2001 From: JordanMartinez Date: Mon, 14 Mar 2022 11:30:48 -0700 Subject: [PATCH] Update to v0.15.0 (#72) * Update to CI to use 'unstable' purescript * Update pulp to 16.0.0-0 and psa to 0.8.2 * Update Bower dependencies to master * Replaced polymorphic proxies with monomorphic `Proxy` * Added changelog entry --- .github/workflows/ci.yml | 2 ++ CHANGELOG.md | 2 ++ bower.json | 4 ++-- package.json | 4 ++-- src/Type/Data/Boolean.purs | 20 +++++++------------- src/Type/Data/Ordering.purs | 16 +++++----------- src/Type/Data/Symbol.purs | 10 +++++----- src/Type/Prelude.purs | 10 +++++----- src/Type/Row.purs | 2 -- src/Type/RowList.purs | 2 -- 10 files changed, 30 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43d2897..b6ebf3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,8 @@ jobs: - uses: actions/checkout@v2 - uses: purescript-contrib/setup-purescript@main + with: + purescript: "unstable" - uses: actions/setup-node@v1 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index f8c85de..917daeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ Notable changes to this project are documented in this file. The format is based ## [Unreleased] Breaking changes: +- Update project and deps to PureScript v0.15.0 (#72 by @JordanMartinez) +- Replaced polymorphic proxies with monomorphic `Proxy` (#72 by @JordanMartinez) New features: diff --git a/bower.json b/bower.json index 2ef2de0..a8d1290 100644 --- a/bower.json +++ b/bower.json @@ -16,7 +16,7 @@ "package.json" ], "dependencies": { - "purescript-prelude": "^5.0.0", - "purescript-type-equality": "^4.0.0" + "purescript-prelude": "master", + "purescript-type-equality": "master" } } diff --git a/package.json b/package.json index 79ea445..3e28704 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "build": "pulp build -- --censor-lib --strict" }, "devDependencies": { - "pulp": "^15.0.0", - "purescript-psa": "^0.8.0", + "pulp": "16.0.0-0", + "purescript-psa": "^0.8.2", "rimraf": "^3.0.2" } } diff --git a/src/Type/Data/Boolean.purs b/src/Type/Data/Boolean.purs index 065cd33..b56d8a2 100644 --- a/src/Type/Data/Boolean.purs +++ b/src/Type/Data/Boolean.purs @@ -1,6 +1,5 @@ module Type.Data.Boolean - ( BProxy(..) - , module Prim.Boolean + ( module Prim.Boolean , class IsBoolean , reflectBoolean , reifyBoolean @@ -17,21 +16,16 @@ module Type.Data.Boolean import Prim.Boolean (True, False) import Type.Proxy (Proxy(..)) --- | Value proxy for `Boolean` types --- | **Deprecated:** Use `Type.Proxy` instead -data BProxy :: Boolean -> Type -data BProxy bool = BProxy - -- | Class for reflecting a type level `Boolean` at the value level class IsBoolean :: Boolean -> Constraint class IsBoolean bool where - reflectBoolean :: forall proxy. proxy bool -> Boolean + reflectBoolean :: Proxy bool -> Boolean instance isBooleanTrue :: IsBoolean True where reflectBoolean _ = true instance isBooleanFalse :: IsBoolean False where reflectBoolean _ = false -- | Use a value level `Boolean` as a type-level `Boolean` -reifyBoolean :: forall r. Boolean -> (forall proxy o. IsBoolean o => proxy o -> r) -> r +reifyBoolean :: forall r. Boolean -> (forall o. IsBoolean o => Proxy o -> r) -> r reifyBoolean true f = f (Proxy :: Proxy True) reifyBoolean false f = f (Proxy :: Proxy False) @@ -41,7 +35,7 @@ class And lhs rhs out | lhs rhs -> out instance andTrue :: And True rhs rhs instance andFalse :: And False rhs False -and :: forall proxy l r o. And l r o => proxy l -> proxy r -> Proxy o +and :: forall l r o. And l r o => Proxy l -> Proxy r -> Proxy o and _ _ = Proxy -- | Or two `Boolean` types together @@ -50,7 +44,7 @@ class Or lhs rhs output | lhs rhs -> output instance orTrue :: Or True rhs True instance orFalse :: Or False rhs rhs -or :: forall proxy l r o. Or l r o => proxy l -> proxy r -> Proxy o +or :: forall l r o. Or l r o => Proxy l -> Proxy r -> Proxy o or _ _ = Proxy -- | Not a `Boolean` @@ -59,7 +53,7 @@ class Not bool output | bool -> output instance notTrue :: Not True False instance notFalse :: Not False True -not :: forall proxy i o. Not i o => proxy i -> Proxy o +not :: forall i o. Not i o => Proxy i -> Proxy o not _ = Proxy -- | If - dispatch based on a boolean @@ -68,5 +62,5 @@ class If bool onTrue onFalse output | bool onTrue onFalse -> output instance ifTrue :: If True onTrue onFalse onTrue instance ifFalse :: If False onTrue onFalse onFalse -if_ :: forall proxy b t e o. If b t e o => proxy b -> Proxy t -> Proxy e -> Proxy o +if_ :: forall b t e o. If b t e o => Proxy b -> Proxy t -> Proxy e -> Proxy o if_ _ _ _ = Proxy diff --git a/src/Type/Data/Ordering.purs b/src/Type/Data/Ordering.purs index f09c853..5dd15cb 100644 --- a/src/Type/Data/Ordering.purs +++ b/src/Type/Data/Ordering.purs @@ -1,6 +1,5 @@ module Type.Data.Ordering ( module PO - , OProxy(..) , class IsOrdering , reflectOrdering , reifyOrdering @@ -17,22 +16,17 @@ import Data.Ordering (Ordering(..)) import Type.Data.Boolean (True, False) import Type.Proxy (Proxy(..)) --- | Value proxy for `Ordering` types --- | **Deprecated:** Use `Type.Proxy` instead -data OProxy :: PO.Ordering -> Type -data OProxy ordering = OProxy - -- | Class for reflecting a type level `Ordering` at the value level class IsOrdering :: PO.Ordering -> Constraint class IsOrdering ordering where - reflectOrdering :: forall proxy. proxy ordering -> Ordering + reflectOrdering :: Proxy ordering -> Ordering instance isOrderingLT :: IsOrdering PO.LT where reflectOrdering _ = LT instance isOrderingEQ :: IsOrdering PO.EQ where reflectOrdering _ = EQ instance isOrderingGT :: IsOrdering PO.GT where reflectOrdering _ = GT -- | Use a value level `Ordering` as a type-level `Ordering` -reifyOrdering :: forall r. Ordering -> (forall proxy o. IsOrdering o => proxy o -> r) -> r +reifyOrdering :: forall r. Ordering -> (forall o. IsOrdering o => Proxy o -> r) -> r reifyOrdering LT f = f (Proxy :: Proxy PO.LT) reifyOrdering EQ f = f (Proxy :: Proxy PO.EQ) reifyOrdering GT f = f (Proxy :: Proxy PO.GT) @@ -45,7 +39,7 @@ instance appendOrderingLT :: Append PO.LT rhs PO.LT instance appendOrderingEQ :: Append PO.EQ rhs rhs instance appendOrderingGT :: Append PO.GT rhs PO.GT -append :: forall proxy l r o. Append l r o => proxy l -> proxy r -> Proxy o +append :: forall l r o. Append l r o => Proxy l -> Proxy r -> Proxy o append _ _ = Proxy -- | Invert an `Ordering` @@ -55,7 +49,7 @@ instance invertOrderingLT :: Invert PO.LT PO.GT instance invertOrderingEQ :: Invert PO.EQ PO.EQ instance invertOrderingGT :: Invert PO.GT PO.LT -invert :: forall proxy i o. Invert i o => proxy i -> Proxy o +invert :: forall i o. Invert i o => Proxy i -> Proxy o invert _ = Proxy class Equals :: PO.Ordering -> PO.Ordering -> Boolean -> Constraint @@ -71,5 +65,5 @@ instance equalsLTGT :: Equals PO.LT PO.GT False instance equalsGTLT :: Equals PO.GT PO.LT False instance equalsGTEQ :: Equals PO.GT PO.EQ False -equals :: forall proxy l r o. Equals l r o => proxy l -> proxy r -> Proxy o +equals :: forall l r o. Equals l r o => Proxy l -> Proxy r -> Proxy o equals _ _ = Proxy diff --git a/src/Type/Data/Symbol.purs b/src/Type/Data/Symbol.purs index 8ff8564..535ae49 100644 --- a/src/Type/Data/Symbol.purs +++ b/src/Type/Data/Symbol.purs @@ -9,18 +9,18 @@ module Type.Data.Symbol ) where import Prim.Symbol (class Append, class Compare, class Cons) -import Data.Symbol (SProxy(..), class IsSymbol, reflectSymbol, reifySymbol) +import Data.Symbol (class IsSymbol, reflectSymbol, reifySymbol) import Type.Data.Ordering (EQ) import Type.Data.Ordering (class Equals) as Ordering import Type.Proxy (Proxy(..)) -compare :: forall proxy l r o. Compare l r o => proxy l -> proxy r -> Proxy o +compare :: forall l r o. Compare l r o => Proxy l -> Proxy r -> Proxy o compare _ _ = Proxy -append :: forall proxy l r o. Append l r o => proxy l -> proxy r -> Proxy o +append :: forall l r o. Append l r o => Proxy l -> Proxy r -> Proxy o append _ _ = Proxy -uncons :: forall proxy h t s. Cons h t s => proxy s -> {head :: Proxy h, tail :: Proxy t} +uncons :: forall h t s. Cons h t s => Proxy s -> {head :: Proxy h, tail :: Proxy t} uncons _ = {head : Proxy, tail : Proxy} class Equals :: Symbol -> Symbol -> Boolean -> Constraint @@ -31,5 +31,5 @@ instance equalsSymbol Ordering.Equals EQ ord out) => Equals lhs rhs out -equals :: forall proxy l r o. Equals l r o => proxy l -> proxy r -> Proxy o +equals :: forall l r o. Equals l r o => Proxy l -> Proxy r -> Proxy o equals _ _ = Proxy diff --git a/src/Type/Prelude.purs b/src/Type/Prelude.purs index eb09cae..f67d0a2 100644 --- a/src/Type/Prelude.purs +++ b/src/Type/Prelude.purs @@ -8,10 +8,10 @@ module Type.Prelude , module Type.RowList ) where -import Type.Data.Boolean (True, False, BProxy(..), class IsBoolean, reflectBoolean, reifyBoolean) -import Type.Data.Ordering (Ordering, LT, EQ, GT, OProxy(..), class IsOrdering, reflectOrdering, reifyOrdering) +import Type.Data.Boolean (True, False, class IsBoolean, reflectBoolean, reifyBoolean) +import Type.Data.Ordering (Ordering, LT, EQ, GT, class IsOrdering, reflectOrdering, reifyOrdering) import Type.Proxy (Proxy(..)) -import Type.Data.Symbol (SProxy(..), class IsSymbol, reflectSymbol, reifySymbol, class Compare, compare, class Append, append) +import Type.Data.Symbol (class IsSymbol, reflectSymbol, reifySymbol, class Compare, compare, class Append, append) import Type.Equality (class TypeEquals, from, to) -import Type.Row (class Union, class Lacks, RProxy(..)) -import Type.RowList (class RowToList, class ListToRow, RLProxy(..)) +import Type.Row (class Union, class Lacks) +import Type.RowList (class RowToList, class ListToRow) diff --git a/src/Type/Row.purs b/src/Type/Row.purs index fb628ae..101cb9d 100644 --- a/src/Type/Row.purs +++ b/src/Type/Row.purs @@ -1,12 +1,10 @@ module Type.Row ( module Prim.Row - , module RProxy , RowApply , type (+) ) where import Prim.Row (class Lacks, class Nub, class Cons, class Union) -import Type.Data.Row (RProxy(..)) as RProxy -- | Type application for rows. type RowApply :: forall k. (Row k -> Row k) -> Row k -> Row k diff --git a/src/Type/RowList.purs b/src/Type/RowList.purs index 163cb1b..5a55542 100644 --- a/src/Type/RowList.purs +++ b/src/Type/RowList.purs @@ -1,6 +1,5 @@ module Type.RowList ( module Prim.RowList - , module RLProxy , class ListToRow , class RowListRemove , class RowListSet @@ -13,7 +12,6 @@ import Prim.RowList (RowList, Cons, Nil, class RowToList) import Type.Equality (class TypeEquals) import Type.Data.Symbol as Symbol import Type.Data.Boolean as Boolean -import Type.Data.RowList (RLProxy(..)) as RLProxy -- | Convert a RowList to a row of types. -- | The inverse of this operation is `RowToList`.