-
Notifications
You must be signed in to change notification settings - Fork 230
/
polarity-search.t
105 lines (97 loc) · 2.41 KB
/
polarity-search.t
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
A few simple tests that show all the things we want to preserve or improve:
# To improve
- Presence of double underscores.
$ echo "" | $MERLIN single search-by-polarity -query "-float +int64" \
> -position 1:0 -filename test.ml | \
> jq '.value.entries[] | del(.info) | del(.kind) | del(.deprecated)'
{
"name": "Stdlib__int64.bits_of_float",
"desc": "float -> int64"
}
{
"name": "Stdlib__int64.of_float",
"desc": "float -> int64"
}
- Duplicated elements
$ echo "" | $MERLIN single search-by-polarity -safe-string \
> -query "-int +string" -position 1:0 -filename test.ml | \
> tr '\n' ' ' | jq '.value.entries |= (map(del(.deprecated)) | .[:2])'
{
"class": "return",
"value": {
"entries": [
{
"name": "string_of_int",
"kind": "Value",
"desc": "int -> string",
"info": ""
},
{
"name": "string_of_int",
"kind": "Value",
"desc": "int -> string",
"info": ""
}
],
"context": null
},
"notifications": []
}
# To keep
- Lower bound on function arity
$ echo "" | $MERLIN single search-by-polarity \
> -query "-float +fun +fun +float" -position 1:0 -filename test.ml | \
> tr '\n' ' ' | jq '.value.entries |= (map(del(.info) | del(.kind) | del (.deprecated)) | .[0:11])'
{
"class": "return",
"value": {
"entries": [
{
"name": "**",
"desc": "float -> float -> float"
},
{
"name": "**",
"desc": "float -> float -> float"
},
{
"name": "*.",
"desc": "float -> float -> float"
},
{
"name": "*.",
"desc": "float -> float -> float"
},
{
"name": "+.",
"desc": "float -> float -> float"
},
{
"name": "+.",
"desc": "float -> float -> float"
},
{
"name": "-.",
"desc": "float -> float -> float"
},
{
"name": "-.",
"desc": "float -> float -> float"
},
{
"name": "/.",
"desc": "float -> float -> float"
},
{
"name": "/.",
"desc": "float -> float -> float"
},
{
"name": "atan2",
"desc": "float -> float -> float"
}
],
"context": null
},
"notifications": []
}