Skip to content

API question about ForeignError #37

@ssadler

Description

@ssadler

Currently ForeignError is quite limiting in what kinds of error a read operation can produce, that is, it covers type errors, but it only covers a parse error (say when parsing a String) IF it's parsing JSON.

In my case, I have a Type field which is parsed from a simple Haskell style string "Concrete -> Concrete". If the parse fails for any reason there isn't a ForeignError that covers this case, as it's not a type error but a syntax error. JSON gets special treatment in this case, but perhaps the JSONError should be generalized to cover other cases?

It seems like TypeMismatch isn't going to be useful in terms of implementing new Foreign instances because all the primitive types are already covered by the Foreign library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions