4module Language.PureScript.Sugar (desugar, module S) where
8import Control.Category ((>>>))
10import Control.Monad.Error.Class (MonadError())
11import Control.Monad.Supply.Class
12import Control.Monad.Writer.Class (MonadWriter())
14import Language.PureScript.AST
15import Language.PureScript.Errors
16import Language.PureScript.Externs
17import Language.PureScript.Sugar.BindingGroups as S
18import Language.PureScript.Sugar.CaseDeclarations as S
19import Language.PureScript.Sugar.DoNotation as S
20import Language.PureScript.Sugar.Names as S
21import Language.PureScript.Sugar.ObjectWildcards as S
22import Language.PureScript.Sugar.Operators as S
23import Language.PureScript.Sugar.TypeClasses as S
24import Language.PureScript.Sugar.TypeClasses.Deriving as S
25import Language.PureScript.Sugar.TypeDeclarations as S
28-- The desugaring pipeline proceeds as follows:
30-- * Remove signed literals in favour of `negate` applications
32-- * Desugar object literals with wildcards into lambdas
34-- * Desugar operator sections
36-- * Desugar do-notation using the @Prelude.Monad@ type class
38-- * Desugar top-level case declarations into explicit case expressions
40-- * Desugar type declarations into value declarations with explicit type annotations
42-- * Qualify any unqualified names and types
44-- * Rebracket user-defined binary operators
46-- * Introduce type synonyms for type class dictionaries
48-- * Group mutually recursive value and data declarations into binding groups.
50desugar :: (MonadSupply m, MonadError MultipleErrors m, MonadWriter MultipleErrors m) => [ExternsFile] -> [Module] -> m [Module]
52 map removeSignedLiterals
53 >>> traverse desugarObjectConstructors
54 >=> traverse desugarDoModule
55 >=> desugarCasesModule
56 >=> desugarTypeDeclarationsModule
57 >=> desugarImports externs
59 >=> traverse deriveInstances
60 >=> desugarTypeClasses externs
61 >=> createBindingGroupsModule
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