use string for module names

This commit is contained in:
2026-02-13 10:18:28 -08:00
parent 4ec199b064
commit 24048eadf1
12 changed files with 58 additions and 60 deletions

View File

@@ -100,9 +100,9 @@ checkAlreadyDef fc nm = do
Just entry => error fc "\{show nm} is already defined at \{show entry.fc}"
processDecl : List String -> Decl -> M Unit
processDecl : String -> Decl -> M Unit
processTypeSig : List String FC List Name Raw M Unit
processTypeSig : String FC List Name Raw M Unit
processTypeSig ns fc names tm = do
log 1 $ \ _ => "-----"
top <- getTop
@@ -112,7 +112,7 @@ processTypeSig ns fc names tm = do
ignore $ for names $ \nm => setDef (QN ns nm) fc ty Axiom Nil
processPrimType : List Name FC Name Maybe Raw M Unit
processPrimType : String FC Name Maybe Raw M Unit
processPrimType ns fc nm ty = do
top <- getTop
ty' <- check (mkCtx fc) (maybe (RU fc) id ty) (VU fc)
@@ -120,7 +120,7 @@ processPrimType ns fc nm ty = do
setDef (QN ns nm) fc ty' (PrimTCon arity) Nil
processPrimFn : List String FC String List String Raw String M Unit
processPrimFn : String FC String List String Raw String M Unit
processPrimFn ns fc nm used ty src = do
top <- getTop
ty <- check (mkCtx fc) ty (VU fc)
@@ -153,7 +153,7 @@ complexity (Lit _ _) = 0
complexity (Case _ sc (CaseCons _ _ t :: Nil)) = 1 + complexity sc + complexity t
complexity _ = 100
processDef : List String FC String List (Raw × Maybe Raw) M Unit
processDef : String FC String List (Raw × Maybe Raw) M Unit
processDef ns fc nm clauses = do
log 1 $ \ _ => "-----"
log 1 $ \ _ => "Def \{show nm}"
@@ -194,7 +194,7 @@ processDef ns fc nm clauses = do
then setFlag (QN ns nm) fc Inline
else pure MkUnit
processCheck : List String FC Raw Raw M Unit
processCheck : String FC Raw Raw M Unit
processCheck ns fc tm ty = do
log 1 $ \ _ => "----- DCheck"
top <- getTop
@@ -209,7 +209,7 @@ processCheck ns fc tm ty = do
putStrLn " NF \{render 90 $ pprint Nil norm}"
processClass : List String FC (FC × String) Telescope List Decl M Unit
processClass : String FC (FC × String) Telescope List Decl M Unit
processClass ns classFC (nameFC, nm) tele decls = do
-- REVIEW maybe we can leverage Record for this
-- a couple of catches, we don't want the dotted accessors and
@@ -257,7 +257,7 @@ processClass ns classFC (nameFC, nm) tele decls = do
mkApp : Raw BindInfo × Raw Raw
mkApp acc (BI fc nm icit _, _) = RApp fc acc (RVar fc nm) icit
processInstance : List String FC Raw Maybe (List Decl) M Unit
processInstance : String FC Raw Maybe (List Decl) M Unit
processInstance ns instfc ty decls = do
log 1 $ \ _ => "-----"
log 1 $ \ _ => "Instance \{render 90 $ pretty ty}"
@@ -372,7 +372,7 @@ processInstance ns instfc ty decls = do
apply x (y :: xs) = error instfc "expected pi type \{show x}"
-- desugars to Data and processes it
processShortData : List String → FC → Raw → List Raw → M Unit
processShortData : String → FC → Raw → List Raw → M Unit
processShortData ns fc lhs sigs = do
(nameFC, nm,args) <- getArgs lhs Nil
let ty = foldr mkPi (RU fc) args
@@ -431,7 +431,7 @@ populateConInfo entries =
isSucc (MkEntry fc nm dty@(Pi _ _ _ _ (Ref _ a) (Ref _ b)) (DCon _ _ (Many :: Nil) hn) _) = a == b
isSucc _ = False
processData : List String FC FC × String Raw List Decl M Unit
processData : String FC FC × String Raw List Decl M Unit
processData ns fc (nameFC, nm) ty cons = do
log 1 $ \ _ => "-----"
log 1 $ \ _ => "Data \{nm}"
@@ -487,7 +487,7 @@ processData ns fc (nameFC, nm) ty cons = do
checkDeclType _ = error fc "data type doesn't return U"
processRecord : List String FC FC × String Telescope Maybe (FC × Name) List Decl M Unit
processRecord : String FC FC × String Telescope Maybe (FC × Name) List Decl M Unit
processRecord ns recordFC (nameFC, nm) tele cname decls = do
log 1 $ \ _ => "-----"
log 1 $ \ _ => "Record"