首页 > 解决方案 > 组合任一类型变量

问题描述

我在 Haskell 中有一个函数,它的返回类型是Either error b,并且有“ function x = Right b1”和“function (x:xs) b = 我想得到类似的东西Right [list of b's]。我真的不知道如何解释,我是 Haskell 的新手。我试过了:function (x:xs) = function x <$> function xs并且 function (x:xs) b = function x b <*> function xs b,但我得到类型不匹配错误。我唯一想要的是得到 not [Right b1, Right b2, ...]but, Right [b1, b2, b3].

标签: haskell

解决方案



推荐阅读