on master help sign in
Expose Elm.Compiler.Objects.unions
9fd8302Evan Czaplicki
src/Elm/Compiler/Objects.hs+1
@@ -2,6 +2,7 @@
2module Elm.Compiler.Objects
2module Elm.Compiler.Objects
3 ( Graph
3 ( Graph
4 , union
4 , union
5+ , unions
5 , Roots
6 , Roots
6 , main
7 , main
7 )
8 )
src/Elm/Compiler/Objects/Internal.hs+11
@@ -4,6 +4,7 @@ module Elm.Compiler.Objects.Internal
4 ( Graph(..)
4 ( Graph(..)
5 , fromModule
5 , fromModule
6 , union
6 , union
7+ , unions
7 , Roots
8 , Roots
8 , main
9 , main
9 , toGlobals
10 , toGlobals
@@ -45,6 +46,16 @@ union (Graph objs1) (Graph objs2) =
45 Graph (Map.union objs1 objs2)
46 Graph (Map.union objs1 objs2)
46
47
47
48
49+unions :: [Graph] -> Graph
50+unions graphs =
51+ Graph (Map.unions (map destruct graphs))
52+
53+
54+destruct :: Graph -> Map.Map Var.Global Opt.Decl
55+destruct (Graph graph) =
56+ graph
57+
58+
48
59
49-- ROOTS
60-- ROOTS
50
61