Questions tagged «miranda»

7
滥用代数数据类型的代数-为什么这样做有效?
对于具有数学背景的人来说,代数数据类型的“代数”表达式非常有启发性。让我尝试解释一下我的意思。 定义了基本类型 产品 • 联盟 + 辛格尔顿 X 单元 1 并使用简写X²的X•X和2X对X+X等等,我们就可以定义,例如链表代数表达式 data List a = Nil | Cons a (List a) ↔ L = 1 + X • L 和二叉树: data Tree a = Nil | Branch a (Tree a) (Tree a) ↔ T = 1 + X • T² …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.