private def infiniteLoop: Nat := Id.run do
let mut n: Nat := 0
while true do
n := n + 1
n
private def infiniteLoop: Nat := Id.run do
let mut n: Nat := 0
while true do
n := n + 1
n
I stole and ported this "diagonals" function for today's puzzle. It might be interesting to prove some properties about it, e.g. that the elements of `join (diagonals grid)` are the same (ignoring order) as the elements of `join grid`.
I stole and ported this "diagonals" function for today's puzzle. It might be interesting to prove some properties about it, e.g. that the elements of `join (diagonals grid)` are the same (ignoring order) as the elements of `join grid`.
[ShapeCircle (Circle 3.0), ShapeSquare (Square 4.0)]
[ShapeCircle (Circle 3.0), ShapeSquare (Square 4.0)]
data Circle = Circle { radius :: Double }
data Square = Square { side :: Double }
data Shape where
CircleShape :: Circle -> Shape
SquareShape :: Square -> Shape
filterCircles :: [Shape] -> [Circle]
data Circle = Circle { radius :: Double }
data Square = Square { side :: Double }
data Shape where
CircleShape :: Circle -> Shape
SquareShape :: Square -> Shape
filterCircles :: [Shape] -> [Circle]