blob: a07a19870632835c671b305322540deac7f3632f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
(.module:
[library
[lux #*
["_" test (#+ Test)]
[abstract
[monad (#+ do)]]
[data
[collection
["." list]]]
[math
["." random]
[number
["n" nat]]]]]
[\\library
["." / (#+ Fold)]])
(def: #export test
Test
(do random.monad
[samples (random.list 10 random.nat)]
(<| (_.covering /._)
($_ _.and
(_.cover [/.with_monoid]
(n.= (\ list.fold fold (\ n.addition compose) (\ n.addition identity) samples)
(/.with_monoid n.addition list.fold samples)))
))))
|