tricu

An interpreted language for exploring Tree Calculus
Log | Files | Refs | README | LICENSE

sourceEliminationProbe.tri (704B)


      1 -- Manual canonical probe (use a fresh --store with --io --unsafe-io):
      2 -- compiling unchanged test/size.tri through the portable frontend prints 301.
      3 !import "prelude" !Local
      4 !import "parser" !Local
      5 !import "io" !Local
      6 !import "source.unit" !Local
      7 fileExternals =
      8   [(pair "map" map)
      9    (pair "append" append)
     10    (pair "equal?" equal?)
     11    (pair "head" head)
     12    (pair "y" y)
     13    (pair "triage" triage)]
     14 main = io (onResult_ (readFile "test/size.tri")
     15   (problem : putStrLn "read-failed")
     16   (source : lazyResult
     17     (problem rest : putStrLn (append "diagnostic=" (showNumber (parserDiagnosticCode problem))))
     18     (tree rest : putStrLn (showNumber tree))
     19     (compileGateProgram fileExternals source)))
     20 main