mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-29 22:51:51 +03:00
a972778eab
They don't all pass yet, for minor reasons. Coming shortly... Unfortunately the startup overhead for chez is really noticeable here!
10 lines
312 B
Idris
10 lines
312 B
Idris
range : Integer -> Integer -> List Integer
|
|
range bottom top
|
|
= if bottom > top then []
|
|
else bottom :: range (bottom + 1) top
|
|
|
|
pythag : Integer -> List (Integer, Integer, Integer)
|
|
pythag top
|
|
= [(x, y, z) | z <- range 1 top, y <- range 1 z, x <- range 1 y,
|
|
x * x + y * y == z * z]
|