Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
475e4b98
Commit
475e4b98
authored
Dec 14, 2010
by
Simon Peyton Jones
Browse files
Add FlexibleInstances to tests that need it
parent
7e208ced
Changes
5
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/perf/compiler/T3064.hs
View file @
475e4b98
{-# LANGUAGE Rank2Types, TypeSynonymInstances #-}
{-# LANGUAGE Rank2Types, TypeSynonymInstances
, FlexibleInstances
#-}
{-# LANGUAGE TypeFamilies, GeneralizedNewtypeDeriving #-}
module
Bug2
where
...
...
testsuite/tests/ghc-regress/rebindable/rebindable5.hs
View file @
475e4b98
{-# LANGUAGE RebindableSyntax, NPlusKPatterns,
TypeSynonym
Instances,
{-# LANGUAGE RebindableSyntax, NPlusKPatterns,
Flexible
Instances,
MultiParamTypeClasses, FunctionalDependencies #-}
module
Main
where
...
...
testsuite/tests/ghc-regress/simplCore/should_run/T3591.hs
View file @
475e4b98
...
...
@@ -3,23 +3,44 @@
This file is part of the Streaming Component Combinators (SCC) project.
The SCC project is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
version.
SCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with SCC. If not, see
<http://www.gnu.org/licenses/>.
The SCC project is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
SCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with SCC. If not, see <http://www.gnu.org/licenses/>.
-}
-- | Module "Trampoline" defines the pipe computations and their basic building blocks.
{-# LANGUAGE ScopedTypeVariables, Rank2Types, MultiParamTypeClasses, TypeFamilies, KindSignatures,
FlexibleContexts, FlexibleInstances, OverlappingInstances, UndecidableInstances
{-# LANGUAGE ScopedTypeVariables, Rank2Types, MultiParamTypeClasses,
TypeFamilies, KindSignatures, FlexibleContexts,
FlexibleInstances, OverlappingInstances, UndecidableInstances
#-}
{- Somewhere we get:
Wanted: AncestorFunctor (EitherFunctor a (TryYield a)) d
This should not reduce because of overlapping instances
If it (erroneously) does reduce, via dfun2 we get
Wanted: Functor (EitherFunctor a (TryYield a)
Functor d'
Functor d
d ~ EitherFunctor d' s
AncestorFunctor (EitherFunctor a (TryYield a) d'
And that gives an infinite loop in the type checker!
-}
module
Main
where
import
Control.Monad
(
liftM
,
liftM2
,
when
)
...
...
@@ -27,6 +48,28 @@ import Control.Monad (liftM, liftM2, when)
import
Debug.Trace
(
trace
)
-------------
class
(
Functor
a
,
Functor
d
)
=>
AncestorFunctor
a
d
where
liftFunctor
::
a
x
->
d
x
-- dfun 1
instance
Functor
a
=>
AncestorFunctor
a
a
where
liftFunctor
=
trace
"liftFunctor id"
.
id
-- dfun 2
instance
(
Functor
a
,
Functor
d'
,
Functor
d
,
d
~
EitherFunctor
d'
s
,
AncestorFunctor
a
d'
)
=>
AncestorFunctor
a
d
where
liftFunctor
=
LeftF
.
(
trace
"liftFunctor other"
.
liftFunctor
::
a
x
->
d'
x
)
-------------
newtype
Identity
a
=
Identity
{
runIdentity
::
a
}
instance
Monad
Identity
where
return
a
=
Identity
a
...
...
@@ -114,14 +157,6 @@ out (Trampoline ml) = Trampoline (liftM inject ml)
inject
(
Done
x
)
=
Done
x
inject
(
Suspend
l
)
=
Suspend
(
LeftF
$
fmap
out
l
)
class
(
Functor
a
,
Functor
d
)
=>
AncestorFunctor
a
d
where
liftFunctor
::
a
x
->
d
x
instance
Functor
a
=>
AncestorFunctor
a
a
where
liftFunctor
=
trace
"liftFunctor id"
.
id
instance
(
Functor
a
,
Functor
d'
,
Functor
d
,
d
~
EitherFunctor
d'
s
,
AncestorFunctor
a
d'
)
=>
AncestorFunctor
a
d
where
liftFunctor
=
LeftF
.
(
trace
"liftFunctor other"
.
liftFunctor
::
a
x
->
d'
x
)
liftOut
::
forall
m
a
d
x
.
(
Monad
m
,
Functor
a
,
AncestorFunctor
a
d
)
=>
Trampoline
m
a
x
->
Trampoline
m
d
x
liftOut
(
Trampoline
ma
)
=
trace
"liftOut"
$
Trampoline
(
liftM
inject
ma
)
where
inject
::
TrampolineState
m
a
x
->
TrampolineState
m
d
x
...
...
testsuite/tests/ghc-regress/th/TH_spliceDecl4.hs
View file @
475e4b98
{-# LANGUAGE TemplateHaskell, UndecidableInstances, TypeSynonymInstances #-}
{-# LANGUAGE TemplateHaskell, UndecidableInstances, FlexibleInstances, TypeSynonymInstances #-}
module
TH_spliceDecl4
where
...
...
testsuite/tests/ghc-regress/typecheck/should_compile/tc195.hs
View file @
475e4b98
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
TypeSynonymInstances #-}
FlexibleInstances,
TypeSynonymInstances #-}
-- This one made GHC 6.4 loop becuause Unify.unify
-- didn't deal correctly with unifying
...
...
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