Add a more elegant while implementation.

This commit is contained in:
Danila Fedorin 2020-10-26 19:16:17 -07:00
parent b2e7ccfeda
commit e567872503

View File

@ -32,7 +32,7 @@ program =
]
while :: Expr -> Prog -> Stmt
while cond body = Loop $ If cond [] [ Break ] : body
while cond body = Loop [ If cond body [ Break ] ]
sumFromTo :: Int -> Int -> Prog
sumFromTo f t =