代码
rayTraceP (p2 (0, 0)) (r2 (1, 0)) (circle 1)导致错误消息
Could not deduce: V a0 ~ V2
from the context: (Traced a, TrailLike a, Transformable a,
V a ~ V2)
bound by the inferred type for ‘it’:
forall a.
(Traced a, TrailLike a, Transformable a, V a ~ V2) =>
Maybe (Point (V a) (N a))
at <interactive>:1:1-44
The type variable ‘a0’ is ambiguous我不明白为什么会这样。在manual中,rayTraceP的用法似乎与此类似。我使用图-cairo-1.4.1。
发布于 2019-07-29 06:54:27
这类错误通常是由类型推断过程中不明确的类型引起的,可以通过添加一个或多个类型签名来修复。在这种情况下,我认为问题最有可能是它不能确定“circle 1”调用应该具有什么类型。如果你展示了所有的代码,我可以给出一些关于在哪里添加类型签名的更好的建议。
有关更多信息,请参阅用户手册的第5.5节:https://diagrams.github.io/doc/manual.html#tips-and-tricks
https://stackoverflow.com/questions/57245232
复制相似问题