Update TypeMismatch for multiple possible types.#41
Update TypeMismatch for multiple possible types.#41bsermons wants to merge 2 commits intopurescript:masterfrom
Conversation
| show (JSONError s) = "JSON error: " <> s | ||
| show (TypeMismatch exps act) = "Type mismatch: expected " <> to_s exps <> ", found " <> act | ||
| where | ||
| to_s [] = "???" |
There was a problem hiding this comment.
I think we need to use a non-empty array, for this reason.
There was a problem hiding this comment.
I agree, but just to say, purescript-nonempty is in contrib currently and this is core.
|
Thanks! |
|
An alternative here is to move the non-empty array to the outer level: type F = Either (NonEmpty ForeignError)We probably don't want a dependency on any non core library for |
|
I can see the value of adding What are the requirements for a package to be in core vs contrib? |
|
The |
|
Yea I just did the easy thing first since I wasn't sure if I'll continue ahead with it if you don't think it'll be a problem and see how far I can get with the suggestion above with moving the dependency to the outer level. |
|
Played around with using The last commit on each is with Some notes: |
Per comment in paf31/purescript-foreign-generic#11