Re: [Haskell-cafe] "first class" tuples?

2009-02-17 Thread John Meacham
On Tue, Feb 17, 2009 at 03:36:34PM +0100, Wolfgang Jeltsch wrote: > These declarations can even be found in some Haddock documentation. So at > least GHC has an upper bound on tuple size although the Haskell Report states > that there isn’t one. Actually, the report says implementations need on

Re: [Haskell-cafe] C-like Haskell

2009-02-17 Thread John Meacham
On Wed, Jan 28, 2009 at 04:42:49PM -0800, drblanco wrote: > Here's my attempt, which takes about 75s for r=10^8. > > circ2 r = (1+4*r) + 4 * (circ2' (rs+1) r 1 0) > where > rs = r^2 > circ2' rad x y sum > | x | rad<=rs = circ2' (rad

Re: [Haskell-cafe] Haskell.org GSoC

2009-02-17 Thread Sterling Clover
Something that hit me tonight: Last GSoC gave us GHC compiler plugins. We have examples, but no documented significant uses, suitable for production code. Plugins, in essence, as I understand them, let us extend the type system in useful ways. Haskell has libraries for units[1], but no ligh

Re: [Haskell-cafe] ANN: The Typeclassopedia, and request for feedback

2009-02-17 Thread Adam Vogt
* On Monday, February 16 2009, Andrew Coppin wrote: > I do have one little question. Let me see if I can find the quote... Ah, > here we go: > > "The WrappedMonad and WrappedArrow constructors witness the fact that > any Monad and any Arrow can be made into an Applicative." > > I don't really

Re: [Haskell-cafe] Re: Bug in Cabal?

2009-02-17 Thread Andrea Vezzosi
On Tue, Feb 17, 2009 at 11:50 PM, Achim Schneider wrote: > Martin Huschenbett wrote: > >> $ cabal install ghci-haskeline >> Resolving dependencies... >> cabal.exe: dependencies conflict: ghc-6.10.1 requires process >> ==1.0.1.1 however >> process-1.0.1.1 was excluded because ghc-6.10.1 requires p

[Haskell-cafe] Postdoctoral Research Position at Yale University

2009-02-17 Thread Paul Hudak
Postdoctoral Research Position at Yale University The Nettle Project in the Computer Science Department at Yale University seeks applicants for a one-year (minimum) postdoctoral research position. The successful candidate will apply modern, high-level programming language ideas (such as embodied

Re: [Haskell-cafe] question on types

2009-02-17 Thread Luke Palmer
2009/2/17 Daryoush Mehrtash > Is there a way to define a type with qualification on top of existing type > (e.g. prime numbers)? Say for example I want to define a computation that > takes a prime number and generates a string. Is there any way I can do > that in Haskell? You can by provid

[Haskell-cafe] question on types

2009-02-17 Thread Daryoush Mehrtash
Is there a way to define a type with qualification on top of existing type (e.g. prime numbers)? Say for example I want to define a computation that takes a prime number and generates a string. Is there any way I can do that in Haskell? thanks, Daryoush __

Re: [Haskell-cafe] Re: forall & ST monad

2009-02-17 Thread Dan Doel
On Tuesday 17 February 2009 5:27:45 pm Ryan Ingram wrote: > On Tue, Feb 17, 2009 at 5:22 AM, Dan Doel wrote: > > -- fail: inferred type less polymorphic than expected > > -- This seems like it could perhaps work, since E'' > > -- re-hides the 'a' but it doesn't, probably because there's > > -- no

[Haskell-cafe] Re: Bug in Cabal?

2009-02-17 Thread Achim Schneider
Martin Huschenbett wrote: > $ cabal install ghci-haskeline > Resolving dependencies... > cabal.exe: dependencies conflict: ghc-6.10.1 requires process > ==1.0.1.1 however > process-1.0.1.1 was excluded because ghc-6.10.1 requires process > ==1.0.1.0 > cabal uninstall process-1.0.1.1 is what you

Re: [Haskell-cafe] Re: forall & ST monad

2009-02-17 Thread Ryan Ingram
On Tue, Feb 17, 2009 at 5:22 AM, Dan Doel wrote: > -- fail: inferred type less polymorphic than expected > -- This seems like it could perhaps work, since E'' > -- re-hides the 'a' but it doesn't, probably because there's > -- no way to type the enclosed lambda expression properly. > -- You'd prob

[Haskell-cafe] Bug in Cabal?

2009-02-17 Thread Martin Huschenbett
Hello haskell-cafe, trying to install ghci-haskeline I got the following error message: $ cabal install ghci-haskeline Resolving dependencies... cabal.exe: dependencies conflict: ghc-6.10.1 requires process ==1.0.1.1 however process-1.0.1.1 was excluded because ghc-6.10.1 requires process ==1.0

Re: [Haskell-cafe] Polymorphism overhead

2009-02-17 Thread Don Stewart
wasserman.louis: > I have (roughly) the following code: > > data Foo e > type MFoo e = Maybe (Foo e) > > instance Ord e => Monoid (Foo e) where > f1 `mappend` f2 = > > I'd expect this to optimize to the same thing as if I had implemented: > meld :: Ord e => Foo e -> Foo e -> Foo e > f1 `meld` f

[Haskell-cafe] Polymorphism overhead

2009-02-17 Thread Louis Wasserman
I have (roughly) the following code: data Foo e type MFoo e = Maybe (Foo e) instance Ord e => Monoid (Foo e) where f1 `mappend` f2 = I'd expect this to optimize to the same thing as if I had implemented: meld :: Ord e => Foo e -> Foo e -> Foo e f1 `meld` f2 = -- code invoking meld' meld' :: Or

[Haskell-cafe] garbage collector woes

2009-02-17 Thread Chris Waterson
I'm at wits end with respect to GHC's garbage collector and would very much appreciate a code review of my MySQL driver for HDBC, which is here: In particular, the problem that I'm having is that my "stateme

Re: [Haskell-cafe] Haskell.org GSoC

2009-02-17 Thread Martijn van Steenbergen
Wolfgang Jeltsch wrote: * making Applicative a superclass of Monad * getting rid of MonadPlus (use (Alternative m, Monad m) instead of (MonadPlus m) or, with another extension, even something like (forall a. Monoid (m a), Monad m)) * getting rid of ugly Monoid method names (

Re: [Haskell-cafe] ANN: The Typeclassopedia, and request for feedback

2009-02-17 Thread Andrew Coppin
Brent Yorgey wrote: My hope is that this will be a valuable resource to the Haskell community, especially those who are learning. Any feedback would be greatly appreciated, especially if it helps improve the article before publication. A draft can be found here Excellent work. I like the way

Re: [Haskell-cafe] Interactive debugging?

2009-02-17 Thread Andrew Coppin
Colin Paul Adams wrote: Can this be done with Haskell? In particular, I'm using ghc 6.10.1. Check out the GHC user guide, section 3.5 tells you how to operate GHCi's built-in source-level debugger. Can I get symbols for use with gdb, for instance? You *can*... but don't. Unless you

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: first Grapefruit release

2009-02-17 Thread Jamie
On Tue, 17 Feb 2009, Wolfgang Jeltsch wrote: Am Dienstag, 17. Februar 2009 17:18 schrieben Sie: I'm glad that FRP isn't still alive and kicking. You are glad that FRP is *not* alive? Okay, this was a typo, wasn’t it? ;-) I hope you will support wxHAskell in the near future. I tried wxFrui

[Haskell-cafe] Re: [Haskell] ANNOUNCE: first Grapefruit release

2009-02-17 Thread Wolfgang Jeltsch
Am Dienstag, 17. Februar 2009 17:18 schrieben Sie: > I'm glad that FRP isn't still alive and kicking. You are glad that FRP is *not* alive? Okay, this was a typo, wasn’t it? ;-) > I hope you will support wxHAskell in the near future. I tried wxFruit and I > liked it, but it isn't complete and it

Re: [Haskell-cafe] ANN: The Typeclassopedia, and request for feedback

2009-02-17 Thread Roman Cheplyaka
* Wolfgang Jeltsch [2009-02-17 13:30:22+0100] > Am Dienstag, 17. Februar 2009 00:32 schrieb George Pollard: > > On Mon, 2009-02-16 at 15:30 +0100, Fraser Wilson wrote: > > > Super! Also, best definition of bottom I've yet seen -- "ignoring _| > > > _, which is a party pooper". Like good code, it

[Haskell-cafe] Re: permuting a list

2009-02-17 Thread Okasaki, C. DR EECS
The discussion of randomly permuting a list comes up every few years. Here's what I wrote last time (2005): "Clearly, you can do a perfect shuffle in O(N) time using mutable arrays, using the standard imperative algorithm. You can also do it in O(N) expected time using *immutable* arrays, using

[Haskell-cafe] Haskell Weekly News: Issue 105 - February 17, 2009

2009-02-17 Thread Brent Yorgey
--- Haskell Weekly News http://sequence.complete.org/hwn/20090217 Issue 105 - February 17, 2009 --- Welcome to issue 105 of HWN, a newsletter covering

[Haskell-cafe] Re: [Haskell] ANNOUNCE: first Grapefruit release

2009-02-17 Thread Henk-Jan van Tuyl
On Sat, 14 Feb 2009 17:19:09 +0100, Wolfgang Jeltsch wrote: If you have questions, applause or criticism, please get in touch with me. Wolfgang Jeltsch Principal Grapefruit developer I'm glad that FRP isn't still alive and kicking. I hope you will support wxHAskell in the near future.

[Haskell-cafe] package for algebraic structures

2009-02-17 Thread Wolfgang Jeltsch
Hello, for Grapefruit’s incremental list signal support, I needed a type class of semigroups. A semigroup is similar to a monoid. The difference is that a semigroup doesn’t need to have a neutral element. So a semigroup type class would make a perfect superclass of Monoid, by the way. Since a

Re: [Haskell-cafe] "first class" tuples?

2009-02-17 Thread Wolfgang Jeltsch
Am Dienstag, 17. Februar 2009 14:42 schrieb Peter Verswyvelen: > Tuples in Haskell always have annoyed me a bit since each tuple of > different dimension is hardcoded You are not alone with this. Several people have complained about this in the past. > (I guess compilers enforce a maximum dimens

Re: [Haskell-cafe] "first class" tuples?

2009-02-17 Thread Lennart Augustsson
Look at the HList stuff by Oleg and others and you'll find the kind of tuples you suggest. 2009/2/17 Peter Verswyvelen : > Tuples in Haskell always have annoyed me a bit since each tuple of different > dimension is hardcoded (I guess compilers enforce a maximum dimension on > tuples?) > Since a tu

[Haskell-cafe] "first class" tuples?

2009-02-17 Thread Peter Verswyvelen
Tuples in Haskell always have annoyed me a bit since each tuple of different dimension is hardcoded (I guess compilers enforce a maximum dimension on tuples?) Since a tuple represents a fixed size data structure with different types at each coordinate, it feels as it should be possible to have a co

[Haskell-cafe] Re: StableFunPtr?

2009-02-17 Thread Neal Alexander
Maurí­cio wrote: Hi, I've seen that if I'm going to leave a pointer to data in the hands of foreign code, I should use StablePtr so that the value it points to doesn't change. However, we also usually give FunPtr to foreign code, like when registering callbacks, but I can't found any kind of "S

Re: [Haskell-cafe] Re: forall & ST monad

2009-02-17 Thread Dan Doel
On Tuesday 17 February 2009 7:28:18 am Heinrich Apfelmus wrote: > Wolfgang Jeltsch wrote: > > First, I thought so too but I changed my mind. To my knowledge a type > > (forall a. T[a]) -> T' is equivalent to the type exists a. (T[a] -> T'). > > It’s the same as in predicate logic – Curry-Howard in

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: first Grapefruit release

2009-02-17 Thread Wolfgang Jeltsch
Am Montag, 16. Februar 2009 22:04 schrieben Sie: > As for how I want Hieroglyph to work interactively, I think the easiest way > is to react to the input data considered as a coherent whole. The semantic > model for visualization is that a Visualization is a function from Data to > Visual. Hmm, d

Re: [Haskell-cafe] ANNOUNCE: first Grapefruit release

2009-02-17 Thread Wolfgang Jeltsch
Am Montag, 16. Februar 2009 22:43 schrieben Sie: > * Wolfgang Jeltsch [2009-02-16 14:51:18+0100] > > > Maybe there is someone interested in helping me with the graphics > > support? There is already quite some stuff implemented (thanks to > > Matthias Reisner), it’s just that this is based on the

Re: [Haskell-cafe] Looping after compiling with cabal

2009-02-17 Thread Wolfgang Jeltsch
Am Montag, 16. Februar 2009 21:33 schrieb Henk-Jan van Tuyl: > On Mon, 16 Feb 2009 14:56:01 +0100, Wolfgang Jeltsch > > wrote: > > Am Montag, 16. Februar 2009 13:07 schrieb Neil Mitchell: > >> Hi Henk-Jan, > >> > >> I believe cabal adds a -O on the command line, perhaps try ghc --make > >> -O (aft

Re: [Haskell-cafe] Re: [Haskell] ANN: The Typeclassopedia, and request for feedback

2009-02-17 Thread Wolfgang Jeltsch
Am Dienstag, 17. Februar 2009 03:42 schrieb Isaac Dupree: > I'm really confused that when I replied (not reply-to-all, not > reply-to-list, just reply) to that message, it went to the lists and not to > you Brent! (KMail 1.10.3) -- so I totally edited the "To" lines, to send > this message... Isn’

Re: [Haskell-cafe] ANN: The Typeclassopedia, and request for feedback

2009-02-17 Thread Wolfgang Jeltsch
Am Dienstag, 17. Februar 2009 00:32 schrieb George Pollard: > On Mon, 2009-02-16 at 15:30 +0100, Fraser Wilson wrote: > > Super! Also, best definition of bottom I've yet seen -- "ignoring _| > > _, which is a party pooper". Like good code, it's short, to the > > point, and obviously correct. > >

[Haskell-cafe] Re: forall & ST monad

2009-02-17 Thread Heinrich Apfelmus
Wolfgang Jeltsch wrote: > First, I thought so too but I changed my mind. To my knowledge a type > (forall a. T[a]) -> T' is equivalent to the type exists a. (T[a] -> T'). It’s > the same as in predicate logic – Curry-Howard in action. The connection is the other way round, I think. (exists a

Re: [Haskell-cafe] Haskell.org GSoC

2009-02-17 Thread Wolfgang Jeltsch
Am Dienstag, 17. Februar 2009 01:13 schrieb Martijn van Steenbergen: > Daniel Kraft wrote: > > Do you think something would be especially nice to have and is currently > > missing? > > Have type class aliases been implemented yet? This proposal (or parts or > it) seems like a very useful compiler

[Haskell-cafe] Re: StableFunPtr?

2009-02-17 Thread Neal Alexander
Maurí­cio wrote: Hi, I've seen that if I'm going to leave a pointer to data in the hands of foreign code, I should use StablePtr so that the value it points to doesn't change. However, we also usually give FunPtr to foreign code, like when registering callbacks, but I can't found any kind of "S

Re: [Haskell-cafe] Functional GUIs again

2009-02-17 Thread Fraser Wilson
The current darcs version now mentions the 0.9.13 dependency. I don't see a nice way of supporting both 0.9.13 and 0.10.0, so I'll take the plunge and do a destructive upgrade. As you say, the new model/view is much nicer (and of course I shall be stealing liberally from it). cheers, Fraser. On

Re: [Haskell-cafe] StableFunPtr?

2009-02-17 Thread Felipe Lessa
On Tue, Feb 17, 2009 at 7:07 AM, Maurí­cio wrote: > Are all FunPtrs stable? Yes, because you are forced to call freeHaskellFunPtr when you don't need them anymore. -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.or

Re: [Haskell-cafe] Functional GUIs again

2009-02-17 Thread Peter Verswyvelen
Okay, you used 0.9.13, that explains the errors yes, the model/view thing is different in 0.10.0 (better IMHO) Yes it would be nice if it worked with GTK2HS 0.10.0, but it might be tricky to support both version, I don't know. On Tue, Feb 17, 2009 at 12:51 AM, Fraser Wilson wrote: > Hi Peter, > >

[Haskell-cafe] StableFunPtr?

2009-02-17 Thread Maurí­cio
Hi, I've seen that if I'm going to leave a pointer to data in the hands of foreign code, I should use StablePtr so that the value it points to doesn't change. However, we also usually give FunPtr to foreign code, like when registering callbacks, but I can't found any kind of "StableFunPtr". Are

Re: [Haskell-cafe] Does gtk2hs support VTE?

2009-02-17 Thread Duncan Coutts
On Tue, 2009-02-17 at 14:10 +0800, Magicloud Magiclouds wrote: > Hi, > I always see a file named vte something in "doc" folder, but I never > see vte in reference or source. > So I wonder if gtk2hs actually supports VTE. And I'd like to have > that supporting I started on binding it once.

Re: [Haskell-cafe] Gtk2HS 0.10.0 Released

2009-02-17 Thread Duncan Coutts
On Tue, 2009-02-17 at 08:47 +, Simon Marlow wrote: > Duncan Coutts wrote: > > Maybe. Dealing with linker scripts properly is probably rather tricky > > and we get it for free when we switch to shared libraries. > > I don't follow this last point - how does switching to shared libraries for >

Re: [Haskell-cafe] Gtk2HS 0.10.0 Released

2009-02-17 Thread Simon Marlow
Duncan Coutts wrote: On Thu, 2009-02-12 at 10:11 +0100, Christian Maeder wrote: Duncan Coutts wrote: On Wed, 2009-02-11 at 15:49 +0100, Lennart Augustsson wrote: Does this version work from ghci? -- Lennart Specifically I believe Lennart is asking about Windows. It's worked in ghci in Linu