1{-# OPTIONS_GHC -Wall #-}
2{-# LANGUAGE OverloadedStrings #-}
3module Elm.Compiler.Objects.Internal
15import Control.Arrow (first)
17import qualified Data.Map as Map
19import qualified AST.Expression.Optimized as Opt
20import qualified AST.Module.Name as ModuleName
21import qualified AST.Module as Module
22import qualified AST.Variable as Var
23import qualified Elm.Package as Pkg
31 Graph (Map.Map Var.Global Opt.Decl)
38fromModule :: Module.Optimized -> Graph
39fromModule (Module.Module home info) =
40 Graph $ Map.fromList $
41 map (first (Var.Global home)) (Module.program info)
44union :: Graph -> Graph -> Graph
45union (Graph objs1) (Graph objs2) =
46 Graph (Map.union objs1 objs2)
49unions :: [Graph] -> Graph
51 Graph (Map.unions (map destruct graphs))
54destruct :: Graph -> Map.Map Var.Global Opt.Decl
55destruct (Graph graph) =
64 = Main ModuleName.Canonical
67root :: Pkg.Name -> ModuleName.Raw -> Roots
69 Main (ModuleName.Canonical pkg name)
72toGlobals :: Roots -> [Var.Global]
76 [ Var.Global home "main" ]
83instance Binary Graph where
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list