Various codegen fixes
This commit is contained in:
parent
45578a79b1
commit
22dcbc6a13
7 changed files with 99 additions and 77 deletions
18
sample-programs/loop.crf
Normal file
18
sample-programs/loop.crf
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
main = for 0 1000
|
||||
|
||||
for x n = case n of
|
||||
0 => 0
|
||||
n => for (revRange 1000) (n + minusOne)
|
||||
|
||||
data List (a) where
|
||||
Nil : List (a)
|
||||
Cons : a -> List (a) -> List (a)
|
||||
|
||||
-- create a list of x to 0
|
||||
revRange x = case x of
|
||||
0 => Cons x Nil
|
||||
x => Cons x (revRange (x + minusOne))
|
||||
|
||||
-- represents minus one :)
|
||||
minusOne : Int ;
|
||||
minusOne = 9223372036854775807 + 9223372036854775807 + 1;
|
||||
Loading…
Add table
Add a link
Reference in a new issue