2module Build.Source (build) where
4import qualified Data.Map as Map
5import Text.PrettyPrint (Doc)
8import qualified Parse.Parse as Parse
9import qualified Metadata.Prelude as Prelude
10import qualified Transform.Check as Check
11import qualified Type.Inference as TI
12import qualified Transform.Canonicalize as Canonical
14build :: Bool -> Interfaces -> String -> Either [Doc] CanonicalModule
15build noPrelude interfaces source =
16 do let infixes = Map.fromList . map (\(assoc,lvl,op) -> (op,(lvl,assoc)))
17 . concatMap iFixities $ Map.elems interfaces
20 modul <- Prelude.add noPrelude `fmap` Parse.program infixes source
21 case Check.mistakes (body modul) of
25 canonicalModule <- Canonical.module' interfaces validModule
27 types <- TI.infer interfaces canonicalModule
29 return $ canonicalModule { body = (body canonicalModule) { types = types } }
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