GHC警告我在顶层没有功能签名.我不明白为什么我会需要它们.提供它们的问题是它们非常复杂,就像这个(自动生成):
applyValue :: forall t t1 t2 t3 t4.
(t2 -> t)
-> (t2 -> t3 -> t4 -> t1) -> t2 -> t3 -> t4 -> (t -> Bool) -> [t1]
Run Code Online (Sandbox Code Playgroud)
那么我为什么还要加入呢?
功能本身:
applyValue getValueAt stitchAndMove at fabric mark matchAt =
if matchAt (getValueAt at)
then [stitchAndMove at fabric mark]
else []
Run Code Online (Sandbox Code Playgroud)
Dan*_*ner 23
(node -> Bool) -> (edge -> Bool) -> (graph -> Bool)可以比(t1 -> Bool) -> (t2 -> Bool) -> (t3 -> Bool)它们更具可读性,即使它们是等价的.