diff options
author | Csaba Hruska <csaba.hruska@gmail.com> | 2017-05-29 14:45:15 +0100 |
---|---|---|
committer | Csaba Hruska <csaba.hruska@gmail.com> | 2017-05-29 14:45:15 +0100 |
commit | 07bd8babb6b9991884ac2d1ca50436ce861b06c8 (patch) | |
tree | 25d82d91da2eb179a4ec9af15fa0801659360e54 /refactor.plan | |
parent | 1ab76c3545afab07cceee04bcfbec51d3c170e56 (diff) |
plan
Diffstat (limited to 'refactor.plan')
-rw-r--r-- | refactor.plan | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/refactor.plan b/refactor.plan new file mode 100644 index 00000000..25b6fbfc --- /dev/null +++ b/refactor.plan | |||
@@ -0,0 +1,68 @@ | |||
1 | goals: | ||
2 | simple, clean API and dependency tree | ||
3 | |||
4 | stage 1: | ||
5 | ok - LambdaCube.Compiler.Utils | ||
6 | import LambdaCube.Compiler.Pretty | ||
7 | import LambdaCube.Compiler.DeBruijn | ||
8 | |||
9 | typesig - import LambdaCube.Compiler.Lexer | ||
10 | typesig - import LambdaCube.Compiler.DesugaredSource | ||
11 | typesig - import LambdaCube.Compiler.Patterns | ||
12 | typesig - import LambdaCube.Compiler.Statements | ||
13 | import LambdaCube.Compiler.Parser | ||
14 | |||
15 | stage 2: | ||
16 | import LambdaCube.Compiler.Core | ||
17 | import LambdaCube.Compiler.Infer | ||
18 | import LambdaCube.Compiler.InferMonad | ||
19 | |||
20 | stage 3: | ||
21 | import LambdaCube.Compiler.CoreToIR | ||
22 | |||
23 | IDEA: | ||
24 | add each module a Pattern module with the pattern synonyms that provides the rich API | ||
25 | |||
26 | problem: | ||
27 | low level use of debruijn indices | ||
28 | too many and indiscpilined pattern synonyms | ||
29 | |||
30 | |||
31 | type classes: | ||
32 | Debruijn: Rearrange, HasFreeVars, DeBruijnify | ||
33 | Pretty: PShow | ||
34 | Patterns: PatVars | ||
35 | DesugaredSource: SourceInfo, SetSourceInfo | ||
36 | |||
37 | Core: HasFName, Subst, MkDoc, NType | ||
38 | |||
39 | data types: | ||
40 | Lexer: ParseEnv, Namespace | ||
41 | Parser: LCParseError, ParseWarning, DesugarInfo | ||
42 | Pretty: Fixity, Doc, DocAtom | ||
43 | Patterns: ParseCheck, Pat_ c, ParPat_ c, Lets a, GuardTree | ||
44 | DesugaredSource: FileInfo, Range, SI, SIName, FNameTag, Lit, SExp' a, Binder, Visibility, Stmt, Module_ a, Export, ImportItems, Extension | ||
45 | Utils: Void | ||
46 | Statements: PreStmt, StmtNode | ||
47 | |||
48 | Infer: CEnv, Env | ||
49 | InferMonad: ErrorMsg, Info | ||
50 | Core: ConName, TyConName, FunName, CaseFunName, TyCaseFunName, FunDef, Freq, Exp, Neutral, ExpType | ||
51 | |||
52 | newtypes: | ||
53 | Lexer: ParseError | ||
54 | DeBruijn: FreeVars | ||
55 | DesugaredSource: SPos, FName | ||
56 | Utils: SData | ||
57 | |||
58 | patterns: | ||
59 | Pretty: DText, DAt, DApp, DHApp, DSemi, DArr_, DCstr, DAnn, DLet, DComma, DPar, DParen, DBrace, DBracket, DOp, DOp0, DSep, DGlue, DArr, DForall, | ||
60 | DContext', DContext, DParContext, DLam, DLet' | ||
61 | Patterns: ParPat, PWildcard, PCon, ViewPat, PatType, PVarSimp, PConSimp, ViewPatSimp, PatTypeSimp, PParens, Otherwise | ||
62 | DesugaredSource: Ticked, CaseName, MatchName, SPos, SIName_, SIName, Tag, FTag, SBind, SPi, SLam, Wildcard, SLet, SLamV, SVar, SApp, SAppH, SAppV, SAppV2, | ||
63 | SBuiltin, SRHS, Section, SType, SConstraint, Parens, SAnn, SCW, TyType, HList, HCons, HNil, BList, BCons, BNil, UncurryS, AppsS, StLet, Primitive | ||
64 | |||
65 | Infer: EBind2, CheckType | ||
66 | Core: TType, NoRHS, Fun, CaseFun_, TyCaseFun_, App_, Con, TyCon, Lam, Pi, Let, SubstLet, CaseFun, TyCaseFun, Var, App, DFun, DFun_, UFun, DFunN, | ||
67 | DFunN_, ConN, TyConN, TTyCon0, :~>, TConstraint, Unit, TInt, TNat, TBool, TFloat, TString, TChar, TOrdering, TVec, Empty, TT, CUnit, CEmpty, | ||
68 | CstrT, CstrT', Coe, ParEval, T2, CW, CW_, CSplit,HLit, HInt, HFloat, HChar, HString, EBool, ENat, ReducedN, Reduced, FFix, NonNeut | ||