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
a69ec2aa
Commit
a69ec2aa
authored
Jul 05, 2013
by
Björn Peemöller
Browse files
Added type kind for interface syntax check
parent
b099a4a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Env/TypeConstructor.hs
View file @
a69ec2aa
...
...
@@ -40,6 +40,7 @@
module
Env.TypeConstructor
(
TCEnv
,
TypeInfo
(
..
),
tcArity
,
bindTypeInfo
,
lookupTC
,
qualLookupTC
,
lookupTupleTC
,
tupleTCs
,
tupleData
,
initTCEnv
,
TypeEnv
,
TypeKind
(
..
),
typeKind
)
where
import
Control.Monad
(
mplus
)
...
...
@@ -123,3 +124,19 @@ initTCEnv = foldr (uncurry predefTC) emptyTopEnv predefTypes
predefTC
(
TypeConstructor
tc
tys
)
=
predefTopEnv
(
qualify
(
unqualify
tc
))
.
DataType
tc
(
length
tys
)
.
map
Just
predefTC
_
=
internalError
"Base.initTCEnv.predefTC: no type constructor"
type
TypeEnv
=
TopEnv
TypeKind
data
TypeKind
=
Data
QualIdent
[
Ident
]
|
Alias
QualIdent
deriving
(
Eq
,
Show
)
typeKind
::
TypeInfo
->
TypeKind
typeKind
(
DataType
tc
_
cs
)
=
Data
tc
[
c
|
Just
(
DataConstr
c
_
_
)
<-
cs
]
typeKind
(
RenamingType
tc
_
(
DataConstr
c
_
_
))
=
Data
tc
[
c
]
typeKind
(
AliasType
tc
_
_
)
=
Alias
tc
instance
Entity
TypeKind
where
origName
(
Data
tc
_
)
=
tc
origName
(
Alias
tc
)
=
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