git.haldean.org ubik / b7fbdbc
fix iv-example, type checker should have caught this Haldean Brown 3 years ago
2 changed file(s) with 4 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
1818 inner-lambda.uk \
1919 inner-recursive.uk \
2020 is-prime.uk \
21 iv-example.uk \
2122 lambda.uk \
2223 lambda-simple.uk \
2324 list.uk \
44 ^ IV = Good = Bad
55
66 ^ Bag
7 # first number is # of overall IVs, second is number of good ones
78 = BagC Number Number
89
910 # accessors for members, to give them names
4748
4849 # the probability that you would get i good IVs when drawing from the tree.
4950 : prob ^ Tree -> Number -> Number
50 = \tree i -> {
51 : c = children tree
51 = \t i -> {
52 : c = children t
5253 : nc = length c
5354 ! (? c {
5455 . Nil => ? { . eq i 0 => 1 . => 0 }