-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathCompletionPipeChain.res
105 lines (81 loc) · 2.69 KB
/
CompletionPipeChain.res
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
module Integer: {
type t
let increment: (t, int) => t
let decrement: (t, int => int) => t
let make: int => t
let toInt: t => int
} = {
type t = int
let increment = (t, num) => t + num
let decrement = (t, decrementer) => decrementer(t)
let make = t => t
let toInt = t => t
}
module SuperFloat: {
type t
let fromInteger: Integer.t => t
let toInteger: t => Integer.t
} = {
type t = float
let fromInteger = t => t->Integer.toInt->Belt.Float.fromInt
let toInteger = t => t->Belt.Float.toInt->Integer.make
}
let toFlt = i => i->SuperFloat.fromInteger
let int = Integer.make(1)
let f = int->Integer.increment(2)
// let _ = int->
// ^com
// let _ = int->toFlt->
// ^com
// let _ = int->Integer.increment(2)->
// ^com
// let _ = Integer.increment(int, 2)->
// ^com
// let _ = int->Integer.decrement(t => t - 1)->
// ^com
// let _ = int->Integer.increment(2)->Integer.decrement(t => t - 1)->
// ^com
// let _ = int->Integer.increment(2)->SuperFloat.fromInteger->
// ^com
// let _ = int->Integer.increment(2)->SuperFloat.fromInteger->t
// ^com
// let _ = int->Integer.increment(2)->Integer.toInt->CompletionSupport.Test.make->
// ^com
// let _ = CompletionSupport.Test.make(1)->CompletionSupport.Test.addSelf(2)->
// ^com
let _ = [123]->Js.Array2.forEach(v => Js.log(v))
// ->
// ^com
let _ = [123]->Belt.Array.reduce(0, (acc, curr) => acc + curr)
// ->t
// ^com
type aliasedType = CompletionSupport.Test.t
let aliased: aliasedType = {name: 123}
let notAliased: CompletionSupport.Test.t = {name: 123}
// aliased->
// ^com
// notAliased->
// ^com
let renderer = CompletionSupport2.makeRenderer(
~prepare=() => "hello",
~render=props => {
ignore(props)
// Doesn't work when tried through this chain. Presumably because it now goes through multiple different files.
// props.support.root->ren
// ^com
let root = props.support.root
ignore(root)
// Works here though when it's lifted out. Probably because it only goes through one file...?
// root->ren
// ^com
React.null
},
(),
)
// Console.log(int->)
// ^com
// Console.log(int->t)
// ^com
let r = %re("/t/g")
// r->la
// ^com