(.module: [library [lux #* ["_" test (#+ Test)] [abstract [monad (#+ do)]] [math ["." random (#+ Random)]]]] [\\library ["." /]]) (def: .public (spec (^open "\.") gen_sample) (All [a] (-> (/.Enum a) (Random a) Test)) (do random.monad [sample gen_sample] (<| (_.for [/.Enum]) ($_ _.and (_.test "Successor and predecessor are inverse functions." (and (\= (|> sample \succ \pred) sample) (\= (|> sample \pred \succ) sample) (not (\= (\succ sample) sample)) (not (\= (\pred sample) sample)))) ))))