Skip to content
This repository
Newer
Older
100644 106 lines (73 sloc) 3.417 kb
728516de »
2011-02-10 test docs
1 1. import
2 import <ctrl-space> -> list of modules
3
4 import qualified <ctrl-space> -> list of modules
5
6 import <Module> as <ctrl-space> -> nothing
7
8 import qualified <Module> as <ctrl-space> -> nothing
9
10 2. type definitions
11 <function> :: <ctrl-space> -> list of types
12
13 <function> :: <Type> -> <ctrl-space> -> list of types
14
15 <function> :: (<TypeClass> a) => <ctrl-space> -> list of types (+ a would be heaven (-:)
16
17 <function> :: <Type1> -> <Type2>( <ctrl-space> -> list of types
18
19 3. functions
20 <function> a = <ctrl-space> -> list of variables
21
22 <function> <ctrl-space> -> list of constructors
23
24 <function> :: <Type1> -> <Type2>
25 <function> a = <ctrl-space> -> list of variables
26
27 <function> :: (<TypeClass> a) => <Type1> -> a
28 <function> a = <ctrl-space> -> list of variables
29
30 <function> a = case a of
31 <ctrl-space> -> list of constructors
32
33 <function> a = case a of
34 Nothing -> <ctrl-space> -> list of variables
35
36 <function> a = let <ctrl-space> -> nothing
37
38 <function> a = do <ctrl-space> -> list of variables
39
40 <function> a = go a
41 where go <ctrl-space> -> list of constructors
42
43 <function> a = go a
44 where go b =<ctrl-space> -> list of variables
45
46 <function> a b | <ctrl-space> -> list of variables
47
48 4. Type annotations inside code
49 <function> a = do
50 b<-(read a):: <ctrl-space> -> list of types
51
52 5. parenthesis
53 <function> a = do
54 b<-((read a)::String)++<ctrl-space> -> list of variables
55
56 6. module
57 module <ctrl-space> -> nothing
58
59 7. data declarations
60 data <ctrl-space> -> nothing
61
62 data <Type> = <ctrl-space> -> nothing
63
64 data <Type>= <Constructor> <ctrl-space> -> list of types
65
66 data <Type>= <Constructor> <Type1> <Type2>
67 deriving <ctrl-space> -> list of types
68
69 data <Type>= <Constructor> {<ctrl-space> -> nothing
70
71 data <Type>= <Constructor> {a::<ctrl-space> -> list of types
72
73 type <Type>= <ctrl-space> -> list of types
74
75 newtype <Type>= <ctrl-space> -> list of types
76
77 8. litterals
78 function fun1 a=let
79 b="<ctrl-space> -> nothing ??? probably difficult to know if we're inside or outside the string litteral, etc... minor
80
81
82
83 rules
84 -read tokens backwards from position
85 -encounter ) increase parenthesis count
86 -encouter ( decrease parenthesis count if >0, otherwise ignore
87 -encounter } increase curlycount
88 -encounter { decrease curly count if >0, otherwise nothing
89 -encounter = keep flag "equal"
90 -encounter <- : variables
91 -encounter as nothing
92 -encounter { nothing
93 -encounter import, qualified modules
94 -encounter deriving types
95 -encounter ::, => type
96 -encounter | variables
97 -encounter -> keep flag ("right arrow")
98 - encounter :: type
99 - encounter case variables
100 -encounter of constructor
101 -encounter let nothing unless flag "equal": types
102 -encounter module nothing
103 -encounter = then data,type,newtype -> list of types
104 -reach column 0 constructors unless flag "equal": types
105 -encounter where constructors unless flag "equal": types
106 -variables
Something went wrong with that request. Please try again.