(.module: [lux #* data/text/format ["r" math/random (#+ Random)] ["_" test (#+ Test)] [abstract/monad (#+ do)] [abstract [equivalence (#+)] [functor (#+)]] [data ["." bit ("#@." equivalence)] [number ["." nat]] [collection ["." list]]]] {1 ["." /]}) (def: #export test Test (<| (_.context (%name (name-of /._))) (do r.monad [x r.nat y r.nat] ($_ _.and (_.test "Can automatically select first-order structures." (let [(^open "list@.") (list.equivalence nat.equivalence)] (and (bit@= (:: nat.equivalence = x y) (/.::: = x y)) (list@= (list.n/range 1 10) (/.::: map inc (list.n/range 0 9))) ))) (_.test "Can automatically select second-order structures." (/.::: = (list.n/range 1 10) (list.n/range 1 10))) (_.test "Can automatically select third-order structures." (let [lln (/.::: map (list.n/range 1) (list.n/range 1 10))] (/.::: = lln lln))) ))))