Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,327
Issues
4,327
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
363
Merge Requests
363
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
ccd4aa70
Commit
ccd4aa70
authored
Mar 01, 2013
by
Simon Peyton Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test Trac
#7729
parent
a3e91091
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
1 deletion
+84
-1
testsuite/tests/indexed-types/should_fail/T7729.hs
testsuite/tests/indexed-types/should_fail/T7729.hs
+28
-0
testsuite/tests/indexed-types/should_fail/T7729.stderr
testsuite/tests/indexed-types/should_fail/T7729.stderr
+17
-0
testsuite/tests/indexed-types/should_fail/T7729a.hs
testsuite/tests/indexed-types/should_fail/T7729a.hs
+28
-0
testsuite/tests/indexed-types/should_fail/T7729a.stderr
testsuite/tests/indexed-types/should_fail/T7729a.stderr
+8
-0
testsuite/tests/indexed-types/should_fail/all.T
testsuite/tests/indexed-types/should_fail/all.T
+3
-1
No files found.
testsuite/tests/indexed-types/should_fail/T7729.hs
0 → 100644
View file @
ccd4aa70
{-# LANGUAGE FlexibleContexts, TypeFamilies #-}
module
T7729
where
class
Monad
m
=>
PrimMonad
m
where
type
PrimState
m
class
MonadTrans
t
where
lift
::
Monad
m
=>
m
a
->
t
m
a
class
(
PrimMonad
(
BasePrimMonad
m
),
Monad
m
)
=>
MonadPrim
m
where
type
BasePrimMonad
m
::
*
->
*
liftPrim
::
BasePrimMonad
m
a
->
m
a
newtype
Rand
m
a
=
Rand
{
runRand
::
Maybe
(
m
()
)
->
m
a
}
instance
(
Monad
m
)
=>
Monad
(
Rand
m
)
where
return
=
Rand
.
const
.
return
(
Rand
rnd
)
>>=
f
=
Rand
$
\
g
->
(
\
x
->
runRand
(
f
x
)
g
)
=<<
rnd
g
instance
MonadTrans
Rand
where
lift
=
Rand
.
const
instance
MonadPrim
m
=>
MonadPrim
(
Rand
m
)
where
type
BasePrimMonad
(
Rand
m
)
=
BasePrimMonad
m
liftPrim
=
liftPrim
.
lift
\ No newline at end of file
testsuite/tests/indexed-types/should_fail/T7729.stderr
0 → 100644
View file @
ccd4aa70
T7729.hs:28:14:
Could not deduce (BasePrimMonad (Rand m)
~ t0 (BasePrimMonad (Rand m)))
from the context (PrimMonad (BasePrimMonad (Rand m)),
Monad (Rand m),
MonadPrim m)
bound by the instance declaration at T7729.hs:26:10-42
The type variable ‛t0’ is ambiguous
Expected type: t0 (BasePrimMonad (Rand m)) a -> Rand m a
Actual type: BasePrimMonad (Rand m) a -> Rand m a
Relevant bindings include
liftPrim :: BasePrimMonad (Rand m) a -> Rand m a
(bound at T7729.hs:28:3)
In the first argument of ‛(.)’, namely ‛liftPrim’
In the expression: liftPrim . lift
In an equation for ‛liftPrim’: liftPrim = liftPrim . lift
testsuite/tests/indexed-types/should_fail/T7729a.hs
0 → 100644
View file @
ccd4aa70
{-# LANGUAGE FlexibleContexts, TypeFamilies #-}
module
T7729a
where
class
Monad
m
=>
PrimMonad
m
where
type
PrimState
m
class
MonadTrans
t
where
lift
::
Monad
m
=>
m
a
->
t
m
a
class
(
PrimMonad
(
BasePrimMonad
m
),
Monad
m
)
=>
MonadPrim
m
where
type
BasePrimMonad
m
::
*
->
*
liftPrim
::
BasePrimMonad
m
a
->
m
a
newtype
Rand
m
a
=
Rand
{
runRand
::
Maybe
(
m
()
)
->
m
a
}
instance
(
Monad
m
)
=>
Monad
(
Rand
m
)
where
return
=
Rand
.
const
.
return
(
Rand
rnd
)
>>=
f
=
Rand
$
\
g
->
(
\
x
->
runRand
(
f
x
)
g
)
=<<
rnd
g
instance
MonadTrans
Rand
where
lift
=
Rand
.
const
instance
MonadPrim
m
=>
MonadPrim
(
Rand
m
)
where
type
BasePrimMonad
(
Rand
m
)
=
BasePrimMonad
m
liftPrim
x
=
liftPrim
(
lift
x
)
-- This line changed from T7729
\ No newline at end of file
testsuite/tests/indexed-types/should_fail/T7729a.stderr
0 → 100644
View file @
ccd4aa70
T7729a.hs:28:31:
Occurs check: cannot construct the infinite type: m0 ~ t0 m0
Expected type: m0 a
Actual type: BasePrimMonad (Rand m) a
In the first argument of ‛lift’, namely ‛x’
In the first argument of ‛liftPrim’, namely ‛(lift x)’
In the expression: liftPrim (lift x)
testsuite/tests/indexed-types/should_fail/all.T
View file @
ccd4aa70
...
...
@@ -94,4 +94,6 @@ test('T7354a',
['
$MAKE -s --no-print-directory T7354a
'])
test
('
T7536
',
normal
,
compile_fail
,
[''])
test
('
T7560
',
normal
,
compile_fail
,
[''])
\ No newline at end of file
test
('
T7560
',
normal
,
compile_fail
,
[''])
test
('
T7729
',
normal
,
compile_fail
,
[''])
test
('
T7729a
',
normal
,
compile_fail
,
[''])
Write
Preview
Markdown
is supported
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