小编bra*_*rka的帖子

haskell-pointpoint两次捕获一个参数

该代码在Haskell中有效:

x a = (a + 1, a + 2)
x 2 -- returns (3, 4)
Run Code Online (Sandbox Code Playgroud)

而这不是:

x = ((+1), (+2))

<interactive>:935:1: error:
* Couldn't match expected type `Integer -> t'
              with actual type `(Integer -> Integer, Integer -> Integer)'
* The function `x' is applied to one argument,
  but its type `(Integer -> Integer, Integer -> Integer)' has none
  In the expression: x 2
  In an equation for `it': it = x 2
* Relevant bindings include it :: …
Run Code Online (Sandbox Code Playgroud)

haskell generator

1
推荐指数
2
解决办法
38
查看次数

标签 统计

generator ×1

haskell ×1