递归使用

问题描述

所以我在下面定义了这样一个函数

enforce_default_paths

我正在读String直到结尾。 myFunction :: String -> Either String MyType 用于处理错误Left应该还给我元组。在Right中,我正在呼叫myFunction,并检查它是否返回anotherFunctionLeft,如下所示:

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,而又不丢失myFunctionv1。如何通过递归实现?

这是MyType的确切定义:

v2

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)