Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sv2v
Overview
Overview
Details
Activity
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
lvzhengyang
sv2v
Commits
48f84a9e
Commit
48f84a9e
authored
Feb 09, 2020
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
faster param type conversion
parent
fc9999ae
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
src/Convert/ParamType.hs
+5
-4
No files found.
src/Convert/ParamType.hs
View file @
48f84a9e
...
...
@@ -57,7 +57,7 @@ convert files =
explodeDescription
other
=
[
other
]
-- remove or rewrite source modules that are no longer needed
files'''
=
map
(
uniq
.
concatMap
replaceDefault
)
files''
files'''
=
map
(
\
a
->
concatMap
(
replaceDefault
a
)
a
)
files''
(
usageMapRaw
,
usedTypedModulesRaw
)
=
execWriter
$
mapM
(
mapM
collectUsageInfoM
)
files''
usageMap
=
Map
.
unionsWith
Set
.
union
$
map
(
uncurry
Map
.
singleton
)
...
...
@@ -82,8 +82,8 @@ convert files =
then
tell
(
Set
.
empty
,
Set
.
singleton
m
)
else
tell
(
Set
.
singleton
m
,
Set
.
empty
)
collectModuleItemM
_
=
return
()
replaceDefault
::
Description
->
[
Description
]
replaceDefault
(
part
@
(
Part
_
_
_
_
name
_
_
))
=
replaceDefault
::
[
Description
]
->
Description
->
[
Description
]
replaceDefault
existing
(
part
@
(
Part
_
_
_
_
name
_
_
))
=
if
Map
.
notMember
name
info
then
[
part
]
else
if
Map
.
null
maybeTypeMap
then
...
...
@@ -93,6 +93,7 @@ convert files =
else
if
all
isNothing
maybeTypeMap
then
[]
else
filter
(
not
.
flip
elem
existing
)
$
(
:
)
(
removeDefaultTypeParams
part
)
$
if
isNothing
typeMap
then
[]
...
...
@@ -100,7 +101,7 @@ convert files =
where
maybeTypeMap
=
snd
$
info
Map
.!
name
typeMap
=
defaultInstance
maybeTypeMap
replaceDefault
other
=
[
other
]
replaceDefault
_
other
=
[
other
]
removeDefaultTypeParams
::
Description
->
Description
removeDefaultTypeParams
(
part
@
Part
{})
=
...
...
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