Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
bf937f1a
Commit
bf937f1a
authored
Jul 07, 2021
by
Vaibhav Sagar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IHaskell.Eval.Hoogle: fix issue with parsing multiple `::`
parent
a6d0a651
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
Hoogle.hs
src/IHaskell/Eval/Hoogle.hs
+2
-2
StringUtils.hs
src/StringUtils.hs
+7
-0
No files found.
src/IHaskell/Eval/Hoogle.hs
View file @
bf937f1a
...
@@ -25,7 +25,7 @@ import Data.Vector (toList)
...
@@ -25,7 +25,7 @@ import Data.Vector (toList)
import
Network.HTTP.Client
import
Network.HTTP.Client
import
Network.HTTP.Client.TLS
import
Network.HTTP.Client.TLS
import
StringUtils
(
replace
,
split
,
strip
)
import
StringUtils
(
replace
,
split
,
s
plitFirst
,
s
trip
)
-- | Types of formats to render output to.
-- | Types of formats to render output to.
data
OutputFormat
=
Plain
-- ^ Render to plain text.
data
OutputFormat
=
Plain
-- ^ Render to plain text.
...
@@ -193,7 +193,7 @@ renderSelf string loc
...
@@ -193,7 +193,7 @@ renderSelf string loc
packageSub
package
packageSub
package
|
otherwise
=
|
otherwise
=
let
[
name
,
args
]
=
split
"::"
string
let
[
name
,
args
]
=
split
First
"::"
string
package
=
extractPackageName
loc
package
=
extractPackageName
loc
modname
=
extractModuleName
loc
modname
=
extractModuleName
loc
in
span
"hoogle-name"
in
span
"hoogle-name"
...
...
src/StringUtils.hs
View file @
bf937f1a
...
@@ -5,11 +5,13 @@ module StringUtils (
...
@@ -5,11 +5,13 @@ module StringUtils (
rstrip
,
rstrip
,
replace
,
replace
,
split
,
split
,
splitFirst
,
)
where
)
where
import
IHaskellPrelude
import
IHaskellPrelude
import
qualified
Data.Text
as
T
import
qualified
Data.Text
as
T
import
Data.List.Split
(
splitOn
)
import
Data.List.Split
(
splitOn
)
import
qualified
Data.List.Split
as
Split
lstrip
::
String
->
String
lstrip
::
String
->
String
lstrip
=
dropWhile
(`
elem
`
(
"
\t\r\n
"
::
String
))
lstrip
=
dropWhile
(`
elem
`
(
"
\t\r\n
"
::
String
))
...
@@ -26,3 +28,8 @@ replace needle replacement haystack =
...
@@ -26,3 +28,8 @@ replace needle replacement haystack =
split
::
String
->
String
->
[
String
]
split
::
String
->
String
->
[
String
]
split
=
splitOn
split
=
splitOn
splitFirst
::
String
->
String
->
[
String
]
splitFirst
delim
str
=
let
(
head
:
_
:
tail
)
=
Split
.
split
(
Split
.
onSublist
delim
)
str
in
[
head
,
concat
tail
]
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