summaryrefslogtreecommitdiff
path: root/app/Main.hs
blob: 4c0014eb80c786e1b1f59379c6dbe311679ec5db (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
29
30
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)
        ,("One", Nothing :| TSet TIZero)
        ,("Unit", Nothing :| TOne)
        ,("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