Yur
This commit is contained in:
parent
dac675a417
commit
0fd8a9bc74
3 changed files with 5 additions and 28 deletions
|
|
@ -57,7 +57,6 @@ executable language
|
||||||
Compiler
|
Compiler
|
||||||
Renamer.Renamer
|
Renamer.Renamer
|
||||||
ReportForall
|
ReportForall
|
||||||
TreeConverter
|
|
||||||
Desugar.Desugar
|
Desugar.Desugar
|
||||||
|
|
||||||
hs-source-dirs: src
|
hs-source-dirs: src
|
||||||
|
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
module TreeConverter where
|
|
||||||
|
|
||||||
--import qualified Grammar.Abs as G
|
|
||||||
--import qualified TypeChecker.TypeCheckerIr as T
|
|
||||||
--
|
|
||||||
--convertToTypecheckerIR :: G.Program -> Either String T.Program
|
|
||||||
--convertToTypecheckerIR (G.Program defs) = T.Program (map convertDef defs)
|
|
||||||
--
|
|
||||||
--convertDef :: G.Bind -> T.Bind
|
|
||||||
--convertDef (G.Bind name t _ args exp) = T.Bind (name, t) (map (\i -> (i, T.TMono "Int"))) (convertExp exp)
|
|
||||||
--
|
|
||||||
--
|
|
||||||
|
|
||||||
|
|
@ -1,15 +1,6 @@
|
||||||
data Two where
|
main = sigma 0 10
|
||||||
This : Two
|
|
||||||
That : Two
|
|
||||||
|
|
||||||
main = reval (eval This)
|
sigma : Int -> Int -> Int
|
||||||
|
sigma from to = case from == to of
|
||||||
eval x = case x of
|
True => from
|
||||||
That => That
|
False => to + sigma from (to - 1)
|
||||||
This => eval That
|
|
||||||
|
|
||||||
reval x = case x of
|
|
||||||
This => 123
|
|
||||||
That => 123
|
|
||||||
|
|
||||||
-- test comment
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue