simple-json-utils

Some utils for Simple-JSON. Nothing but a bunch of functions made for my own usage.


License
MIT
Install
psc-package install simple-json-utils

Documentation

Purescript-Simple-Json-Utils

Build Status

Some utils for Simple-JSON. Nothing but a bunch of functions made for my own usage.

Printing MultipleErrors

from tests

readPrintError :: forall a. ReadForeign a => String -> Proxy a -> Maybe String
readPrintError json _ = do
  case readJSON json of
    Right (_ :: a) -> Nothing
    Left e -> Just $ printMultipleErrors e
TypeMismatch: expected: String, actual: Boolean
ErrorAtIndex 0:
  TypeMismatch: expected: String, actual: Boolean
ErrorAtProperty "a":
  TypeMismatch: expected: String, actual: Boolean
ErrorAtProperty "a":
  ErrorAtProperty "b":
    ErrorAtProperty "c":
      TypeMismatch: expected: String, actual: Boolean