implicit params in instance contexts

2013-07-16 Thread Ganesh Sittampalam
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

RE: implicit params in instance contexts

2013-07-16 Thread Simon Peyton-Jones
-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

Re: implicit params in instance contexts

2013-07-16 Thread Shachaf Ben-Kiki
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

Re: implicit params in instance contexts

2013-07-16 Thread Krzysztof Gogolewski
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

Re: [GHC] #7279: warning for unused type variables in instance contexts; -fwarn-unreachable-type-variables?

2013-01-08 Thread GHC
#7279: warning for unused type variables in instance contexts; -fwarn-unreachable- type-variables? --+- Reporter: nfrisby | Owner: Type: feature request

[GHC] #7279: warning for unused type variables in instance contexts; -fwarn-unreachable-type-variables?

2012-09-28 Thread GHC
#7279: warning for unused type variables in instance contexts; -fwarn-unreachable- type-variables? --+- Reporter: nfrisby | Owner: Type: feature request | Status

[Haskell-cafe] Difference between class and instance contexts

2011-08-03 Thread Patrick Browne
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 

Re: [Haskell-cafe] Difference between class and instance contexts

2011-08-03 Thread Chris Smith
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

Re: [Haskell-cafe] Difference between class and instance contexts

2011-08-03 Thread Miguel Mitrofanov
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

Re: Instance contexts constraining only type variables?

2002-01-24 Thread Wolfgang Jeltsch
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

Non-variable instance contexts.

1998-11-17 Thread Alex Ferguson
`Ord (s e)' in instance context (Instance contexts must constrain only type variables) [etc, etc] Slainte, Alex.

Re: Instance contexts.

1998-07-28 Thread Ralf Hinze
| 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

the monomorphism restriction (was: instance contexts)

1998-07-17 Thread Fergus Henderson
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

Re: Instance contexts.

1998-07-16 Thread Fergus Henderson
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

Re: Instance contexts.

1998-07-16 Thread Fergus Henderson
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

RE: Instance contexts.

1998-07-15 Thread Mark P Jones
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

RE: Instance contexts.

1998-07-15 Thread Alex Ferguson
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

RE: Instance contexts.

1998-07-15 Thread Mark P Jones
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

Re: Instance contexts.

1998-07-15 Thread Alex Ferguson
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

RE: Instance contexts.

1998-07-15 Thread Mark P Jones
| 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