Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
abaea16d
Commit
abaea16d
authored
Jul 13, 2007
by
rl@cse.unsw.edu.au
Browse files
Refactor slightly
parent
9c9ff443
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/vectorise/Vectorise.hs
View file @
abaea16d
...
...
@@ -124,11 +124,7 @@ vectPolyVar lc v tys
lexpr
<-
replicateP
vexpr
lc
return
(
vexpr
,
lexpr
)
where
mk_app
e
=
do
vtys
<-
mapM
vectType
tys
dicts
<-
mapM
paDictOfType
vtys
return
$
mkApps
e
[
arg
|
(
vty
,
dict
)
<-
zip
vtys
dicts
,
arg
<-
[
Type
vty
,
dict
]]
mk_app
e
=
applyToTypes
e
=<<
mapM
vectType
tys
abstractOverTyVars
::
[
TyVar
]
->
((
CoreExpr
->
CoreExpr
)
->
VM
a
)
->
VM
a
abstractOverTyVars
tvs
p
...
...
@@ -145,6 +141,13 @@ abstractOverTyVars tvs p
mk_lams
mdicts
=
mkLams
[
arg
|
(
tv
,
mdict
)
<-
zip
tvs
mdicts
,
arg
<-
tv
:
maybeToList
mdict
]
applyToTypes
::
CoreExpr
->
[
Type
]
->
VM
CoreExpr
applyToTypes
expr
tys
=
do
dicts
<-
mapM
paDictOfType
tys
return
$
mkApps
expr
[
arg
|
(
ty
,
dict
)
<-
zip
tys
dicts
,
arg
<-
[
Type
ty
,
dict
]]
vectPolyExpr
::
CoreExpr
->
CoreExprWithFVs
->
VM
(
CoreExpr
,
CoreExpr
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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