小编Xia*_*Liu的帖子

如何手动推断'(.)的类型.(.).(.)"?

在Edward Kmett的演讲中,Lenses,Folds和Traversals,在幻灯片"The Power is the Dot"中,他展示的(.) . (.) . (.)

(a -> b) -> (c -> d -> e -> a) -> c -> d -> e -> b

我可以通过在GHCI中显示它的类型来看到它.但我也想知道原因.我想了解的另一件事是为什么有在从参数中经常换着花样(.)(.) . (.)(.) . (.) . (.):

(.)             :: (a -> b) -> (c ->           a) -> c ->           b
(.) . (.)       :: (a -> b) -> (c -> d ->      a) -> c -> d ->      b
(.) . …
Run Code Online (Sandbox Code Playgroud)

haskell types type-inference combinators function-composition

6
推荐指数
2
解决办法
215
查看次数