Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit c23d3a7

Browse files
committed
Add some more instances for EJson
1 parent 23a33fb commit c23d3a7

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

bower.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"purescript-bifunctors": "^2.0.0",
2121
"purescript-fixed-points": "^2.0.0",
2222
"purescript-maps": "^2.0.0",
23+
"purescript-matryoshka": "^0.1.0",
24+
"purescript-newtype": "^1.2.0",
2325
"purescript-parsing": "^3.0.0",
2426
"purescript-precise": "^1.0.0",
2527
"purescript-strongcheck": "^2.0.0"

src/Data/Json/Extended.purs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,27 @@ import Data.HugeNum as HN
4141
import Data.Json.Extended.Signature as Sig
4242
import Data.Map as Map
4343
import Data.Maybe as M
44+
import Data.Newtype as N
4445
import Data.Ord1 (compare1)
4546
import Data.StrMap as SM
4647
import Data.Tuple as T
48+
49+
import Matryoshka (class Corecursive, class Recursive, embed, project)
50+
4751
import Test.StrongCheck.Arbitrary as SC
4852
import Test.StrongCheck.Gen as Gen
4953
import Text.Parsing.Parser as P
5054

5155
newtype EJson = EJson (Mu.Mu Sig.EJsonF)
5256

57+
derive instance newtypeEJson :: N.Newtype EJson _
58+
59+
instance recursiveEJsonRecursive EJson Sig.EJsonF where
60+
project = N.traverse EJson project
61+
62+
instance corecursiveEJsonCorecursive EJson Sig.EJsonF where
63+
embed = N.collect EJson embed
64+
5365
getEJson
5466
EJson
5567
Mu.Mu Sig.EJsonF

0 commit comments

Comments
 (0)