unification seems to work for kovacs examples

This commit is contained in:
2024-07-13 09:32:49 -07:00
parent b37fa56c70
commit 76fae34bcf
11 changed files with 219 additions and 136 deletions

View File

@@ -14,6 +14,7 @@ import Lib.Token
import Lib.Parser.Impl
import Syntax
import Data.List
import Data.Maybe
-- There is the whole core vs surface thing here.
-- might be best to do core first/ Technically don't
@@ -186,10 +187,11 @@ ibind : Parser (List (String, Icit, Raw))
ibind = do
sym "{"
names <- some ident
sym ":"
ty <- typeExpr
ty <- optional (sym ":" >> typeExpr)
pos <- getPos
sym "}"
pure $ map (\name => (name, Explicit, ty)) names
-- getPos is a hack here, I would like to position at the name...
pure $ map (\name => (name, Implicit, fromMaybe (RSrcPos pos RHole) ty)) names
-- Collect a bunch of binders (A : U) {y : A} -> ...
binders : Parser Raw