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
40c64c60
Commit
40c64c60
authored
Aug 27, 2013
by
Björn Peemöller
Browse files
Fix for primitive type constructors
parent
23ba4e77
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Base/Types.lhs
View file @
40c64c60
...
...
@@ -253,38 +253,41 @@ There are a few predefined types:
\begin{verbatim}
>
unitType
::
Type
>
unitType
=
TypeConstructor
qU
nitId
[]
>
unitType
=
primType
u
nitId
[]
>
boolType
::
Type
>
boolType
=
TypeConstructor
qB
oolId
[]
>
boolType
=
primType
b
oolId
[]
>
charType
::
Type
>
charType
=
TypeConstructor
qC
harId
[]
>
charType
=
primType
c
harId
[]
>
intType
::
Type
>
intType
=
TypeConstructor
qI
ntId
[]
>
intType
=
primType
i
ntId
[]
>
floatType
::
Type
>
floatType
=
TypeConstructor
qF
loatId
[]
>
floatType
=
primType
f
loatId
[]
>
stringType
::
Type
>
stringType
=
listType
charType
>
successType
::
Type
>
successType
=
TypeConstructor
qS
uccessId
[]
>
successType
=
primType
s
uccessId
[]
>
listType
::
Type
->
Type
>
listType
ty
=
TypeConstructor
qL
istId
[
ty
]
>
listType
ty
=
primType
l
istId
[
ty
]
>
ioType
::
Type
->
Type
>
ioType
ty
=
TypeConstructor
qIO
Id
[
ty
]
>
ioType
ty
=
primType
io
Id
[
ty
]
>
tupleType
::
[
Type
]
->
Type
>
tupleType
tys
=
TypeConstructor
(
qT
upleId
(
length
tys
))
tys
>
tupleType
tys
=
primType
(
t
upleId
(
length
tys
))
tys
>
typeVar
::
Int
->
Type
>
typeVar
=
TypeVariable
>
primType
::
Ident
->
[
Type
]
->
Type
>
primType
=
TypeConstructor
.
qualifyWith
preludeMIdent
>
predefTypes
::
[(
Type
,
[
DataConstr
])]
>
predefTypes
=
let
a
=
typeVar
0
in
>
[
(
unitType
,
[
DataConstr
unitId
0
[]
])
...
...
src/Env/TypeConstructor.hs
View file @
40c64c60
...
...
@@ -101,8 +101,16 @@ lookupTC tc tcEnv = lookupTopEnv tc tcEnv ++! lookupTupleTC tc
qualLookupTC
::
QualIdent
->
TCEnv
->
[
TypeInfo
]
qualLookupTC
tc
tcEnv
=
qualLookupTopEnv
tc
tcEnv
++!
qualLookupList
tc
tcEnv
++!
lookupTupleTC
(
unqualify
tc
)
qualLookupList
::
QualIdent
->
TCEnv
->
[
TypeInfo
]
qualLookupList
tc
tcEnv
|
mmid
==
Just
preludeMIdent
&&
qid
==
listId
=
qualLookupTopEnv
(
qualify
qid
)
tcEnv
|
otherwise
=
[]
where
(
mmid
,
qid
)
=
(
qidModule
tc
,
qidIdent
tc
)
lookupTupleTC
::
Ident
->
[
TypeInfo
]
lookupTupleTC
tc
|
isTupleId
tc
=
[
tupleTCs
!!
(
tupleArity
tc
-
2
)]
|
otherwise
=
[]
...
...
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