diff options
Diffstat (limited to 'stdlib/source/lux/tool/compiler/phase/analysis/structure.lux')
-rw-r--r-- | stdlib/source/lux/tool/compiler/phase/analysis/structure.lux | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/stdlib/source/lux/tool/compiler/phase/analysis/structure.lux b/stdlib/source/lux/tool/compiler/phase/analysis/structure.lux index 6991c67f7..3fb066259 100644 --- a/stdlib/source/lux/tool/compiler/phase/analysis/structure.lux +++ b/stdlib/source/lux/tool/compiler/phase/analysis/structure.lux @@ -6,15 +6,16 @@ ["." state]] [data ["." name] - ["." number] ["." product] ["." maybe] ["." error] + [number + ["." nat]] [text format] [collection ["." list ("#/." functor)] - ["dict" dictionary (#+ Dictionary)]]] + ["." dictionary (#+ Dictionary)]]] ["." type ["." check]] ["." macro @@ -311,23 +312,23 @@ (wrap []) (///.throw record-size-mismatch [size-ts size-record recordT record])) #let [tuple-range (list.indices size-ts) - tag->idx (dict.from-list name.hash (list.zip2 tag-set tuple-range))] + tag->idx (dictionary.from-list name.hash (list.zip2 tag-set tuple-range))] idx->val (monad.fold @ (function (_ [key val] idx->val) (do @ [key (extension.lift (macro.normalize key))] - (case (dict.get key tag->idx) + (case (dictionary.get key tag->idx) (#.Some idx) - (if (dict.contains? idx idx->val) + (if (dictionary.contains? idx idx->val) (///.throw cannot-repeat-tag [key record]) - (wrap (dict.put idx val idx->val))) + (wrap (dictionary.put idx val idx->val))) #.None (///.throw tag-does-not-belong-to-record [key recordT])))) (: (Dictionary Nat Code) - (dict.new number.hash)) + (dictionary.new nat.hash)) record) - #let [ordered-tuple (list/map (function (_ idx) (maybe.assume (dict.get idx idx->val))) + #let [ordered-tuple (list/map (function (_ idx) (maybe.assume (dictionary.get idx idx->val))) tuple-range)]] (wrap [ordered-tuple recordT])) )) |