Hi,
It seems that from GHC 7.4, the prohibition on implicit parameter
constraints in instance declarations has been relaxed. The program below
gives the error Illegal constraint ?fooRev::Bool in GHC 7.2.1 but
loads fine in GHC 7.4.2 and GHC 7.6.2.
I can't spot anything about this in the release
-haskell-users-
| boun...@haskell.org] On Behalf Of Ganesh Sittampalam
| Sent: 16 July 2013 07:21
| To: glasgow-haskell-users@haskell.org
| Subject: implicit params in instance contexts
|
| Hi,
|
| It seems that from GHC 7.4, the prohibition on implicit parameter
| constraints in instance declarations
On Mon, Jul 15, 2013 at 11:21 PM, Ganesh Sittampalam gan...@earth.li wrote:
Hi,
It seems that from GHC 7.4, the prohibition on implicit parameter
constraints in instance declarations has been relaxed. The program below
gives the error Illegal constraint ?fooRev::Bool in GHC 7.2.1 but
loads
GHC ticket:
http://ghc.haskell.org/trac/ghc/ticket/7624
2013/7/16 Ganesh Sittampalam gan...@earth.li
Hi,
It seems that from GHC 7.4, the prohibition on implicit parameter
constraints in instance declarations has been relaxed. The program below
gives the error Illegal constraint
#7279: warning for unused type variables in instance contexts;
-fwarn-unreachable-
type-variables?
--+-
Reporter: nfrisby | Owner:
Type: feature request
#7279: warning for unused type variables in instance contexts;
-fwarn-unreachable-
type-variables?
--+-
Reporter: nfrisby | Owner:
Type: feature request | Status
Below are examples of using the sub-class context at class level and at instance level. In this simple case they seem to give the same resultsIn general, are there certain situations in which one or the other is preferred? Patmodule CLASS where-- class and sub-classclass Class a where foo :: a - a
On Aug 3, 2011 1:33 PM, Patrick Browne patrick.bro...@dit.ie wrote:
instance Class Integer = SubClass Integer where
moo a = foo a
Since you've just written the Class instance for Integer, the superclass
context is actually irrelevant there. You may as well just write
instance SubClass
Try
:t (foo 2, moo 2)
On 3 Aug 2011, at 23:31, Patrick Browne wrote:
Below are examples of using the sub-class context at class level and at
instance level.
In this simple case they seem to give the same results
In general, are there certain situations in which one or the other is
Wolfgang Lux wrote:
Wolfgang Jeltsch wrote
Hello,
say I have a type T defined the follwing way:
newtype T a b = T (a b)
Now I want to make every T a b with a b beeing an instance of Eq also an
instance of Eq where (==) just test for equality of the encapsulated values.
I
try
`Ord (s e)' in instance context
(Instance contexts must constrain only type variables)
[etc, etc]
Slainte,
Alex.
| I'd like to support Alex here: it is absolutely necessary to relax
| condition 10 of SPJ's list.
|
| http://www.dcs.gla.ac.uk/~simonpj/multi-param.html
|
| Idioms like the one above (`Ord (s a)' or
| `Show (s a)') arise too often and are completely natural.
|
| One of the great
On 15-Jul-1998, Alex Ferguson [EMAIL PROTECTED] wrote:
Fergus Henderson writes of:
the monomorphism restriction (which exists for a similar reason,
to ensure termination of type inference).
Is this true? The rationale normally given for it by its advocates
(boo, hiss) seems invariably
On 15-Jul-1998, Mark P Jones [EMAIL PROTECTED] wrote:
We've seen several examples now, from Ralf, Alex, and others, where it is
useful to relax the proposed restriction:
The types in an instance-declaration context must all be type variables.
...
Without the restriction, it is easy to come
On 15-Jul-1998, Alex Ferguson [EMAIL PROTECTED] wrote:
Mark Jones:
Looking at the `size' of types is, of course, a generalization of Simon's
suggestion that contexts might be allowed to constrain only proper sub-
expressions of types in the context. (Proper sub-expressions are, by
taking different positions on this. The
latest version of the Hugs type checker (in Hugs 1.3c) does not restrict
the types appearing in instance contexts or heads (other than ensuring
that they are valid and appropriately kinded). GHC imposes restrictions
that limit its expressiveness but also
Mark Jones:
Looking at the `size' of types is, of course, a generalization of Simon's
suggestion that contexts might be allowed to constrain only proper sub-
expressions of types in the context. (Proper sub-expressions are, by
definition, smaller in size.) However, it is still too strict
Hi Fergus,
| Without the restriction, it is easy to come up with examples that could
| lead to non-termination.
|
| Is non-termination really a problem in practice?
I don't think so, which is why I've been happy not to enforce
restrictions in Hugs. For example, Gofer programs can
Fergus Henderson, replaying to me:
I haven't looked at this in great detail, so forgive me if I'm talking
through my hat, as seems quite likely: is it workable to require only
that contexts be non-increasing in size, and that there be no manifest
circularity where the sizes are
| Fergus Henderson writes of:
| the monomorphism restriction (which exists for a similar reason,
| to ensure termination of type inference).
|
| Is this true? The rationale normally given for it by its advocates
| (boo, hiss) seems invariably the "no re-evaluation of CAFs" mantra.
Yes, I
20 matches
Mail list logo