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
cc175183
Commit
cc175183
authored
Feb 23, 2016
by
Michael Hanus
Browse files
Bug fix for "f b | b = True", Success type removed
parent
8a2261e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Base/Types.hs
View file @
cc175183
...
...
@@ -27,7 +27,7 @@ module Base.Types
,
TypeScheme
(
..
),
ExistTypeScheme
(
..
),
monoType
,
polyType
-- * Predefined types
,
unitType
,
boolType
,
charType
,
intType
,
floatType
,
stringType
,
successType
,
listType
,
ioType
,
tupleType
,
typeVar
,
predefTypes
,
listType
,
ioType
,
tupleType
,
typeVar
,
predefTypes
)
where
import
Curry.Base.Ident
...
...
@@ -35,9 +35,8 @@ import Curry.Base.Ident
-- A type is either a type variable, an application of a type constructor
-- to a list of arguments, or an arrow type. The 'TypeConstrained'
-- case is used for representing type variables that are restricted to a
-- particular set of types. At present, this is used for typing guard
-- expressions, which are restricted to be either of type 'Bool' or of type
-- 'Success', and integer literals, which are restricted to types 'Int' and
-- particular set of types. At present, this is used for typing
-- integer literals, which are restricted to types 'Int' and
-- 'Float'. If the type is not restricted, it defaults to the first type
-- from the constraint list.
-- The case 'TypeSkolem' is used for handling skolem types, which
...
...
@@ -246,9 +245,6 @@ floatType = primType qFloatId []
stringType
::
Type
stringType
=
listType
charType
successType
::
Type
successType
=
primType
qSuccessId
[]
listType
::
Type
->
Type
listType
ty
=
primType
qListId
[
ty
]
...
...
src/Checks/TypeCheck.hs
View file @
cc175183
...
...
@@ -696,8 +696,7 @@ tcRhs tyEnv0 (GuardedRhs es ds) = do
tcCondExprs
::
ValueEnv
->
[
CondExpr
]
->
TCM
Type
tcCondExprs
tyEnv0
es
=
do
gty
<-
if
length
es
>
1
then
return
boolType
else
freshConstrained
[
successType
,
boolType
]
let
gty
=
boolType
-- the type of conditions
ty
<-
freshTypeVar
mapM_
(
tcCondExpr
gty
ty
)
es
return
ty
...
...
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