Fix prelude
This commit is contained in:
parent
3729278041
commit
e42c775135
1 changed files with 44 additions and 44 deletions
36
src/Main.hs
36
src/Main.hs
|
|
@ -18,27 +18,18 @@ import LambdaLifter (lambdaLift)
|
||||||
import Monomorphizer.Monomorphizer (monomorphize)
|
import Monomorphizer.Monomorphizer (monomorphize)
|
||||||
import Renamer.Renamer (rename)
|
import Renamer.Renamer (rename)
|
||||||
import ReportForall (reportForall)
|
import ReportForall (reportForall)
|
||||||
import System.Console.GetOpt (
|
import System.Console.GetOpt (ArgDescr (NoArg, ReqArg),
|
||||||
ArgDescr (NoArg, ReqArg),
|
|
||||||
ArgOrder (RequireOrder),
|
ArgOrder (RequireOrder),
|
||||||
OptDescr (Option),
|
OptDescr (Option), getOpt,
|
||||||
getOpt,
|
usageInfo)
|
||||||
usageInfo,
|
import System.Directory (createDirectory, doesPathExist,
|
||||||
)
|
|
||||||
import System.Directory (
|
|
||||||
createDirectory,
|
|
||||||
doesPathExist,
|
|
||||||
getDirectoryContents,
|
getDirectoryContents,
|
||||||
removeDirectoryRecursive,
|
removeDirectoryRecursive,
|
||||||
setCurrentDirectory,
|
setCurrentDirectory)
|
||||||
)
|
|
||||||
import System.Environment (getArgs)
|
import System.Environment (getArgs)
|
||||||
import System.Exit (
|
import System.Exit (ExitCode (ExitFailure),
|
||||||
ExitCode (ExitFailure),
|
exitFailure, exitSuccess,
|
||||||
exitFailure,
|
exitWith)
|
||||||
exitSuccess,
|
|
||||||
exitWith,
|
|
||||||
)
|
|
||||||
import System.IO (stderr)
|
import System.IO (stderr)
|
||||||
import System.Process (spawnCommand, waitForProcess)
|
import System.Process (spawnCommand, waitForProcess)
|
||||||
import TypeChecker.TypeChecker (TypeChecker (Bi, Hm), typecheck)
|
import TypeChecker.TypeChecker (TypeChecker (Bi, Hm), typecheck)
|
||||||
|
|
@ -166,4 +157,13 @@ printToErr = hPutStrLn stderr
|
||||||
fromErr :: Err a -> IO a
|
fromErr :: Err a -> IO a
|
||||||
fromErr = either (\s -> printToErr s >> exitFailure) pure
|
fromErr = either (\s -> printToErr s >> exitFailure) pure
|
||||||
|
|
||||||
prelude = "\n\nconst x y = x\n\ndata Bool () where\n True : Bool ()\n False : Bool ()\n\nlt : Int -> Int -> Bool ()\nlt = \\x. \\y. const True (x + y)"
|
prelude :: String
|
||||||
|
prelude = unlines
|
||||||
|
[ "\n"
|
||||||
|
, "const : a -> b -> a"
|
||||||
|
, "data Bool () where"
|
||||||
|
, " False : Bool ()"
|
||||||
|
, " True : Bool ()"
|
||||||
|
, "lt : Int -> Int -> Bool ()"
|
||||||
|
, "lt x y = const True (x + y)"
|
||||||
|
]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue