@@ -15,14 +15,14 @@ import Data.Maybe (Maybe(..))
1515import Data.NonEmpty (NonEmpty )
1616import Data.Set as S
1717import Data.String (CodePoint )
18- import Data.Symbol (class IsSymbol , SProxy (..), reflectSymbol )
18+ import Data.Symbol (class IsSymbol , reflectSymbol )
1919import Data.Tuple (Tuple )
2020import Foreign.Object as FO
2121import Prelude (class Ord , Unit , Void , bind , ($), (<<<))
2222import Prim.Row as Row
2323import Prim.RowList as RL
2424import Record as Record
25- import Type.Data.RowList ( RLProxy (..))
25+ import Type.Proxy ( Proxy (..))
2626
2727class 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
106106instance 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 ->
0 commit comments