Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
curry
curry-frontend
Commits
6a671c37
Commit
6a671c37
authored
Sep 06, 2011
by
Björn Peemöller
Browse files
Refactoring
parent
a35f0d57
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Base/TypeSubst.lhs
View file @
6a671c37
...
...
@@ -91,7 +91,7 @@ the order of their occurrence. This is handled by the function
>
expandAliasType
_
(
TypeSkolem
k
)
=
TypeSkolem
k
>
expandAliasType
tys
(
TypeRecord
fs
rv
)
>
|
isJust
rv
=
>
let
(
TypeVariable
tv
)
=
expandAliasType
tys
(
TypeVariable
(
fromJust
rv
))
>
let
(
TypeVariable
tv
)
=
expandAliasType
tys
$
TypeVariable
$
fromJust
rv
>
in
TypeRecord
fs'
(
Just
tv
)
>
|
otherwise
=
>
TypeRecord
fs'
Nothing
...
...
src/Env/TypeConstructors.lhs
View file @
6a671c37
...
...
@@ -40,10 +40,11 @@ changes which are private to the module.
>
import
Base.Types
>
import
Base.Utils
((
++!
))
>
data
TypeInfo
=
DataType
QualIdent
Int
[
Maybe
DataConstr
]
>
|
RenamingType
QualIdent
Int
DataConstr
>
|
AliasType
QualIdent
Int
Type
>
deriving
Show
>
data
TypeInfo
>
=
DataType
QualIdent
Int
[
Maybe
DataConstr
]
>
|
RenamingType
QualIdent
Int
DataConstr
>
|
AliasType
QualIdent
Int
Type
>
deriving
Show
>
instance
Entity
TypeInfo
where
>
origName
(
DataType
tc
_
_
)
=
tc
...
...
@@ -51,7 +52,7 @@ changes which are private to the module.
>
origName
(
AliasType
tc
_
_
)
=
tc
>
>
merge
(
DataType
tc
n
cs
)
(
DataType
tc'
_
cs'
)
>
|
tc
==
tc'
=
Just
(
DataType
tc
n
(
mergeData
cs
cs'
))
>
|
tc
==
tc'
=
Just
$
DataType
tc
n
$
mergeData
cs
cs'
>
where
mergeData
ds
[]
=
ds
>
mergeData
[]
ds
=
ds
>
mergeData
(
d
:
ds
)
(
d'
:
ds'
)
=
d
`
mplus
`
d'
:
mergeData
ds
ds'
...
...
@@ -81,11 +82,10 @@ impossible to insert them into the environment in advance.
>
bindTypeInfo
::
(
QualIdent
->
Int
->
a
->
TypeInfo
)
->
ModuleIdent
>
->
Ident
->
[
Ident
]
->
a
->
TCEnv
->
TCEnv
>
bindTypeInfo
f
m
tc
tvs
x
>
=
bindTopEnv
"Base.bindTypeInfo"
tc
t
>
.
qualBindTopEnv
"Base.bindTypeInfo"
tc'
t
>
where
tc'
=
qualifyWith
m
tc
>
t
=
f
tc'
(
length
tvs
)
x
>
bindTypeInfo
f
m
tc
tvs
x
=
bindTopEnv
"Base.bindTypeInfo"
tc
tyInfo
>
.
qualBindTopEnv
"Base.bindTypeInfo"
qtc
tyInfo
>
where
qtc
=
qualifyWith
m
tc
>
tyInfo
=
f
qtc
(
length
tvs
)
x
>
lookupTC
::
Ident
->
TCEnv
->
[
TypeInfo
]
>
lookupTC
tc
tcEnv
=
lookupTopEnv
tc
tcEnv
++!
lookupTupleTC
tc
...
...
Write
Preview
Supports
Markdown
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