Skip to content

Commit 39e2145

Browse files
committed
Update for PureScript 0.13
1 parent 3e59be0 commit 39e2145

File tree

4 files changed

+28
-27
lines changed

4 files changed

+28
-27
lines changed

bower.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"purescript-generics-rep": "^6.0.0",
2222
"purescript-variant": "^6.0.0",
2323
"purescript-ordered-collections": "^1.0.0",
24-
"purescript-typelevel-prelude": "^4.0.0",
2524
"purescript-type-equality": "^3.0.0"
2625
},
2726
"devDependencies": {

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"test": "pulp test"
77
},
88
"devDependencies": {
9-
"pulp": "^12.0.0",
10-
"purescript": "^0.12.0",
11-
"purescript-psa": "^0.6.0",
9+
"pulp": "^13.0.0",
10+
"purescript": "^0.13.0",
11+
"purescript-psa": "^0.7.3",
1212
"rimraf": "^2.6.2"
1313
}
1414
}

src/Data/Codec/Argonaut/Record.purs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,34 @@ module Data.Codec.Argonaut.Record
66

77
import Data.Codec.Argonaut as CA
88
import Data.Symbol (class IsSymbol, SProxy(..))
9-
import Prim.Row as Row
9+
import Prim.Row as R
10+
import Prim.RowList as RL
1011
import Record as Rec
12+
import Type.Data.RowList (RLProxy(..))
1113
import Type.Equality as TE
12-
import Type.Row as R
1314
import Unsafe.Coerce (unsafeCoerce)
1415

15-
class RowListCodec (rlR.RowList) (ri ∷ # Type) (ro ∷ # Type) | rl ri ro where
16-
rowListCodec R.RLProxy rl Record ri CA.JPropCodec (Record ro)
16+
class RowListCodec (rlRL.RowList) (ri ∷ # Type) (ro ∷ # Type) | rl ri ro where
17+
rowListCodec RLProxy rl Record ri CA.JPropCodec (Record ro)
1718

18-
instance rowListCodecNilRowListCodec R.Nil () () where
19+
instance rowListCodecNilRowListCodec RL.Nil () () where
1920
rowListCodec _ _ = CA.record
2021

2122
instance rowListCodecCons
2223
( RowListCodec rs ri' ro'
23-
, Row.Cons sym (CA.JsonCodec a) ri' ri
24-
, Row.Cons sym a ro' ro
24+
, R.Cons sym (CA.JsonCodec a) ri' ri
25+
, R.Cons sym a ro' ro
2526
, IsSymbol sym
2627
, TE.TypeEquals co (CA.JsonCodec a)
27-
) RowListCodec (R.Cons sym co rs) ri ro where
28+
) RowListCodec (RL.Cons sym co rs) ri ro where
2829
rowListCodec _ codecs =
2930
CA.recordProp (SProxy SProxy sym) codec tail
3031
where
3132
codec CA.JsonCodec a
3233
codec = TE.from (Rec.get (SProxy SProxy sym) codecs)
3334

3435
tail CA.JPropCodec (Record ro')
35-
tail = rowListCodec (R.RLProxy R.RLProxy rs) ((unsafeCoerce Record ri Record ri') codecs)
36+
tail = rowListCodec (RLProxy RLProxy rs) ((unsafeCoerce Record ri Record ri') codecs)
3637

3738
-- | Constructs a record codec from a record of codecs.
3839
-- |
@@ -47,8 +48,8 @@ instance rowListCodecCons ∷
4748

4849
record
4950
ri ro rl
50-
. R.RowToList ri rl
51+
. RL.RowToList ri rl
5152
RowListCodec rl ri ro
5253
Record ri
5354
CA.JPropCodec (Record ro)
54-
record = rowListCodec (R.RLProxy R.RLProxy rl)
55+
record = rowListCodec (RLProxy RLProxy rl)

src/Data/Codec/Argonaut/Variant.purs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ import Data.Tuple (Tuple(..))
1515
import Data.Variant (SProxy, Variant, case_, inj, on)
1616
import Foreign.Object as FO
1717
import Foreign.Object.ST as FOST
18-
import Prim.Row as Row
18+
import Prim.Row as R
19+
import Prim.RowList as RL
1920
import Record as Rec
21+
import Type.Data.RowList (RLProxy(..))
2022
import Type.Equality as TE
21-
import Type.Row as R
2223
import Unsafe.Coerce (unsafeCoerce)
2324

2425
-- | Allows building codecs for variants in combination with variantCase.
@@ -49,7 +50,7 @@ variant = GCodec (ReaderT (Left <<< UnexpectedValue)) (Star case_)
4950
variantCase
5051
l a r r'
5152
. IsSymbol l
52-
Row.Cons l a r r'
53+
R.Cons l a r r'
5354
SProxy l
5455
Either a (JsonCodec a)
5556
JsonCodec (Variant r)
@@ -84,32 +85,32 @@ variantCase proxy eacodec (GCodec dec enc) = GCodec dec' enc'
8485
coerceR Variant r Variant r'
8586
coerceR = unsafeCoerce
8687

87-
class VariantCodec (rlR.RowList) (ri ∷ # Type) (ro ∷ # Type) | rl ri ro where
88-
variantCodec R.RLProxy rl Record ri JsonCodec (Variant ro)
88+
class VariantCodec (rlRL.RowList) (ri ∷ # Type) (ro ∷ # Type) | rl ri ro where
89+
variantCodec RLProxy rl Record ri JsonCodec (Variant ro)
8990

90-
instance variantCodecNilVariantCodec R.Nil () () where
91+
instance variantCodecNilVariantCodec RL.Nil () () where
9192
variantCodec _ _ = variant
9293

9394
instance variantCodecCons
9495
( VariantCodec rs ri' ro'
95-
, Row.Cons sym (Either a (JsonCodec a)) ri' ri
96-
, Row.Cons sym a ro' ro
96+
, R.Cons sym (Either a (JsonCodec a)) ri' ri
97+
, R.Cons sym a ro' ro
9798
, IsSymbol sym
9899
, TE.TypeEquals co (Either a (JsonCodec a))
99-
) VariantCodec (R.Cons sym co rs) ri ro where
100+
) VariantCodec (RL.Cons sym co rs) ri ro where
100101
variantCodec _ codecs =
101102
variantCase (SProxy SProxy sym) codec tail
102103
where
103104
codec Either a (JsonCodec a)
104105
codec = TE.from (Rec.get (SProxy SProxy sym) codecs)
105106

106107
tail JsonCodec (Variant ro')
107-
tail = variantCodec (R.RLProxy R.RLProxy rs) ((unsafeCoerce Record ri Record ri') codecs)
108+
tail = variantCodec (RLProxy RLProxy rs) ((unsafeCoerce Record ri Record ri') codecs)
108109

109110
variantMatch
110111
rl ri ro
111-
. R.RowToList ri rl
112+
. RL.RowToList ri rl
112113
VariantCodec rl ri ro
113114
Record ri
114115
JsonCodec (Variant ro)
115-
variantMatch = variantCodec (R.RLProxy R.RLProxy rl)
116+
variantMatch = variantCodec (RLProxy RLProxy rl)

0 commit comments

Comments
 (0)