mis*_*tor 9 haskell exception-handling either
有一些stdlib函数会在无效输入上抛出错误.例如:
Prelude> read "1o2" :: Int *** Exception: Prelude.read: no parse
我想把它包起来Either e a代替.我怎样才能做到这一点?
Either e a
Dan*_*ner 14
没有勺子.你没有听到我的消息.
但是,对于这个特定的例子,你应该使用reads.
reads
归档时间:
13 年,3 月 前
查看次数:
190 次
最近记录: