SortedMap uses any comparator

This commit is contained in:
2025-09-01 15:39:35 -07:00
parent 27d9250d34
commit 1432316fac
13 changed files with 139 additions and 123 deletions

View File

@@ -385,7 +385,7 @@ process : QName → M (List Doc)
process name = do
let wat = QN ("Prelude" :: Nil) "arrayToList"
top <- getTop
entries <- getEntries EmptyMap name
entries <- getEntries emptyMap name
-- Maybe move this dance into liftWhere
ref <- newIORef entries
@@ -397,7 +397,7 @@ process name = do
entries <- readIORef ref
-- Now working with defs
exprs <- mapM defToCExp $ toList entries
let cexpMap = foldMap const EmptyMap exprs
let cexpMap = foldMap const emptyMap exprs
cexpMap <- tailCallOpt cexpMap
let names = sortedNames cexpMap name
pure $ map cexpToDoc $ mapMaybe (\x => lookupMap x cexpMap) names

View File

@@ -50,7 +50,7 @@ perror fn ((MkBounded val (MkBounds line col _ _)) :: _) msg = E (MkFC fn (line,
parse : a. String -> Parser a -> TokenList -> Either Error a
parse fn pa toks = case runP pa toks False EmptyMap (MkFC fn (-1,-1)) of
parse fn pa toks = case runP pa toks False emptyMap (MkFC fn (-1,-1)) of
Fail fatal err toks com ops => Left err
OK a Nil _ _ => Right a
OK a ts _ _ => Left (perror fn ts "Extra toks")

View File

@@ -42,9 +42,9 @@ instance Show TopContext where
-- TODO need to get class dependencies working
emptyTop : io. {{Monad io}} {{HasIO io}} -> io TopContext
emptyTop = do
let mcctx = MC EmptyMap Nil 0 CheckAll
let mcctx = MC emptyMap Nil 0 CheckAll
errs <- newIORef $ the (List Error) Nil
pure $ MkTop EmptyMap Nil EmptyMap Nil EmptyMap mcctx 0 errs EmptyMap
pure $ MkTop emptyMap Nil emptyMap Nil emptyMap mcctx 0 errs emptyMap
setFlag : QName FC EFlag M Unit

View File

@@ -391,7 +391,7 @@ record ModContext where
-- A placeholder while walking through dependencies of a module
emptyModCtx : String ModContext
emptyModCtx csum = MkModCtx csum EmptyMap (MC EmptyMap Nil 0 NoCheck) EmptyMap
emptyModCtx csum = MkModCtx csum emptyMap (MC emptyMap Nil 0 NoCheck) emptyMap
HintTable : U
HintTable = SortedMap QName (List (QName × Tm))