Skip to content

Commit c1f12c8

Browse files
committed
Remove unsafePartial
1 parent 4848fb1 commit c1f12c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

recipes/ValueBasedJsonCodecLog/src/Main.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Data.String (splitAt)
1818
import Data.TraversableWithIndex (forWithIndex)
1919
import Effect (Effect)
2020
import Effect.Console (log, logShow)
21-
import Partial.Unsafe (unsafeCrashWith, unsafePartial)
21+
import Partial.Unsafe (unsafeCrashWith)
2222

2323
main :: Effect Unit
2424
main = do
@@ -47,7 +47,7 @@ main = do
4747
log $ stringify $ encode entireRecordCodec exampleValue
4848

4949
exampleJson :: Json
50-
exampleJson = unsafePartial $ (fromRight' \_ -> unsafeCrashWith "got Left: bad parser") $ jsonParser
50+
exampleJson = fromRight' (\_ -> unsafeCrashWith "got Left: bad parser") $ jsonParser
5151
"""
5252
{
5353
"string":"string value",

0 commit comments

Comments
 (0)