我习惯于使用a <> b
wherea
和b
take 参数。
> const ["a"] <> const ["b"] $ True
["a","b"]
为什么也没有a <|> b
?
> const ["a"] <|> const ["b"] $ True
<interactive>:64:13:
No instance for (Alternative ((->) Bool))
arising from a use of ‘<|>’
In the expression: const ["a"] <|> const ["b"]
In the expression: const ["a"] <|> const ["b"] $ True
In an equation for ‘it’: it = const ["a"] <|> const ["b"] $ True