Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在阅读“功能依赖的乐趣”
据说这部分是静态计算的,即在编译时执行
data Nat = Zero | Succ Nat three = Succ(Succ(Succ Zero))) even Zero = True even (Succ n) = odd n odd Zero = False odd (Succ n) = even n (odd three)
但我不太明白静态计算的内容。而且我也没有发现编译器要计算以检查类型的任何异常情况
该代码中的任何内容都不是静态计算的。请注意,您发布的代码来自“动态计算”部分,而不是“静态计算”部分。