问题描述
enforce_default_paths
我正在读String直到结尾。 myFunction :: String -> Either String MyType
用于处理错误。 Left
应该还给我元组。在Right
中,我正在呼叫myFunction
,并检查它是否返回anotherFunction
或Left
,如下所示:
Right
当myFunction :: String -> Either String MyType
myFunction "" = Right -- want to return MyType here
myFunction s =
case anotherFunction s of
Left c -> Left c
Right (v1,v2,t) -> -- want to call myFunction again with t
返回anotherFunction
时,我想递归地再次调用Right
,而又不丢失myFunction
和v1
。如何通过递归实现?
这是MyType的确切定义:
v2
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)