In Frege I want to convert an String to an Int, but need to handle unparsable strings too.
So I guess I'm looking for something like a readMaybe function. Where do I find this? Or how can I use Java's parseInt and catch the exception in Frege?
In Frege I want to convert an String to an Int, but need to handle unparsable strings too.
So I guess I'm looking for something like a readMaybe function. Where do I find this? Or how can I use Java's parseInt and catch the exception in Frege?
Copyright © 2021 Jogjafile Inc.
In Frege, it's as simple as:
which returns an
Either.(Found this in the Frege Translation of "Learn You a Haskell for Great Good!.")