Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
cloogle.org
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cloogle
cloogle.org
Commits
4a0059b6
Verified
Commit
4a0059b6
authored
Jun 20, 2016
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suggestions now have type Request
parent
aec79fea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
+16
-7
CloogleServer.icl
CloogleServer.icl
+4
-4
README.md
README.md
+2
-1
api.js
api.js
+10
-2
No files found.
CloogleServer.icl
View file @
4a0059b6
...
...
@@ -39,7 +39,7 @@ import Levenshtein
,
data
::
[
Result
]
,
msg
::
String
,
more_available
::
Maybe
Int
,
suggestions
::
Maybe
[(
String
,
Int
)]
,
suggestions
::
Maybe
[(
Request
,
Int
)]
}
::
Result
=
FunctionResult
FunctionResult
...
...
@@ -167,12 +167,12 @@ where
}
,
w
)
suggs
::
!(
Maybe
String
)
!
Type
!
TypeDB
->
Maybe
[(
String
,
Int
)]
suggs
::
!(
Maybe
String
)
!
Type
!
TypeDB
->
Maybe
[(
Request
,
Int
)]
suggs
n
(
Func
is
r
cc
)
db
|
length
is
<
3
=
Just
[
let
t`
=
concat
$
print
False
$
Func
is`
r
cc
in
let
s
=
if
(
isJust
n
)
(
fromJust
n
+
" "
)
""
+
":: "
+
t`
in
(
s
,
length
$
search
{
zero
&
name
=
n
,
unify
=
Just
t`
}
db
)
let
request
=
{
zero
&
name
=
n
,
unify
=
Just
t`
}
in
(
request
,
length
$
search
request
db
)
\\
is`
<-
permutations
is
|
is`
<>
is
]
suggs
_
_
_
=
Nothing
...
...
README.md
View file @
4a0059b6
...
...
@@ -111,7 +111,8 @@ fields:
-
`suggestions`
If there are similar searches that may return more results, this will be an
array of two-tuples with the alternative search and the number of results.
array of two-tuples with the alternative search (which has the same fields as
a request) and the number of results.
### Talking with the Clean backend directly
`CloogleServer`
is a TCP server listening on port 31215 (typically). Send a
...
...
api.js
View file @
4a0059b6
...
...
@@ -137,8 +137,16 @@ function getResults(str, page) {
var
str
=
'
<hr/><div id="suggestions"><b>Did you mean...</b><table>
'
;
for
(
i
in
suggs
)
{
var
sug
=
suggs
[
i
][
0
];
str
+=
'
<tr><td><a class="hidden" href="#
'
+
encodeURIComponent
(
sug
)
+
'
"><code>
'
+
highlightFunction
(
sug
)
+
'
</code></a></td><td>
'
+
var
sugstr
=
[]
if
(
'
name
'
in
sug
)
{
sugstr
.
push
(
sug
.
name
);
}
if
(
'
unify
'
in
sug
)
{
sugstr
.
push
(
'
::
'
+
sug
.
unify
);
}
sugstr
=
sugstr
.
join
(
'
'
);
str
+=
'
<tr><td><a class="hidden" href="#
'
+
encodeURIComponent
(
sugstr
)
+
'
"><code>
'
+
highlightFunction
(
sugstr
)
+
'
</code></a></td><td>
'
+
suggs
[
i
][
1
]
+
'
results</td></tr>
'
;
}
str
+=
'
</table></div>
'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment