]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.runtime/scl/SetUtils.scl
00fa752157498ec7b5bf5656902fe96866d16352
[simantics/platform.git] / bundles / org.simantics.scl.runtime / scl / SetUtils.scl
1 import "Prelude"
2 import "Set" as Set
3 import "MSet" as MSet
4 import "MList" as MList
5
6 fromList :: [a] -> Set.T a
7 fromList l = runProc (MSet.freeze $ MSet.fromList l)
8
9 toList :: Set.T a -> [a]
10 toList s = runProc do
11     result = MList.createC (Set.size s)
12     Set.iter (MList.add result) s
13     MList.freeze result