AP
Size: a a a
AP
AP
AP
case readMaybe ... of
Nothing -> fail "foo" -- это ожидаемая ошибка парсинга, а не runtime error
Just x -> pure xAP
AP
> data Failure = Failure deriving Show
> data Boom = Boom deriving Show
>
> instance FromJSON Failure where parseJSON _ = fail "Oops!"
> instance FromJSON Boom where parseJSON _ = error "Boom!"
>
> eitherDecode @Failure "42"
Left "Error in $: Oops!"
>
> eitherDecode @Boom "42"
*** Exception: Boom!
CallStack (from HasCallStack):
error, called at <interactive>:17:44 in interactive:Ghci8AP
E
E
E
E
JS
AP
A

[
A
A
AP
AP
AP