first pass at where clauses

This commit is contained in:
2024-11-19 22:40:52 -08:00
parent c665310653
commit 1a9d44434c
5 changed files with 68 additions and 17 deletions

View File

@@ -366,10 +366,11 @@ parseDef = do
pats <- many patAtom
keyword "="
body <- typeExpr
wfc <- getPos
w <- optional $ do
keyword "where"
startBlock $ manySame $ (parseSig <|> parseDef)
let body = maybe body (\ decls => RWhere wfc decls body) w
-- these get collected later
pure $ Def fc nm [(t, body)] -- [MkClause fc [] t body]