Skip to content

Commit 9ce8e17

Browse files
Update to v0.14.0-rc3 (#90)
* Update packages.dhall to prepare-0.14 bootstrap * Update CI to use v0.14.0-rc3 PS release * Use Proxy; add Type kind to Row and RowList
1 parent 00e4616 commit 9ce8e17

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515

1616
- name: Set up a PureScript toolchain
1717
uses: purescript-contrib/setup-purescript@main
18+
with:
19+
purescript: "0.14.0-rc3"
1820

1921
- name: Cache PureScript dependencies
2022
uses: actions/cache@v2

packages.dhall

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
let upstream =
2-
https://github.com/purescript/package-sets/releases/download/psc-0.13.8-20200831/packages.dhall sha256:cdb3529cac2cd8dd780f07c80fd907d5faceae7decfcaa11a12037df68812c83
2+
https://raw.githubusercontent.com/purescript/package-sets/prepare-0.14/src/packages.dhall
33

44
in upstream

src/Data/Argonaut/Decode/Class.purs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ import Data.Maybe (Maybe(..))
1515
import Data.NonEmpty (NonEmpty)
1616
import Data.Set as S
1717
import Data.String (CodePoint)
18-
import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
18+
import Data.Symbol (class IsSymbol, reflectSymbol)
1919
import Data.Tuple (Tuple)
2020
import Foreign.Object as FO
2121
import Prelude (class Ord, Unit, Void, bind, ($), (<<<))
2222
import Prim.Row as Row
2323
import Prim.RowList as RL
2424
import Record as Record
25-
import Type.Data.RowList (RLProxy(..))
25+
import Type.Proxy (Proxy(..))
2626

2727
class DecodeJson a where
2828
decodeJson :: Json -> Either JsonDecodeError a
@@ -97,11 +97,11 @@ instance decodeRecord
9797
=> DecodeJson (Record row) where
9898
decodeJson json =
9999
case toObject json of
100-
Just object -> gDecodeJson object (RLProxy :: RLProxy list)
100+
Just object -> gDecodeJson object (Proxy :: Proxy list)
101101
Nothing -> Left $ TypeMismatch "Object"
102102

103-
class GDecodeJson (row :: # Type) (list :: RL.RowList) | list -> row where
104-
gDecodeJson :: FO.Object Json -> RLProxy list -> Either JsonDecodeError (Record row)
103+
class GDecodeJson (row :: Row Type) (list :: RL.RowList Type) | list -> row where
104+
gDecodeJson :: forall proxy. FO.Object Json -> proxy list -> Either JsonDecodeError (Record row)
105105

106106
instance gDecodeJsonNil :: GDecodeJson () RL.Nil where
107107
gDecodeJson _ _ = Right {}
@@ -115,14 +115,14 @@ instance gDecodeJsonCons
115115
)
116116
=> GDecodeJson row (RL.Cons field value tail) where
117117
gDecodeJson object _ = do
118-
let
119-
_field = SProxy :: SProxy field
118+
let
119+
_field = Proxy :: Proxy field
120120
fieldName = reflectSymbol _field
121121

122122
case FO.lookup fieldName object of
123123
Just jsonVal -> do
124124
val <- lmap (AtKey fieldName) <<< decodeJson $ jsonVal
125-
rest <- gDecodeJson object (RLProxy :: RLProxy tail)
125+
rest <- gDecodeJson object (Proxy :: Proxy tail)
126126
Right $ Record.insert _field val rest
127127

128128
Nothing ->

src/Data/Argonaut/Encode/Class.purs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ import Data.Maybe (Maybe)
1313
import Data.NonEmpty (NonEmpty)
1414
import Data.Set as S
1515
import Data.String (CodePoint)
16-
import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
16+
import Data.Symbol (class IsSymbol, reflectSymbol)
1717
import Data.Tuple (Tuple)
1818
import Foreign.Object as FO
1919
import Prelude (class Ord, Unit, Void, identity, ($))
2020
import Prim.Row as Row
2121
import Prim.RowList as RL
2222
import Record as Record
23-
import Type.Data.RowList (RLProxy(..))
23+
import Type.Proxy (Proxy(..))
2424

2525
class EncodeJson a where
2626
encodeJson :: a -> Json
@@ -96,10 +96,10 @@ instance encodeRecord
9696
, RL.RowToList row list
9797
)
9898
=> EncodeJson (Record row) where
99-
encodeJson rec = fromObject $ gEncodeJson rec (RLProxy :: RLProxy list)
99+
encodeJson rec = fromObject $ gEncodeJson rec (Proxy :: Proxy list)
100100

101-
class GEncodeJson (row :: # Type) (list :: RL.RowList) where
102-
gEncodeJson :: Record row -> RLProxy list -> FO.Object Json
101+
class GEncodeJson (row :: Row Type) (list :: RL.RowList Type) where
102+
gEncodeJson :: forall proxy. Record row -> proxy list -> FO.Object Json
103103

104104
instance gEncodeJsonNil :: GEncodeJson row RL.Nil where
105105
gEncodeJson _ _ = FO.empty
@@ -112,8 +112,8 @@ instance gEncodeJsonCons
112112
)
113113
=> GEncodeJson row (RL.Cons field value tail) where
114114
gEncodeJson row _ = do
115-
let _field = SProxy :: SProxy field
115+
let _field = Proxy :: Proxy field
116116
FO.insert
117117
(reflectSymbol _field)
118118
(encodeJson $ Record.get _field row)
119-
(gEncodeJson row (RLProxy :: RLProxy tail))
119+
(gEncodeJson row (Proxy :: Proxy tail))

0 commit comments

Comments
 (0)