1module Transform.AddDefaultImports (add, defaultImports) where
3import qualified AST.Module as Module
4import qualified AST.Variable as Var
7-- DESCRIPTION OF DEFAULT IMPORTS
9(==>) :: a -> b -> (a,b)
13defaultImports :: [(Module.Name, Module.ImportMethod)]
15 [ ["Basics"] ==> Module.ImportMethod Nothing Var.openListing
16 , ["List"] ==> exposing [Var.Value "::"]
17 , ["Maybe"] ==> exposing [Var.Union "Maybe" Var.openListing]
18 , ["Result"] ==> exposing [Var.Union "Result" Var.openListing]
19 , ["Signal"] ==> exposing [Var.Union "Signal" Var.closedListing]
23exposing :: [Var.Value] -> Module.ImportMethod
25 Module.ImportMethod Nothing (Var.listing vars)
28-- ADDING DEFAULT IMPORTS TO A MODULE
30add :: Bool -> Module.Module exs body -> Module.Module exs body
31add needsDefaults (Module.Module moduleName path exports imports decls) =
32 Module.Module moduleName path exports ammendedImports decls
36 then defaultImports ++ imports
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