summaryrefslogtreecommitdiff
path: root/app/Main.hs
blob: f8b586a61deec57139bea6e17f178b530ec8a55c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module Main where

import qualified Data.Map.Strict as Map
import System.Exit (die)

import AST
import Parser
import TypeCheck


main :: IO ()
main = do
  source <- getContents

  uprog <- case parseProgram "<stdin>" source of
    Left err -> die (show err)
    Right term -> return term

  let env0 = Map.fromList
        [("Level", Nothing :| TLevelUniv)
        ,("lzero", Nothing :| TLevel)
        ,("lsuc", Nothing :| TPi "x" TLevel TLevel)]

  env <- case checkProgram env0 uprog of
    Left err -> die err
    Right env -> return env

  print env