この関数を書くのに助けが得られるかどうか疑問に思います。リスト内の各「ペア」を反転する関数を作成しようとしています。
module Invert where
invert :: [(a,b)] -> [(b,a)]
invert [(a,b)] = [(b,a)]
私が入るときinvert [(3,1) (4,1) (5,1)]
...それは私に与えることになってい[(1,3) (1,4) (1,5)
ます...しかしそれは私に与えます...
*Invert> [(3,1) (4,1) (5,1)]
<interactive>:2:2:
The function `(3, 1)' is applied to two arguments,
but its type `(t0, t1)' has none
In the expression: (3, 1) (4, 1) (5, 1)
In the expression: [(3, 1) (4, 1) (5, 1)]
In an equation for `it': it = [(3, 1) (4, 1) (5, 1)]