[Haskell-cafe] newbie question about Functional dependencies conflict between instance declarations:.....

2013-07-05 Thread Nicholls, Mark
Hello, I largely don't know what I'm doing or even trying to do, it is a voyage into the unknownbutif I go... {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} class Foo x y | x -

Re: [Haskell-cafe] newbie question about Functional dependencies conflict between instance declarations:.....

2013-07-05 Thread Erik Hesselink
The constraint on an instance never influences which instance is selected. So as far as instance selection goes, 'instance Foo x' and 'instance C x = Foo x' are the same. The constraint is only checked after the instance is selected. Erik On Fri, Jul 5, 2013 at 2:43 PM, Nicholls, Mark

Re: [Haskell-cafe] newbie question about Functional dependencies conflict between instance declarations:.....

2013-07-05 Thread Tikhon Jelvis
You're running into the open worldassumption--anybody could come along and make Integer part of your NotAnInteger class, and there's nothing you can do to stop them. This is a design tradeoff for typeclasses: typeclass instances are always global and are exported to all other modules you use. This

Re: [Haskell-cafe] newbie question about Functional dependencies conflict between instance declarations:.....

2013-07-05 Thread Nicholls, Mark
London NW1 8TT | e: nicholls.m...@vimn.commailto:m...@vimn.com T: +44 (0)203 580 2223 [Description: cid:image001.png@01CD488D.9204D030] From: Tikhon Jelvis [mailto:tik...@jelv.is] Sent: 05 July 2013 2:08 PM To: Nicholls, Mark Cc: haskell-cafe Subject: Re: [Haskell-cafe] newbie question about

[Haskell-cafe] A question about functional dependencies

2007-12-23 Thread alpheccar
I have defined a function on types thanks to functional dependencies. I use it like that: myFunction :: (TypeFunction MyComplexType f) = f - f f is unique for MyComplexType. Is there a way to name f ? I would like to write: myFunction :: SimplifiedType - SimplifiedType where TypeFunction

Re: [Haskell-cafe] A question about functional dependencies

2007-03-28 Thread Matthew Brecknell
[EMAIL PROTECTED]: [...] The above two instances show there exists a model of T where the functional dependency is violated. That's why both GHC 6.4 and Hugs reject the instance. Again, it is a mystery why GHC 6.6 accepts it. Actually, GHC 6.6 does reject cases like the one discussed in this

[Haskell-cafe] A question about functional dependencies and existential quantification

2007-03-26 Thread Jean-Marie Gaillourdet
Hi, I am trying to do something like the following: {-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-} module TestCase where data Any root = forall pos sel . T root pos sel = ANY pos class T root pos sel | pos - root, root - sel where f :: pos - sel - Bool instance T root

RE: [Haskell-cafe] A question about functional dependencies and existential quantification

2007-03-26 Thread Simon Peyton-Jones
Of Jean- | Marie Gaillourdet | Sent: 26 March 2007 10:53 | To: haskell-cafe@haskell.org | Subject: [Haskell-cafe] A question about functional dependencies and existential quantification | | Hi, | | I am trying to do something like the following: | | {-# OPTIONS -fglasgow-exts -fallow-undecidable

Re: [Haskell-cafe] A question about functional dependencies and existential quantification

2007-03-26 Thread Jean-Marie Gaillourdet
Hi, thanks for your quick answer. Do you have any predictions when System F_c in GHC will be available for usage? Regards, Jean-Marie Simon Peyton-Jones wrote: What you want to do is perfectly reasonable -- but it cannot be translated into System F and that's why GHC rejects it. GHC now

RE: [Haskell-cafe] A question about functional dependencies and existential quantification

2007-03-26 Thread Simon Peyton-Jones
| thanks for your quick answer. Do you have any predictions when System | F_c in GHC will be available for usage? Somewhere between 2 and 4 months is my guess Simon ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] A question about functional dependencies and existential quantification

2007-03-26 Thread oleg
Jean-Marie Gaillourdet wrote I am trying to do something like the following: {-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-} module TestCase where data Any root = forall pos sel . T root pos sel = ANY pos class T root pos sel | pos - root, root - sel where f :: pos