less prototype, less bad code implementation of CCHM type theory
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
681 B

  1. module Presyntax.Presyntax where
  2. import Data.Text (Text)
  3. data Plicity
  4. = Im | Ex
  5. deriving (Eq, Show, Ord)
  6. data Expr
  7. = Var Text
  8. | App Plicity Expr Expr
  9. | Pi Plicity Text Expr Expr
  10. | Lam Plicity Text Expr
  11. | Sigma Text Expr Expr
  12. | Pair Expr Expr
  13. | Proj1 Expr
  14. | Proj2 Expr
  15. | Span Expr Posn Posn
  16. deriving (Eq, Show, Ord)
  17. data Statement
  18. = Decl [Text] Expr
  19. | Defn Text Expr
  20. | Builtin Text Text
  21. | ReplNf Expr -- REPL eval
  22. | ReplTy Expr -- REPL :t
  23. | SpanSt Statement Posn Posn
  24. deriving (Eq, Show, Ord)
  25. data Posn
  26. = Posn { posnLine :: {-# UNPACK #-} !Int
  27. , posnColm :: {-# UNPACK #-} !Int
  28. }
  29. deriving (Eq, Show, Ord)