xyncro / chiron

JSON for F#
https://xyncro.tech/chiron
MIT License
175 stars 41 forks source link

`Json.tryParse` throws away parse error #33

Closed haf closed 9 years ago

haf commented 9 years ago

Wouldn't it be a good idea to type it all in Choice<,> instead of Option<>? That way your can pass errors on outside the Json monad.

kolektiv commented 9 years ago

Both tryParse and tryDeserialize could sanely return Choice rather than Option, I agree. At this point, the only reason I hadn't was sticking to what seems to be an F# convention around try* functions returning options, but I think this is a case where it's perfectly reasonable to ignore that convention in favour of a more useful outcome. I'll change this when I get home later on.

kolektiv commented 9 years ago

So, Chiron 3.0.0 is out! And tryParse and tryDeserialize now return Choice<,> rather than Option<>. Hopefully a useful change!

haf commented 9 years ago

Very nice ;)