diff --git a/Cargo.lock b/Cargo.lock index 10b41205..56b497ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -464,7 +464,7 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "rock" -version = "0.2.1-develop" +version = "0.2.1-autoprelude" dependencies = [ "bincode", "bitflags", diff --git a/src/lib/testcases/mods/full_fact/eq.rk b/src/lib/testcases/mods/full_fact/eq.rk deleted file mode 100644 index 097cd64f..00000000 --- a/src/lib/testcases/mods/full_fact/eq.rk +++ /dev/null @@ -1,33 +0,0 @@ -infix == 3 -infix <= 3 -infix >= 3 -infix < 3 -infix > 3 - -trait Eq a - == :: a -> a -> Bool - <= :: a -> a -> Bool - >= :: a -> a -> Bool - < :: a -> a -> Bool - > :: a -> a -> Bool - -impl Eq Int64 - == e f = ~IEq e f - <= e f = ~Ile e f - >= e f = ~Ige e f - < e f = ~Ilt e f - > e f = ~Igt e f - -impl Eq Float64 - == g h = ~FEq g h - <= g h = ~Fle g h - >= g h = ~Fge g h - < g h = ~Flt g h - > g h = ~Fgt g h - -impl Eq Bool - == i j = ~BEq i j - <= i j = ~BEq i j - >= i j = ~BEq i j - < i j = ~BEq i j - > i j = ~BEq i j diff --git a/src/lib/testcases/mods/full_fact/helpers.rk b/src/lib/testcases/mods/full_fact/helpers.rk deleted file mode 100644 index 909d57dc..00000000 --- a/src/lib/testcases/mods/full_fact/helpers.rk +++ /dev/null @@ -1,7 +0,0 @@ -infix >> 2 -infix << 2 -infix |> 1 - ->> x y = y -<< x y = x -|> k l = l k diff --git a/src/lib/testcases/mods/full_fact/lib.rk b/src/lib/testcases/mods/full_fact/lib.rk deleted file mode 100644 index 301f9c36..00000000 --- a/src/lib/testcases/mods/full_fact/lib.rk +++ /dev/null @@ -1,7 +0,0 @@ -mod num -mod eq -mod show -mod print -# mod helpers - -mod prelude diff --git a/src/lib/testcases/mods/full_fact/main.rk b/src/lib/testcases/mods/full_fact/main.rk index 481a0b29..75f9076c 100644 --- a/src/lib/testcases/mods/full_fact/main.rk +++ b/src/lib/testcases/mods/full_fact/main.rk @@ -1,6 +1,6 @@ -mod lib +mod std -use lib::prelude::(*) +use std::prelude::(*) fact a = if a <= 1 diff --git a/src/lib/testcases/mods/full_fact/num.rk b/src/lib/testcases/mods/full_fact/num.rk deleted file mode 100644 index 56e3a12c..00000000 --- a/src/lib/testcases/mods/full_fact/num.rk +++ /dev/null @@ -1,22 +0,0 @@ -infix + 4 -infix - 4 -infix * 5 -infix / 5 - -trait Num a - + :: a -> a -> a - - :: a -> a -> a - * :: a -> a -> a - / :: a -> a -> a - -impl Num Int64 - + a b = ~IAdd a b - - a b = ~ISub a b - * a b = ~IMul a b - / a b = ~IDiv a b - -impl Num Float64 - + c d = ~FAdd c d - - c d = ~FSub c d - * c d = ~FMul c d - / c d = ~FDiv c d diff --git a/src/lib/testcases/mods/full_fact/prelude.rk b/src/lib/testcases/mods/full_fact/prelude.rk deleted file mode 100644 index 4370815b..00000000 --- a/src/lib/testcases/mods/full_fact/prelude.rk +++ /dev/null @@ -1,5 +0,0 @@ -use super::print::print -use super::show::show -use super::num::(*) -use super::eq::(*) -# use super::helpers::(*) diff --git a/src/lib/testcases/mods/full_fact/print.rk b/src/lib/testcases/mods/full_fact/print.rk deleted file mode 100644 index dd26a27a..00000000 --- a/src/lib/testcases/mods/full_fact/print.rk +++ /dev/null @@ -1,25 +0,0 @@ -extern printf :: String -> Float64 -> Int64 -extern puts :: String -> Int64 - -use super::show::itoa - -trait Print a - print :: a -> Int64 - -impl Print Int64 - print a = puts itoa a - -impl Print Float64 - print c = - let s = printf "%f", c - puts "" - s - -impl Print String - print s = puts s - -impl Print Bool - print b = - if b - then puts "true" - else puts "false" diff --git a/src/lib/testcases/mods/full_fact/show.rk b/src/lib/testcases/mods/full_fact/show.rk deleted file mode 100644 index 04967978..00000000 --- a/src/lib/testcases/mods/full_fact/show.rk +++ /dev/null @@ -1,35 +0,0 @@ -extern malloc :: Int64 -> String -extern strlen :: String -> Int64 -extern strcpy :: String -> String -> Int64 -extern sprintf :: String -> String -> Int64 -> Int64 -extern fcvt :: Float64 -> Int64 -> String -> String -> String - - -trait Show a - show :: a -> String - -impl Show Int64 - show a = itoa a - -impl Show Float64 - show c = ftoa c - -impl Show Bool - show c = - if c - then "true" - else "false" - -impl Show String - show c = - let s = malloc strlen c - strcpy s, c - s - -itoa a = - let s = malloc 10 - sprintf s, "%d", a - s - -ftoa c = - fcvt c, 10, (malloc 4), (malloc 4)