Re: [Haskell-cafe] Functional dependencies conflict

2015-04-05 Thread Roman Cheplyaka
On 05/04/15 15:54, Daniel Trstenjak wrote: On Sun, Apr 05, 2015 at 03:25:01PM +0300, Roman Cheplyaka wrote: Data.ByteString.Lazy.Char8 exports the same lazy bytestring type as Data.ByteString.Lazy. Only functions and instances differ. So my only option in this case is to define a newtype

Functional dependencies conflict

2015-04-05 Thread Daniel Trstenjak
Hi, I'm getting the compile error: Gamgine/Image/PNG/Internal/Parser.hs:14:10: Functional dependencies conflict between instance declarations: instance Monad m = Stream LB.ByteString m Word8 -- Defined at Gamgine/Image/PNG/Internal/Parser.hs:14:10 instance Monad m

Re: [Haskell-cafe] Functional dependencies conflict

2015-04-05 Thread Roman Cheplyaka
the same lazy bytestring type as Data.ByteString.Lazy. Only functions and instances differ. Well, *instances* can't differ... On 05/04/15 15:19, Daniel Trstenjak wrote: Hi, I'm getting the compile error: Gamgine/Image/PNG/Internal/Parser.hs:14:10: Functional dependencies conflict

Re: [Haskell-cafe] Functional dependencies conflict

2015-04-05 Thread Roman Cheplyaka
Data.ByteString.Lazy.Char8 exports the same lazy bytestring type as Data.ByteString.Lazy. Only functions and instances differ. On 05/04/15 15:19, Daniel Trstenjak wrote: Hi, I'm getting the compile error: Gamgine/Image/PNG/Internal/Parser.hs:14:10: Functional dependencies conflict

Re: [Haskell-cafe] Functional dependencies conflict

2015-04-05 Thread Daniel Trstenjak
On Sun, Apr 05, 2015 at 03:25:01PM +0300, Roman Cheplyaka wrote: Data.ByteString.Lazy.Char8 exports the same lazy bytestring type as Data.ByteString.Lazy. Only functions and instances differ. So my only option in this case is to define a newtype wrapper for Data.ByteString.Lazy and then define

Functional dependencies can return kinds, type families cannot

2014-02-13 Thread José Pedro Magalhães
Hello, Maybe this is well known already (or maybe it's a bug), but lately I've again found that functional dependencies are more versatile than type families. In particular, they can be used to compute kinds from types, whereas type families cannot. Consider the code below, which implements

Re: Functional dependencies can return kinds, type families cannot

2014-02-13 Thread Richard Eisenberg
?... Yes, I ran into this a while ago. A function dependency on a kind seems to work remarkably well. Can we have type families that return kinds? No. Well, not yet. Functional dependencies inform type inference but don't produce any evidence in Core -- a dependency is only ever used to eliminate

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

2013-07-05 Thread Nicholls, Mark
understand thisI can't claim that Bar,x is a member of Foo and Integer,Integer is member of Foo and preserve my functional dependencies, because Bar,Integer is now a member of Foo.. Bad programmer... So how I naively go class NotAnInteger a instance (NotAnInteger x) = Foo Bar x

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

2013-07-05 Thread Erik Hesselink
Error!but I’m think I understand this….I can’t claim that Bar,x is a member of Foo and Integer,Integer is member of Foo and preserve my functional dependencies, because Bar,Integer is now a member of Foo.. Bad programmer……. So how I naively go…. class NotAnInteger

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

2013-07-05 Thread Tikhon Jelvis
functional dependencies, because Bar,Integer is now a member of Foo..*** * ** ** Bad programmer……. ** ** ** ** So how I naively go…. ** ** ** ** class NotAnInteger a ** ** instance (NotAnInteger x) = Foo Bar x ** ** I haven’t declared integer to be “NotAnInteger

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

2013-07-05 Thread Nicholls, Mark
Functional dependencies conflict between instance declarations:. 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

[Haskell-cafe] The Coverage Condition of functional dependencies

2013-01-23 Thread Petr P
that s will be always deducible from m. I wonder, would it be possible to augment the type checker to realize this? It seems reasonable: Before comparing if S(tvsright) is a subset of S(tvsleft), we'd add every type variable to S(tvsleft) that is determined from it using functional dependencies

[Haskell-cafe] MPTC or functional dependencies?

2012-12-21 Thread Petr P
Dear Haskellers, I'm working on a small library for representing semigroup (or monoid) actions on a set http://hackage.haskell.org/package/semigroups-actions. The MultiParamTypeClasses extension seems to be best suited for the task, as a group can act on many sets, and a set can be acted on by

Re: [Haskell-cafe] MPTC or functional dependencies?

2012-12-21 Thread Kim-Ee Yeoh
Petr, Your subject header is misleading: FDs don't make sense without MPTCs. As you acknowledge at the end, what you're ultimately asking is: to FD or not to FD. Note also, the contemporary debate has shifted to TFs (type families) vs FDs. -- Kim-Ee On Fri, Dec 21, 2012 at 7:38 PM, Petr P

Re: [Haskell-cafe] MPTC or functional dependencies?

2012-12-21 Thread Petr P
Hi Kim-Ee, you're right, it's a bit misleading. I thought about TFs too, personally I mostly prefer them over FDs, but I'd like the library available for as many compilers as possible. 'semigroups' is just Haskell 98 and I'd like to keep the requirements similarly low. Best regards, Petr

Re: [Haskell-cafe] MPTC or functional dependencies?

2012-12-21 Thread Roman Cheplyaka
* Petr P petr@gmail.com [2012-12-21 13:38:21+0100] Dear Haskellers, I'm working on a small library for representing semigroup (or monoid) actions on a set http://hackage.haskell.org/package/semigroups-actions. The MultiParamTypeClasses extension seems to be best suited for the task, as

Re: [GHC] #7384: Panic ctEvTerm when using functional dependencies and PolyKinds

2012-11-29 Thread GHC
#7384: Panic ctEvTerm when using functional dependencies and PolyKinds -+-- Reporter: goldfire| Owner: Type: bug

Re: [GHC] #7384: Panic ctEvTerm when using functional dependencies and PolyKinds

2012-11-06 Thread GHC
#7384: Panic ctEvTerm when using functional dependencies and PolyKinds --+- Reporter: goldfire | Owner: Type: bug | Status: new

Re: [GHC] #7384: Panic ctEvTerm when using functional dependencies and PolyKinds

2012-11-06 Thread GHC
#7384: Panic ctEvTerm when using functional dependencies and PolyKinds --+- Reporter: goldfire | Owner: Type: bug | Status: new

Re: [GHC] #7384: Panic ctEvTerm when using functional dependencies and PolyKinds

2012-11-06 Thread GHC
#7384: Panic ctEvTerm when using functional dependencies and PolyKinds -+-- Reporter: goldfire | Owner: Type: bug

[GHC] #7384: Panic ctEvTerm when using functional dependencies and PolyKinds

2012-11-01 Thread GHC
#7384: Panic ctEvTerm when using functional dependencies and PolyKinds --+- Reporter: goldfire | Owner: Type: bug | Status: new

[Haskell-cafe] How Type inference work in presence of Functional Dependencies

2012-09-13 Thread satvik chauhan
Consider the code below : {-# LANGUAGE MultiParamTypeClasses,FlexibleInstances,FunctionalDependencies,UndecidableInstances,FlexibleContexts #-} class Foo a c | a - c instance Foo Int Float f :: (Foo Int a) = Int - a f = undefined Now when I see the inferred type of f in ghci :t f f :: Int -

Re: [Haskell-cafe] How Type inference work in presence of Functional Dependencies

2012-09-13 Thread Erik Hesselink
I don't know if this is a bug or not, but the translation to type families works: class Foo a where type FooT a :: * instance Foo Int where type FooT Int = Float f :: Int - FooT Int f = undefined g :: Int - Float g = undefined h :: Int - FooT Int h = g You don't even need the class

[Haskell-cafe] Fwd: How Type inference work in presence of Functional Dependencies

2012-09-13 Thread Dan Doel
Copying the mailing list, because I forgot. On Thu, Sep 13, 2012 at 5:18 AM, satvik chauhan mystic.sat...@gmail.com wrote: Consider the code below : {-# LANGUAGE MultiParamTypeClasses,FlexibleInstances,FunctionalDependencies,UndecidableInstances,FlexibleContexts #-} class Foo a c | a - c

Re: [Haskell-cafe] converting functional dependencies to type families

2012-06-11 Thread Simon Peyton-Jones
: converting functional dependencies to type families | | | On Thu, 7 Jun 2012, Simon Peyton-Jones wrote: | | Very useful! Maybe worth turning into a page on the Haskell wiki? | | I created one: | | http://www.haskell.org/haskellwiki/Functional_dependencies_vs._type_fami | lies

Re: [Haskell-cafe] converting functional dependencies to type families

2012-06-11 Thread Henning Thielemann
On Mon, 11 Jun 2012, Simon Peyton-Jones wrote: Thanks. I've linked to it from http://www.haskell.org/haskellwiki/GHC/Type_families#Frequently_asked_questions Thank you! I already added this and another link to a new See also section below. Which one shall we maintain?

Re: [Haskell-cafe] converting functional dependencies to type families

2012-06-10 Thread Henning Thielemann
On Thu, 7 Jun 2012, Simon Peyton-Jones wrote: Very useful! Maybe worth turning into a page on the Haskell wiki? I created one: http://www.haskell.org/haskellwiki/Functional_dependencies_vs._type_families ___ Haskell-Cafe mailing list

Re: [GHC] #6134: Incorrect ambiguity error with functional dependencies

2012-06-08 Thread GHC
#6134: Incorrect ambiguity error with functional dependencies -+-- Reporter: diatchki| Owner: Type: bug | Status: closed

Re: [GHC] #6134: Incorrect ambiguity error with functional dependencies

2012-06-05 Thread GHC
#6134: Incorrect ambiguity error with functional dependencies +--- Reporter: diatchki | Owner: Type: bug | Status: new

[Haskell-cafe] converting functional dependencies to type families

2012-06-05 Thread Henning Thielemann
Hi all, when I reported a typechecker performance problem related to functional dependencies http://hackage.haskell.org/trac/ghc/ticket/5970 I promised to try to convert from functional dependencies to type families. Thus I converted my code and the llvm package to type-families

[GHC] #6134: Incorrect ambiguity error with functional dependencies

2012-05-29 Thread GHC
#6134: Incorrect ambiguity error with functional dependencies ---+ Reporter: diatchki | Owner: Type: bug| Status: new

Re: [GHC] #6068: Panic in GHCi when using functional dependencies and promoted kinds

2012-05-16 Thread GHC
#6068: Panic in GHCi when using functional dependencies and promoted kinds --+- Reporter: goldfire | Owner: Type: bug | Status: new Priority

[GHC] #6068: Panic in GHCi when using functional dependencies and promoted kinds

2012-05-01 Thread GHC
#6068: Panic in GHCi when using functional dependencies and promoted kinds --+- Reporter: goldfire | Owner: Type: bug | Status: new Priority

Re: [GHC] #3108: Do a better job of solving recursive type-class constraints with functional dependencies

2012-04-11 Thread GHC
#3108: Do a better job of solving recursive type-class constraints with functional dependencies +--- Reporter: simonpj | Owner: Type: bug

Re: [GHC] #3108: Do a better job of solving recursive type-class constraints with functional dependencies

2012-04-11 Thread GHC
#3108: Do a better job of solving recursive type-class constraints with functional dependencies +--- Reporter: simonpj| Owner: Type: bug

Re: [GHC] #3108: Do a better job of solving recursive type-class constraints with functional dependencies

2012-04-05 Thread GHC
#3108: Do a better job of solving recursive type-class constraints with functional dependencies +--- Reporter: simonpj | Owner: Type: bug

Re: [GHC] #3108: Do a better job of solving recursive type-class constraints with functional dependencies

2012-04-05 Thread GHC
#3108: Do a better job of solving recursive type-class constraints with functional dependencies +--- Reporter: simonpj | Owner: Type: bug

Re: [GHC] #5736: Possible regression with functional dependencies

2012-01-02 Thread GHC
#5736: Possible regression with functional dependencies --+- Reporter: magnus | Owner: Type: bug | Status: closed Priority

[GHC] #5736: Possible regression with functional dependencies

2011-12-31 Thread GHC
#5736: Possible regression with functional dependencies --+- Reporter: magnus| Owner: Type: bug | Status: new Priority: normal

Re: [GHC] #5736: Possible regression with functional dependencies

2011-12-31 Thread GHC
#5736: Possible regression with functional dependencies --+- Reporter: magnus | Owner: Type: bug | Status: closed Priority

Re: [GHC] #5236: Circular functional dependencies cause loop in typechecker

2011-06-09 Thread GHC
#5236: Circular functional dependencies cause loop in typechecker --+- Reporter: dimitris | Owner: Type: bug | Status: closed

[GHC] #5236: Circular functional dependencies cause loop in typechecker

2011-06-02 Thread GHC
#5236: Circular functional dependencies cause loop in typechecker -+-- Reporter: dimitris | Owner: Type: bug | Status: new

Re: [Haskell-cafe] Functional dependencies and Peano numbers (and hoogle-bug?)

2011-05-03 Thread Neil Mitchell
Hi Oscar, Sorry for the seriously late reply. I only just found this message in the bottom of my inbox: On an unrelated note: I hoogled to (i.e. http://haskell.org/hoogle/?hoogle=to) and just got a blank page. Nothing. Nil (not even html.../html). Is this a bug or a feature? :) It was a

Re: [Haskell-cafe] Could not deduce ... using functional dependencies with GHC7

2011-03-18 Thread Dimitrios Vytiniotis
Of JP Moresmau Sent: 16 March 2011 21:46 To: Haskell Cafe Subject: [Haskell-cafe] Could not deduce ... using functional dependencies with GHC7 Hello, when moving to GHC7 a body of code that I'm not immensely familiar with, I got an error compiling with GHC 7.0.2. Can somebody kindly explain to me

Re: [Haskell-cafe] Could not deduce ... using functional dependencies with GHC7

2011-03-18 Thread JP Moresmau
[mailto:haskell-cafe-boun...@haskell.org] On Behalf Of JP Moresmau Sent: 16 March 2011 21:46 To: Haskell Cafe Subject: [Haskell-cafe] Could not deduce ... using functional dependencies with GHC7 Hello, when moving to GHC7 a body of code that I'm not immensely familiar with, I got an error

Re: [Haskell-cafe] Could not deduce ... using functional dependencies with GHC7

2011-03-18 Thread Sean Leather
On Fri, Mar 18, 2011 at 13:35, JP Moresmau wrote: These are GHC types, but here is a self-contained example: {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances #-} data Id=Id String data Result id =ResultId Id | ResultGen id data Sig id=IdSig Id |

Re: [Haskell-cafe] Could not deduce ... using functional dependencies with GHC7

2011-03-18 Thread Daniel Fischer
On Friday 18 March 2011 13:35:22, JP Moresmau wrote: These are GHC types, but here is a self-contained example: {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances #-} data Id=Id String data Result id =ResultId Id | ResultGen id data Sig id=IdSig Id

Re: [Haskell-cafe] Could not deduce ... using functional dependencies with GHC7

2011-03-18 Thread JP Moresmau
Thanks to you all, I think I understand better. instance Search Id Id where search _ _ i = only (FoundId i) Is too restrictive on the first type, so declaring instead: instance Search id Id where search _ _ i = only (FoundId i) Fixed the issue!! Now the initial id is not Id and everybody is

Re: [Haskell-cafe] Could not deduce ... using functional dependencies with GHC7

2011-03-18 Thread Daniel Fischer
On Friday 18 March 2011 14:40:40, JP Moresmau wrote: Thanks to you all, I think I understand better. instance Search Id Id where search _ _ i = only (FoundId i) Is too restrictive on the first type, so declaring instead: instance Search id Id where search _ _ i = only (FoundId i) Not

Re: [Haskell-cafe] Could not deduce ... using functional dependencies with GHC7

2011-03-18 Thread Iavor Diatchki
Hi, that's a bug in GHC---it erroneously accepts polymorphic instances which violate the FD of a class. -Iavor On Fri, Mar 18, 2011 at 7:08 AM, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: On Friday 18 March 2011 14:40:40, JP Moresmau wrote: Thanks to you all, I think I understand

[Haskell-cafe] Could not deduce ... using functional dependencies with GHC7

2011-03-16 Thread JP Moresmau
by the instance declaration at lib\Scion\Inspect\Find.hs:477:18 When using functional dependencies to combine Search Id Id, arising from the dependency `a - id' in the instance declaration at lib\Scion\Inspect\Find.hs:183:10 Search id Id, arising from a use of `search

Re: [GHC] #4401: Functional dependencies regression

2010-10-21 Thread GHC
#4401: Functional dependencies regression ---+ Reporter: rl| Owner: simonpj Type: bug | Status: closed Priority: highest | Milestone: 7.0.1

Re: [GHC] #4401: Functional dependencies regression

2010-10-21 Thread GHC
#4401: Functional dependencies regression ---+ Reporter: rl| Owner: simonpj Type: bug | Status: merge Priority: highest | Milestone: 7.0.1

Re: [GHC] #4401: Functional dependencies regression

2010-10-21 Thread GHC
#4401: Functional dependencies regression ---+ Reporter: rl| Owner: simonpj Type: bug | Status: closed Priority: highest | Milestone: 7.0.1

Re: [GHC] #4418: Superclass functional dependencies are ignored during instance selection

2010-10-21 Thread GHC
#4418: Superclass functional dependencies are ignored during instance selection -+-- Reporter: reinerp | Owner: Type: bug

Re: [GHC] #4401: Functional dependencies regression

2010-10-21 Thread GHC
#4401: Functional dependencies regression ---+ Reporter: rl| Owner: simonpj Type: bug | Status: closed Priority: highest | Milestone: 7.0.1

Re: [GHC] #4401: Functional dependencies regression

2010-10-21 Thread GHC
#4401: Functional dependencies regression ---+ Reporter: rl| Owner: simonpj Type: bug | Status: closed Priority: highest | Milestone: 7.0.1

Re: [GHC] #4418: Superclass functional dependencies are ignored during instance selection

2010-10-20 Thread GHC
#4418: Superclass functional dependencies are ignored during instance selection +--- Reporter: reinerp |Owner: Type: bug

Re: [GHC] #4418: Superclass functional dependencies are ignored during instance selection

2010-10-20 Thread GHC
#4418: Superclass functional dependencies are ignored during instance selection +--- Reporter: reinerp |Owner: Type: bug

Re: [GHC] #4401: Functional dependencies regression

2010-10-19 Thread GHC
#4401: Functional dependencies regression ---+ Reporter: rl| Owner: simonpj Type: bug | Status: closed Priority: highest | Milestone: 7.0.1

[GHC] #4418: Superclass functional dependencies are ignored during instance selection

2010-10-19 Thread GHC
#4418: Superclass functional dependencies are ignored during instance selection -+-- Reporter: reinerp | Owner: Type: bug | Status: new

Re: [GHC] #4401: Functional dependencies regression

2010-10-16 Thread GHC
#4401: Functional dependencies regression -+-- Reporter: rl|Owner: simonpj Type: bug | Status: new Priority: highest |Milestone

[GHC] #4401: Functional dependencies regression

2010-10-15 Thread GHC
#4401: Functional dependencies regression -+-- Reporter: rl| Owner: Type: bug | Status: new Priority: normal| Component

Re: [GHC] #4401: Functional dependencies regression

2010-10-15 Thread GHC
#4401: Functional dependencies regression -+-- Reporter: rl|Owner: simonpj Type: bug | Status: new Priority: highest |Milestone

Re: [GHC] #2296: Functional dependencies error message has no position information

2010-09-16 Thread GHC
#2296: Functional dependencies error message has no position information ---+ Reporter: NeilMitchell | Owner: simonpj Type: bug | Status: closed Priority: high

Re: [GHC] #2296: Functional dependencies error message has no position information

2010-09-06 Thread GHC
#2296: Functional dependencies error message has no position information -+-- Reporter: NeilMitchell |Owner: simonpj Type: bug | Status: new Priority: high

Re: [GHC] #2296: Functional dependencies error message has no position information

2010-08-06 Thread GHC
#2296: Functional dependencies error message has no position information -+-- Reporter: NeilMitchell |Owner: Type: bug | Status: new Priority: high

Re: [Haskell-cafe] Re: Functional dependencies and Peano numbers (and hoogle-bug?)

2010-07-15 Thread Oscar Finnsson
Thanks for the great feedback. The bijective example was especially interesting. While reading Fun with Type Functions I notices GNum as an interesting alternative to the Num type class but I couldn't find any such package on hackagedb. Do anyone know if there is anything like GNum on hackagedb?

Re: [Haskell-cafe] Re: Functional dependencies and Peano numbers (and hoogle-bug?)

2010-07-15 Thread wren ng thornton
Oscar Finnsson wrote: Anyone made a module/package that solves this problem already? I cannot be the first that needs generic type safe conversion... . There's a restricted version in logfloat:Data.Numer.RealToFrac[1] which generalizes the Prelude's realToFrac to improve performance and

Re: [Haskell-cafe] Re: Functional dependencies and Peano numbers

2010-07-13 Thread Brent Yorgey
On Sun, Jul 11, 2010 at 12:43:47AM +0200, Jose A. Ortega Ruiz wrote: On Sat, Jul 10 2010, wren ng thornton wrote: [...] Yes, you can add multiple dependencies. The syntax is to use , after the first |. While having eight parameters is surely a desperate need for refactoring,

[Haskell-cafe] Re: Functional dependencies and Peano numbers

2010-07-10 Thread Jose A. Ortega Ruiz
On Sat, Jul 10 2010, wren ng thornton wrote: [...] Yes, you can add multiple dependencies. The syntax is to use , after the first |. While having eight parameters is surely a desperate need for refactoring, there are times when you'd want multiple dependencies. For example, you can say

Re: [Haskell-cafe] Functional dependencies and Peano numbers

2010-07-09 Thread wren ng thornton
Brandon S Allbery KF8NH wrote: On 7/6/10 15:37 , Oscar Finnsson wrote: but can they also be on a form similar to a b c d e f g h| b c - d e f | b d g - h (i.e. d,e,f are decided by the b,c-combination while h is decided by the b,d,g-combination)? I think the answer to this is yes, but if

[Haskell-cafe] Functional dependencies and Peano numbers

2010-07-06 Thread Oscar Finnsson
Hi, there is a lot of buzz around functional dependencies on the mailing list and Planet Haskell. I've read some of the tutorials and I think I understand how they work but I still haven't figured out where they can be useful. * Can someone give me a real world (preferably hackagedb) example

Re: [Haskell-cafe] Functional dependencies and Peano numbers

2010-07-06 Thread TIMOTHY MICHAEL CARSTENS
, so it's possible some of the comments are slightly off :/ It uses type families instead of functional dependencies. Anecdotally, my experience has been that functional dependencies are much faster. You might find that it takes ghci a good deal of time to load this file; type checking

Re: [Haskell-cafe] Functional dependencies and Peano numbers

2010-07-06 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 7/6/10 15:37 , Oscar Finnsson wrote: but can they also be on a form similar to a b c d e f g h| b c - d e f | b d g - h (i.e. d,e,f are decided by the b,c-combination while h is decided by the b,d,g-combination)? I think the answer to

[Haskell-cafe] functional dependencies question

2010-07-01 Thread Patrick Browne
Hi, My understanding of functional dependencies is that they can be used to ensure that one type depends on another type. For example, the type of location depends could on the type of the object at that location. Consider two models 1) The location of an aircraft landing should have location

Re: [Haskell-cafe] functional dependencies question

2010-07-01 Thread Neil Brown
On 01/07/10 12:37, Patrick Browne wrote: Why do some cases such as 1) fail to run even if they are the only instantiation. -- 1) Compiles but does not run instance LocatedAt Int String where spatialLocation(1)=home That instance is fine. I presume the problem is that you are trying

Re: [Haskell-cafe] functional dependencies question

2010-07-01 Thread Patrick Browne
Neil, Does the following sum up the situation? The class Num has subclasses containing various numeric types and the literal 1 is a value for one or more of those types. Hence the Haskell compiler says the instance 1) is OK. But at run time, without the quantified (1:Int), the 1 could of more than

Re: [Haskell-cafe] functional dependencies question

2010-07-01 Thread Ketil Malde
Patrick Browne patrick.bro...@dit.ie writes: Why do some cases such as 1) fail to run even if they are the only instantiation. I think this is because literal numbers are polymorphic, i.e. a '1' in your source code is shorthand for 'fromIntegral 1', which is a type of Num a = a. Thus,

Re: [Haskell-cafe] functional dependencies question

2010-07-01 Thread Miguel Mitrofanov
The class Num has subclasses containing various numeric types and the literal 1 is a value for one or more of those types. Well, the problem is not with subclasses, but with types. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] functional dependencies question

2010-07-01 Thread Neil Brown
this is at compile-time, not run-time. The problem comes down to needing to know a specific type in order to pick a type-class instance -- the functional dependencies are actually irrelevant to this aspect. Let's say I have this simpler class: class Big a where isBig :: a - Bool instance Big Int

Re: [GHC] #2296: Functional dependencies error message has no position information

2010-06-24 Thread GHC
#2296: Functional dependencies error message has no position information -+-- Reporter: NeilMitchell |Owner: Type: bug | Status: new Priority: high

Re: [GHC] #2296: Functional dependencies error message has no position information

2010-06-24 Thread GHC
#2296: Functional dependencies error message has no position information -+-- Reporter: NeilMitchell |Owner: Type: bug | Status: new Priority: high

Re: [Haskell-cafe] Type families vs. functional dependencies -- how to express something

2010-05-24 Thread Ryan Ingram
2010/5/18 Tomáš Janoušek t...@nomi.cz: Hello all, for the past few hours I've been struggling to express a certain idea using type families and I really can't get it to typecheck. It all works fine using functional dependencies, but it could be more readable with TFs. From those papers

Re: [Haskell-cafe] Type families vs. functional dependencies -- how to express something

2010-05-21 Thread Tomáš Janoušek
think I'll just stay with functional dependencies this time, a data type with wrapping and unwrapping can't possibly make the code more readable :-). Regards, -- Tomáš Janoušek, a.k.a. Liskni_si, http://work.lisk.in/ ___ Haskell-Cafe mailing list Haskell

[Haskell-cafe] Type families vs. functional dependencies -- how to express something

2010-05-18 Thread Tomáš Janoušek
Hello all, for the past few hours I've been struggling to express a certain idea using type families and I really can't get it to typecheck. It all works fine using functional dependencies, but it could be more readable with TFs. From those papers about TFs I got this feeling that they should

Re: [Haskell-cafe] Type families vs. functional dependencies -- how to express something

2010-05-18 Thread Dan Weston
using type families and I really can't get it to typecheck. It all works fine using functional dependencies, but it could be more readable with TFs. From those papers about TFs I got this feeling that they should be as expressive as FDs, and we should use them (some people even occasionally mentioning

[Haskell-cafe] Re: Functional Dependencies Help

2010-05-01 Thread John Creighton
On Apr 30, 6:18 pm, John Creighton johns2...@gmail.com wrote: On Apr 29, 7:47 am, John Creighton johns2...@gmail.com wrote: I've been trying to apply some stuff I learned about functional dependencies, but I run into one of two problems. I either end up with inconsistent dependencies

[Haskell-cafe] Re: Functional Dependencies Help

2010-04-30 Thread John Creighton
On Apr 29, 7:47 am, John Creighton johns2...@gmail.com wrote: I've been trying to apply some stuff I learned about functional dependencies, but I run into one of two problems. I either end up with inconsistent dependencies (OverlappingInstances doesn't seem to apply) or I end up

[Haskell-cafe] Functional Dependencies Help

2010-04-29 Thread John Creighton
I've been trying to apply some stuff I learned about functional dependencies, but I run into one of two problems. I either end up with inconsistent dependencies (OverlappingInstances doesn't seem to apply) or I end up with infinite recursion. I want to be able to do simple things like

Re: [Haskell-cafe] Functional Dependencies conflicts

2010-04-19 Thread Limestraël
It seems like a reasonable and not-too-painful solution, thanks! Concerning Haskell typesystem, I know it to be beautiful, but also kind of complex. One of the great Haskell assets is genericity, but this complexity sometimes encumbers this genericity. But still, Haskell is -- in terms of

Re: [Haskell-cafe] Functional Dependencies conflicts

2010-04-18 Thread Limestraël
There must be some kind of a private joke I don't get... BTW, all you've said is pretty scaring... It's strange I can't declare a generic instance for Binary types... I thought I was trying to do something quite common in Haskell. Apparently I'm still a young padawan with many things to learn.

Re: [Haskell-cafe] Functional Dependencies conflicts

2010-04-18 Thread Sebastian Fischer
On Apr 18, 2010, at 11:01 AM, Limestraël wrote: It's strange I can't declare a generic instance for Binary types... I thought I was trying to do something quite common in Haskell. A common workaround is to define a newtype like this newtype GenericBinary a = GB { fromGB :: a } and an

Re: [Haskell-cafe] Functional Dependencies conflicts

2010-04-18 Thread Casey McCann
of the type class system--namely, the awkwardness of functional dependencies. Unfortunately, type families don't really help on the how to write generic but not completely general instances right now, and in fact are incompatible with overlapping instances, making some things impossible! I think

[Haskell-cafe] Functional Dependencies conflicts

2010-04-17 Thread Limestraël
that we may find the object from its identifier. Well, here comes the trouble: GameStructs.hs:16:9: Functional dependencies conflict between instance declarations: instance (Binary a) = Binarizable a a -- Defined at MagBots/GameStructs.hs:16:9-37 instance Binarizable

Re: [Haskell-cafe] Functional Dependencies conflicts

2010-04-17 Thread Daniel Fischer
Am Samstag 17 April 2010 19:14:02 schrieb Limestraël: Hello, Well, here comes the trouble: GameStructs.hs:16:9: Functional dependencies conflict between instance declarations: instance (Binary a) = Binarizable a a -- Defined at MagBots/GameStructs.hs:16:9-37

Re: [Haskell-cafe] Functional Dependencies conflicts

2010-04-17 Thread Limestraël
to automatically define a Binary as an instance of Binarizable. 2010/4/17 Daniel Fischer daniel.is.fisc...@web.de Am Samstag 17 April 2010 19:14:02 schrieb Limestraël: Hello, Well, here comes the trouble: GameStructs.hs:16:9: Functional dependencies conflict between instance declarations

Re: [Haskell-cafe] Functional Dependencies conflicts

2010-04-17 Thread Daniel Fischer
and functional dependencies don't work as one would naively expect. And for GameObject, the sole matching type is String. In other words, GameObject implies String. I would have undestood the error if GameObject was also an instance of Binary (then the two instances would match), but it's

Re: [Haskell-cafe] Functional Dependencies conflicts

2010-04-17 Thread Casey McCann
On Sat, Apr 17, 2010 at 4:01 PM, Limestraël limestr...@gmail.com wrote: I would have undestood the error if GameObject was also an instance of Binary (then the two instances would match), but it's not the case... As Daniel Fischer has mentioned, presumably a Binary instance could later be

Re: [Haskell-cafe] Functional Dependencies conflicts

2010-04-17 Thread Limestraël
Ok, so I am heading to a headache... Daniel Fischer mentioned a solution using Type Families. As I read, those are meant to replace the FunDeps, I will try this solution... 2010/4/17 Casey McCann syntaxgli...@gmail.com On Sat, Apr 17, 2010 at 4:01 PM, Limestraël limestr...@gmail.com wrote: I

  1   2   3   4   >