Skip to content

Commit 93753b6

Browse files
committed
Fix ValueBasedJsonCodecLog
1 parent d13e6a9 commit 93753b6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

recipes/ValueBasedJsonCodecLog/src/Main.purs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Data.Codec.Argonaut (JsonCodec, JsonDecodeError(..), printJsonDecodeError
1010
import Data.Codec.Argonaut as CA
1111
import Data.Codec.Argonaut.Common as CAM
1212
import Data.Codec.Argonaut.Record as CAR
13-
import Data.Either (Either(..), either, fromRight)
13+
import Data.Either (Either(..), either)
1414
import Data.Int as Int
1515
import Data.Maybe (Maybe(..))
1616
import Data.Profunctor (dimap)
@@ -46,9 +46,8 @@ main = do
4646
log $ "Encoding the example value:"
4747
log $ stringify $ encode entireRecordCodec exampleValue
4848

49-
5049
exampleJson :: Json
51-
exampleJson = unsafePartial $ fromRight $ jsonParser
50+
exampleJson = unsafePartial $ (\(Right json) -> json) $ jsonParser
5251
"""
5352
{
5453
"string":"string value",
@@ -83,7 +82,7 @@ exampleJson = unsafePartial $ fromRight $ jsonParser
8382
"key3": "stuff"
8483
}
8584
}
86-
"""
85+
"""
8786

8887
type EntireRecord =
8988
{ string :: String

0 commit comments

Comments
 (0)