Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Finn Teegen
curry-frontend
Commits
f34bbb4f
Commit
f34bbb4f
authored
Oct 15, 2013
by
Matthias Böhm
Browse files
for looking up types of function decls: use qualLookupValue` instead of lookupValue
thus always only one Value should be obtained
parent
51d2ef14
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Checks/Dictionaries.hs
View file @
f34bbb4f
...
...
@@ -94,10 +94,11 @@ diDecl :: BT.Context -> Decl -> DI Decl
diDecl
cx
(
FunctionDecl
p
(
Just
cty
@
(
cx'
,
_
))
n
id0
eqs
)
=
do
cEnv
<-
getClassEnv
vEnv
<-
getValueEnv
m
<-
getModuleIdent
let
-- we have to reduce the context before adding dictionary parameters,
-- because the recorded context is the "raw" context
cx''
=
reduceContext
cEnv
$
mirrorBFCx
cx'
cx'''
=
removeNonLocal
vEnv
id0
l
ookupValue
cx''
cx'''
=
removeNonLocal
vEnv
(
qualify
id0
)
(
qualL
ookupValue
'
m
)
cx''
FunctionDecl
p
(
Just
cty
)
n
id0
`
liftM
`
(
mapM
(
diEqu
(
cx
++
cx'''
)
cx'''
)
eqs
)
diDecl
_
(
FunctionDecl
_
Nothing
_
_
_
)
=
internalError
"no type info in diDecl"
...
...
@@ -113,7 +114,7 @@ diDecl _ f = return f
removeNonLocal
::
ValueEnv
->
a
->
(
a
->
ValueEnv
->
[
ValueInfo
])
->
BT
.
Context
->
BT
.
Context
removeNonLocal
vEnv
id0
lookup0
cx
=
newCx
where
Value
_
_
(
ForAll
cxInf
_
_
)
_
:
_
=
lookup0
id0
vEnv
[
Value
_
_
(
ForAll
cxInf
_
_
)
_
]
=
lookup0
id0
vEnv
newCx
=
map
snd
$
filter
(
\
(
e1
,
_e2
)
->
local
e1
)
$
zip'
cxInf
cx
local
::
(
QualIdent
,
Type
)
->
Bool
-- TODO: actually check only the type variable in head position...
...
...
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