Skip to content

Commit

Permalink
Update to v0.15.0 (#72)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
JordanMartinez authored Mar 14, 2022
1 parent 83ddcdb commit 89c4d30
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 42 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
- uses: actions/checkout@v2

- uses: purescript-contrib/setup-purescript@main
with:
purescript: "unstable"

- uses: actions/setup-node@v1
with:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
20 changes: 7 additions & 13 deletions src/Type/Data/Boolean.purs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module Type.Data.Boolean
( BProxy(..)
, module Prim.Boolean
( module Prim.Boolean
, class IsBoolean
, reflectBoolean
, reifyBoolean
Expand All @@ -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)

Expand All @@ -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
Expand All @@ -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`
Expand All @@ -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
Expand All @@ -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
16 changes: 5 additions & 11 deletions src/Type/Data/Ordering.purs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module Type.Data.Ordering
( module PO
, OProxy(..)
, class IsOrdering
, reflectOrdering
, reifyOrdering
Expand All @@ -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)
Expand All @@ -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`
Expand All @@ -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
Expand All @@ -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
10 changes: 5 additions & 5 deletions src/Type/Data/Symbol.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
10 changes: 5 additions & 5 deletions src/Type/Prelude.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 0 additions & 2 deletions src/Type/Row.purs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/Type/RowList.purs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module Type.RowList
( module Prim.RowList
, module RLProxy
, class ListToRow
, class RowListRemove
, class RowListSet
Expand All @@ -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`.
Expand Down

0 comments on commit 89c4d30

Please sign in to comment.