On Feb 13, 2014, at 4:28 AM, José Pedro Magalhães wrote:
>
> The most interesting part here is the functional dependency fs -> k, where k
> is a kind variable!
> If this is not a bug (and it does seem to work as I expect it to), then could
> we have type families
> return kinds too?...
Yes,
Am Mittwoch, 17. August 2005 10:52 schrieb Simon Peyton-Jones:
> >From the instance declaration
>
> instance Fib Zero (Succ Zero)
> we get the improvement rule
> Fib Zero a ==> a=(Succ Zero)
> We get a similar rule from
> instance Fib (Succ Zero) (Succ Zero)
> But the instance dec
Am Dienstag, 16. August 2005 21:17 schrieb Keean Schupke:
> Attached are 3 Haskell modules used for type level programming. These
Thank you!
> The general 'trick' if you will is to imlement each funtion as a type
> class, pattern matching the
> types to instances in a type-level analogue of the v
Am Dienstag, 16. August 2005 19:45 schrieb Iavor Diatchki:
> Hello,
> I am not sure what GHC is doing, it certainly seems to be
> inconsistent. In Hugs both the examples work. In case you are
> interested, here is how you can get a version that works in
> both Hugs and GHC (I just modified your c
| > class C a b | a -> b
| > instance C Int Bool
| >
| > f :: forall a. C Int a => a -> a
| > f x = x
| >
| > GHC rejects the type signature for f, because we can see that 'a'
*must
| > be* Bool, so it's a bit misleading to universally quantify it.
|
| Ok, maybe this is a reasonabl
Attached are 3 Haskell modules used for type level programming. These
were developed as background work for the HList paper, but are not in
the final libraries as they are 'off topic' as it were. They were
however useful in testing type-level programming concepts.
Control.hs - This contains ty
Hello,
I am not sure what GHC is doing, it certainly seems to be
inconsistent. In Hugs both the examples work. In case you are
interested, here is how you can get a version that works in
both Hugs and GHC (I just modified your code a little):
{-# OPTIONS -fglasgow-exts -fallow-undecidable-instan
Hello Keean!
Am Dienstag, 16. August 2005 13:48 schrieb Keean Schupke:
> Picked up on this late... I have working examples of add etc under
> ghc/ghci...
> I can't remeber all the issues involved in getting it working, but I can
> post the
> code for add if its any use?
Yes, that would be nice. I
Picked up on this late... I have working examples of add etc under
ghc/ghci...
I can't remeber all the issues involved in getting it working, but I can
post the
code for add if its any use?
Keean.
Dirk Reckmann wrote:
Am Donnerstag, 11. August 2005 11:41 schrieb Simon Peyton-Jones:
Yo
Am Donnerstag, 11. August 2005 11:41 schrieb Simon Peyton-Jones:
> You raise a vexed question, which has been discussed a lot. Should this
> typecheck?
>
> class C a b | a -> b
> instance C Int Bool
>
> f :: forall a. C Int a => a -> a
> f x = x
>
> GHC rejects the type sig
You raise a vexed question, which has been discussed a lot. Should this
typecheck?
class C a b | a -> b
instance C Int Bool
f :: forall a. C Int a => a -> a
f x = x
GHC rejects the type signature for f, because we can see that 'a' *must
be* Bool, so it's a bit m
Manuel M T Chakravarty wrote:
I accept that this is the process by which GHC computes these types, but
it does violate the principal types property, doesn't it? The relation
Int -> () <= forall c. Int -> c
does not hold.
I realise that principal types and principal typings are slightly
di
Simon Peyton-Jones wrote:
> | > {-# OPTIONS -fglasgow-exts #-}
> | >
> | > class C a b c | a b -> c where
> | > foo :: (a, b) -> c
> | >
> | > instance C a a r => C a (b, c) r where
> | > foo (a, (b, c)) = foo (a, a)
>
> You are already on dodgy ground here, because the instance decl doesn't
>
Manuel
Your short program tickles a lot of different questions. Here's an
explanation.
Simon
| Assume the following type class declarations with functional
| dependencies:
Actually much of the behaviour you see happens without fundeps.
| > {-# OPTIONS -fglasgow-exts #-}
| >
| > class C a b c
Iavor Diatchki wrote:
> Hi,
>
> On Apr 3, 2005 7:33 AM, Manuel M T Chakravarty <[EMAIL PROTECTED]> wrote:
> > Assume the following type class declarations with functional
> > dependencies:
> >
> > > {-# OPTIONS -fglasgow-exts #-}
> > >
> > > class C a b c | a b -> c where
> > > foo :: (a, b) ->
Hi,
On Apr 3, 2005 7:33 AM, Manuel M T Chakravarty <[EMAIL PROTECTED]> wrote:
> Assume the following type class declarations with functional
> dependencies:
>
> > {-# OPTIONS -fglasgow-exts #-}
> >
> > class C a b c | a b -> c where
> > foo :: (a, b) -> c
> >
> > instance C a a r => C a (b, c) r
Christian
This is clearly a bug in 5.03.
However, it works fine in the (about to be released) 5.04.
My plan, therefore, is to add it to our regression test suite
and delcare victory. If I was being totally thorough I'd find
out what went wrong in 5.03, in case it's still wrong in 5.04, but
17 matches
Mail list logo