[Haskell-cafe] GHC, names of inferred type variables

2008-09-27 Thread Shiqi Cao
Hi, Error messages from GHC contain inferred type variables, is there anyway to find out which term an inferred type variable is for(if the term exists)? Thanks, Shiqi ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] TH error

2008-09-27 Thread Anton van Straaten
Tim Newsham wrote: I'm goofing with TH and I have my program mostly done: http://hpaste.org/10713 If I have the $(deriveBinary ''MyData) line commented out it prints out what looks to me like correct code. I can even paste it into a program and it compiles. Pasting the text output can

[Haskell-cafe] Re: Red-Blue Stack

2008-09-27 Thread apfelmus
Josef Svenningsson wrote: Stephan Friedrichs wrote: My question is: Is there a case, where finding a persistent solution that performs equally well is *impossible* rather than just harder? I mean might there be a case where (forced) persistence (as we have in pure Haskell) is a definite

Re: [Haskell-cafe] Hmm, what license to use?

2008-09-27 Thread Magnus Therning
Wolfgang Jeltsch wrote: Am Freitag, 26. September 2008 09:24 schrieb Magnus Therning: Recently I received an email with a question regarding the licensing of a module I've written and uploaded to Hackage. I released it under LGPL. The sender wondered if I would consider re-licensing the

Re[2]: [Haskell-cafe] Hmm, what license to use?

2008-09-27 Thread Bulat Ziganshin
Hello Magnus, Saturday, September 27, 2008, 3:48:27 PM, you wrote: AFAIU you are saying that the linker is reaching into the module's .a file, pulling out the .o file, and then reaching into that .o file to pull out an individual function's ASM code. I believe that's a bit more than regular

Re: [Haskell-cafe] Red-Blue Stack

2008-09-27 Thread Thomas Davie
On 25 Sep 2008, at 06:11, Matthew Eastman wrote: Hey guys, This is probably more of a question about functional programming than it is about Haskell, but hopefully you can help me out. I'm new to thinking about things in a functional way so I'm not sure what the best way to do some

Re: [Haskell-cafe] The container problem

2008-09-27 Thread Andrew Coppin
David Menendez wrote: I wouldn't say that. It's important to remember that Haskell class Monad does not, and can not, represent *all* monads, only (strong) monads built on a functor from the category of Haskell types and functions to itself. Data.Set is a functor from the category of Haskell

Re: [Haskell-cafe] Red-Blue Stack

2008-09-27 Thread Matthew Eastman
Matthew Brecknell wrote: Matthew Eastman said: i.e. popping Blue in [Red, Red, Blue, Red, Blue] would give [Red, Red, Blue] Hmm, did you mean [Red,Blue] or [Red,Red,Red,Blue]? Judging by your implementation of remUseless, I'm guessing the latter. Yes, I meant the latter. Popping Blue in

Re: [Haskell-cafe] Red-Blue Stack

2008-09-27 Thread Thomas Davie
Thomas Davie wrote: In this interprettation, here's what I think is an O(1) implementation: ... rbPop :: Colour - RBStack a - RBStack a rbPop c Empty = error Empty Stack, can't pop rbPop c (More c' v asCs nextNonC) | c == c' = asCs | otherwise = rbPop c nextNonC ... Your pop doesn't

[Haskell-cafe] Re: Hmm, what license to use?

2008-09-27 Thread Simon Marlow
Magnus Therning wrote: Wolfgang Jeltsch wrote: Am Freitag, 26. September 2008 09:24 schrieb Magnus Therning: Recently I received an email with a question regarding the licensing of a module I've written and uploaded to Hackage. I released it under LGPL. The sender wondered if I would

Re: [Haskell-cafe] The container problem

2008-09-27 Thread Brandon S. Allbery KF8NH
On 2008 Sep 27, at 9:24, Andrew Coppin wrote: David Menendez wrote: I wouldn't say that. It's important to remember that Haskell class Monad does not, and can not, represent *all* monads, only (strong) monads built on a functor from the category of Haskell types and functions to itself.

Re: [Haskell-cafe] Re: Hmm, what license to use?

2008-09-27 Thread Brandon S. Allbery KF8NH
On 2008 Sep 27, at 11:59, Simon Marlow wrote: Magnus Therning wrote: Wolfgang Jeltsch wrote: Am Freitag, 26. September 2008 09:24 schrieb Magnus Therning: Recently I received an email with a question regarding the licensing of a module I've written and uploaded to Hackage. I released it

Re: [Haskell-cafe] The container problem

2008-09-27 Thread Brandon S. Allbery KF8NH
On 2008 Sep 27, at 12:41, Andrew Coppin wrote: I'm not sure how that qualifies set as not really a true monad anyway - but then, I don't know what a monad is, originally. I only know what it means in Haskell. I think you read him backwards: Map and Set are category-theory (true) monads,

Re: [Haskell-cafe] The container problem

2008-09-27 Thread Andrew Coppin
Brandon S. Allbery KF8NH wrote: On 2008 Sep 27, at 12:41, Andrew Coppin wrote: I'm not sure how that qualifies set as not really a true monad anyway - but then, I don't know what a monad is, originally. I only know what it means in Haskell. I think you read him backwards: Map and Set are

Re: [Haskell-cafe] The container problem

2008-09-27 Thread Andrew Coppin
Albert Y. C. Lai wrote: Andrew Coppin wrote: If I understand this correctly, to solve this problem you need either Functional Dependencies or Associated Types. Is that correct? A motivating example in papers on FD is exactly typeclasses for containers. Okasaki puts this into practice in the

Re: [Haskell-cafe] The container problem

2008-09-27 Thread Antoine Latter
On Sat, Sep 27, 2008 at 12:23 PM, Andrew Coppin [EMAIL PROTECTED] wrote: Can anybody actually demonstrate concretely how FDs and/or ATs would solve this problem? (I.e., enable you to write a class that any container can be a member of, despite constraints on the element types.) Sure! Using

Re: [Haskell-cafe] The container problem

2008-09-27 Thread Matthieu Sozeau
Le 27 sept. 08 à 15:24, Andrew Coppin a écrit : David Menendez wrote: I wouldn't say that. It's important to remember that Haskell class Monad does not, and can not, represent *all* monads, only (strong) monads built on a functor from the category of Haskell types and functions to itself.

Re[2]: [Haskell-cafe] The container problem

2008-09-27 Thread Bulat Ziganshin
Hello Andrew, Saturday, September 27, 2008, 9:23:47 PM, you wrote: Can anybody actually demonstrate concretely how FDs and/or ATs would solve this problem? (I.e., enable you to write a class that any container can be a member of, despite constraints on the element types.) you may find

[Haskell-cafe] Re: Red-Blue Stack

2008-09-27 Thread apfelmus
Thomas Davie wrote: Matthew Eastman wrote: The part of the assignment I'm working on is to implement a RedBlueStack, a stack where you can push items in as either Red or Blue. You can pop Red and Blue items individually, but the stack has to keep track of the overall order of items. i.e.

[Haskell-cafe] ATs [The container problem]

2008-09-27 Thread Andrew Coppin
Antoine Latter wrote: Sure! Using type-families: class Container c where type Elem c insert :: Elem c - c - c instance Container [a] where type Elem [a] = a insert = (:) instance Container ByteString where type Elem ByteString = Word8 insert =

[Haskell-cafe] FDs [The container problem]

2008-09-27 Thread Andrew Coppin
Bulat Ziganshin wrote: Hello Andrew, Saturday, September 27, 2008, 9:23:47 PM, you wrote: Can anybody actually demonstrate concretely how FDs and/or ATs would solve this problem? (I.e., enable you to write a class that any container can be a member of, despite constraints on the element

Re: [Haskell-cafe] Re: Red-Blue Stack

2008-09-27 Thread Thomas Davie
On 27 Sep 2008, at 20:16, apfelmus wrote: Thomas Davie wrote: Matthew Eastman wrote: The part of the assignment I'm working on is to implement a RedBlueStack, a stack where you can push items in as either Red or Blue. You can pop Red and Blue items individually, but the stack has to keep

[Haskell-cafe] TH code for deriving Binary and NFData instances

2008-09-27 Thread Tim Newsham
Here's some TH code for automatically deriving Data.Binary and Control.Parallel.Strategies.NFData instances: http://www.thenewsh.com/~newsham/store/DeriveBinary.hs Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list

[Haskell-cafe] Re: [Haskell] Symposium videos

2008-09-27 Thread Don Stewart
Malcolm.Wallace: Guerilla videos of the Haskell Symposium 2008 presentations. Enjoy. Now on haskell.org, http://haskell.org/haskellwiki/Video_presentations/Haskell_Symposium_2008 Great work Malcolm!! ___ Haskell-Cafe mailing list

[Haskell-cafe] Re: Haddock + Hoogle == Javadoc on steroids

2008-09-27 Thread Simon Michael
Taking this to haskell-cafe.. http://joyful.com/repos/darcs-sm/api-doc is a mashup of haddock, hoogle and hscolour (and darcsweb, darcs-graph - see http://joyful.com/repos). It's rough but quite useful - a few minutes here gave me a much better understanding of the big picture of darcs code. By

Re: [Haskell-cafe] The container problem

2008-09-27 Thread Ariel J. Birnbaum
I'm not actually bothered about every possible monad being representable as such in Haskell. I'd just like Set to work. ;-) What would work mean in this case? I see two different meanings: 1. Use monadic operations (mapM, guard) on Sets. How would you decide which operations are allowed and

Re: [Haskell-cafe] Re: Red-Blue Stack

2008-09-27 Thread jean verdier
I'm a haskell beginner so the following code might not meet haskell coding standards. I think that it is a correct O(1) implementation. Sorry if i simply recoded an already posted solution that i did not understand correctly. --- code - module Main where data Col a = Red a | Blue a

Re: [Haskell-cafe] TH code for deriving Binary and NFData instances

2008-09-27 Thread Tim Newsham
Here's some TH code for automatically deriving Data.Binary and Control.Parallel.Strategies.NFData instances: http://www.thenewsh.com/~newsham/store/DeriveBinary.hs Saizan pointed me to: http://www-users.cs.york.ac.uk/~ndm/derive/ which does most of what DeriveBinary.hs does (and lots