aboutsummaryrefslogtreecommitdiffhomepage
path: root/samples/rosetta/prime_decomposition.bruijn
blob: 0287889e7081d1c01f358dfd990a6eb0eef698bb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
:import std/Combinator .
:import std/List .
:import std/Math .

factors \divs primes
	divs y [[&[[&[[3 ⋅ 3 >? 4 case-1 (=?0 case-2 case-3)]] (quot-rem 2 1)]]]]
		case-1 4 >? (+1) {}4 empty
		case-2 3 : (5 1 (3 : 2))
		case-3 5 4 2

main [factors <$> ({ (+42) → (+50) })]