Re: [Haskell-cafe] bit of help with n-ary please...

2009-11-09 Thread Ketil Malde
Ketil Malde ke...@malde.org writes: data Tree a = Empty | Branch a [Tree a] What would the consequences be if you replaced your definition with this one? And, for extra credit, can you identify similar issues with this definition? Can you improve on it? -k -- If I haven't seen

Re: [Haskell-cafe] Area from [(x,y)] using foldl

2009-11-09 Thread Chaddaï Fouché
On Sun, Nov 8, 2009 at 10:30 PM, michael rice nowg...@yahoo.com wrote: This doesn't. area :: [(Double,Double)] - Double area p = abs $ (/2) $ area' (last p):p where area' [] = 0 area' ((x0,y0),(x,y):ps) = ((x0-x)*(y0+y)) + area' (x,y):ps This function is almost

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: control-monad-exception 0.5 with monadic call traces

2009-11-09 Thread Nicolas Pouillard
Excerpts from Michael Snoyman's message of Sat Nov 07 22:55:14 +0100 2009: On Sat, Nov 7, 2009 at 9:54 PM, Henning Thielemann lemm...@henning-thielemann.de wrote: On Sat, 7 Nov 2009, Jose Iborra wrote: Sorry for the confusion, I never meant that c-m-e can show stack traces for

Re: [Haskell-cafe] WinGHCi stuck in a loop

2009-11-09 Thread Pepe Gallardo
WinGHCi options are stored under HKEY_CURRENT_USER\Software\Haskell\WinGhciversion in the Windows registry. Cheers, Pepe 2009/11/7 Henk-Jan van Tuyl hjgt...@chello.nl L.S., I changed the options in WinGHCi and now WinGHCi is stuck in a loop each time I start it; how can I edit the options?

Re: [Haskell-cafe] ANNOUNCE: feldspar-language

2009-11-09 Thread Emil Axelsson
Tom Hawkins skrev: On Fri, Nov 6, 2009 at 6:28 AM, Emil Axelsson e...@chalmers.se wrote: I'm trying to get realtime signal processing with Haskell for long. I make progress, but slowly. Has Ericsson ever thought about using Haskell itself for signal processing? (But I think they already have

Re: [Haskell-cafe] Haskell image libraries

2009-11-09 Thread Pierre-Etienne Meunier
there is also a binding for libGD on hackage : http://hackage.haskell.org/package/gd And, of course, you can improve it, or write a binding to a more complete library. Or, even better, write a mix between http://www.libpng.org/pub/png/pngdocs.html and

[Haskell-cafe] ANN: acme-dont

2009-11-09 Thread Gracjan Polak
Hello fellow haskellers, While reading reddit in the morning today: http://www.reddit.com/r/programming/comments/a26fe/dont/ I was shocked and surprised to see that Haskell lacks a very important feature present in Perl. It appeared that Haskell cannot not do monadic actions! I decided to act

Re: [Haskell-cafe] ANN: acme-dont

2009-11-09 Thread Deniz Dogan
2009/11/9 Gracjan Polak gracjanpo...@gmail.com: Hello fellow haskellers, While reading reddit in the morning today: http://www.reddit.com/r/programming/comments/a26fe/dont/ I was shocked and surprised to see that Haskell lacks a very important feature present in Perl. It appeared that

[Haskell-cafe] Re: ANN: acme-dont

2009-11-09 Thread Gracjan Polak
Deniz Dogan deniz.a.m.dogan at gmail.com writes: Are you sure you want to license this as BSD? Yes, BSD3 to be more exact. Of course commercial options are available on case by case basis. -- Gracjan ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: ANN: acme-dont

2009-11-09 Thread Warren Henning
On Mon, Nov 9, 2009 at 4:01 AM, Gracjan Polak gracjanpo...@gmail.com wrote: Of course commercial options are available on case by case basis. When Acme.Dont licensing has made you a billionaire, remember the little people. ___ Haskell-Cafe mailing list

[Haskell-cafe] O'Haskell

2009-11-09 Thread shengwang
Hi, Somebody has idea, how to achieve reactive in O'Haskell? Shawn Wang _ MSN十年回馈,每位用户可免费获得价值25元的卡巴斯基反病毒软件2010激活码,快来领取!

Re: [Haskell-cafe] Cabal

2009-11-09 Thread Duncan Coutts
On Sun, 2009-11-08 at 20:47 -0800, Gregory Crosswhite wrote: Actually, let me clarify my point: I have rarely encountered problems when using Cabal as a package distribution system, but I have run into problems when using it as a build system in a non-trivial manner. For example, when I

Re: [Haskell-cafe] Cabal

2009-11-09 Thread Stephen Tetley
Hello Gregory and Philippos Gregory, methinks you are a unix user as Cabal gives you a carefree existence (the scare quotes do highlight that it's not poor Cabal's fault). Philippos, the problems you are having aren't which cabal per-se but Haskell libraries that bind C libraries. On Windows I

Re: [Haskell-cafe] Cabal

2009-11-09 Thread Duncan Coutts
On Sun, 2009-11-08 at 19:29 -0800, Philippos Apolinarius wrote: I made small improvements in the Small Japi Binding, and asked how to make it available. I received a few private messages advising me to build and package the library using a tool called cabal. Since I have used installation

[Haskell-cafe] cabal with non-default cc1

2009-11-09 Thread Daniel Kahlenberg
Hello friends, I want a package which can't be built with the version of gcc coming with the current release of ghc, so I installed a sufficient version of gcc and called cabal with the parameters that should override it's default settings (see the failure.log, line 112). But I have the

[Haskell-cafe] Observer pattern in Haskell?

2009-11-09 Thread Andy Gimblett
Hi all, I've been doing some GUI programming recently, using wx. To help manage dependencies between state and UI elements, I looked for a Haskell version of the Observer design pattern, and I found an implementation written by Bastiaan Heeren of ou.nl [1]. It pretty much did what I

Re: [Haskell-cafe] Observer pattern in Haskell?

2009-11-09 Thread Neil Brown
Andy Gimblett wrote: Hi all, I've been doing some GUI programming recently, using wx. To help manage dependencies between state and UI elements, I looked for a Haskell version of the Observer design pattern, and I found an implementation written by Bastiaan Heeren of ou.nl [1]. Now,

Re: [Haskell-cafe] Observer pattern in Haskell?

2009-11-09 Thread Eduard Sergeev
Andy Gimblett-2 wrote: To help manage dependencies between state and UI elements, I looked for a Haskell version of the Observer design pattern Isn't Reactive Programming approach more suitable than Observer if we talk about Haskell? -- View this message in context:

Re: [Haskell-cafe] Observer pattern in Haskell?

2009-11-09 Thread Andy Gimblett
Hi Neil, On 9 Nov 2009, at 14:50, Neil Brown wrote: 1. Does anyone have any comments, on either version? There is no way to remove an observer, which is something I'd expect to have available. I realise this would require assigning a key to each observer (and thus perhaps storing them in

Re: [Haskell-cafe] Observer pattern in Haskell?

2009-11-09 Thread Andy Gimblett
On 9 Nov 2009, at 15:21, Eduard Sergeev wrote: Andy Gimblett-2 wrote: To help manage dependencies between state and UI elements, I looked for a Haskell version of the Observer design pattern Isn't Reactive Programming approach more suitable than Observer if we talk about Haskell?

[Haskell-cafe] Re: cabal install on Windows

2009-11-09 Thread Michael Fan
I figured it out. It appears to be Colour package specific. The datadir still point to c:\Program File even with --user. I manually edit the dist/setup-config and get Colour installed. After that, other packages seem working fine. Jian Fan abe...@gmail.com wrote: Does cabal install --user or

Re: [Haskell-cafe] Observer pattern in Haskell?

2009-11-09 Thread Eduard Sergeev
Andy Gimblett-2 wrote: Possibly. Care to expand? If you have a more elegant solution, which fits in well with ordinary wxHaskell, I'd be interested. I believe there are a few experimental frameworks built on top of wxHaskell which use Functional Reactive Programming, like

Re: [Haskell-cafe] Re: cabal install on Windows

2009-11-09 Thread Duncan Coutts
On Mon, 2009-11-09 at 16:02 +, Michael Fan wrote: I figured it out. It appears to be Colour package specific. The datadir still point to c:\Program File even with --user. I manually edit the dist/setup-config and get Colour installed. After that, other packages seem working fine. From the

Re: [Haskell-cafe] Cabal

2009-11-09 Thread Duncan Coutts
On Mon, 2009-11-09 at 13:08 +, Stephen Tetley wrote: At this point I'd edit the *.cabal files in each component – this is not 'the done thing', but both libraries need extra flags and as I have to compile them rarely I tend to forget the format (which appears to be Windows style full

Re: [Haskell-cafe] Observer pattern in Haskell?

2009-11-09 Thread Andy Gimblett
On 9 Nov 2009, at 16:47, Eduard Sergeev wrote: Andy Gimblett-2 wrote: Possibly. Care to expand? If you have a more elegant solution, which fits in well with ordinary wxHaskell, I'd be interested. I believe there are a few experimental frameworks built on top of wxHaskell which use

Re: [Haskell-cafe] Cabal

2009-11-09 Thread Stephen Tetley
2009/11/9 Duncan Coutts duncan.cou...@googlemail.com: That should work, and probably the recommendation should be for cygwin users to edit their cabal config to at add C:\cygwin\lib and C:\cygwin \usr\include as standard. Hi Duncan That would definitely be the best idea, but where does the

Re: [Haskell-cafe] ANNOUNCE: feldspar-language

2009-11-09 Thread Tom Hawkins
On Mon, Nov 9, 2009 at 10:09 AM, Emil Axelsson e...@chalmers.se wrote: Nice! One of our project members has been looking at Atom, not for numerical computations, but for real-time scheduling (which Feldspar should deal with eventually). What kind of code (in terms of efficiency) does the

Re: [Haskell-cafe] Observer pattern in Haskell?

2009-11-09 Thread Neil Brown
Andy Gimblett wrote: was a bit surprised at first that the observers were called synchronously. Asynchronous is what I'd expect, and it's also harder to code the asynchronous handlers wrongly. One blocking call (such as putMVar) in a synchronous handler can screw up your whole program by

Re: [Haskell-cafe] O'Haskell

2009-11-09 Thread Joe Fredette
That sounds vaguely ominous... Sir, we've achieved reactive in O'Haskell, we'll have ten minutes till the VB GUI detects his IP address! ... But in all seriousness, it is my understanding that O'Haskell has fallen into disuse. IIRC Timber is the spiritual successor, but I have no idea

Re: [Haskell-cafe] Observer pattern in Haskell?

2009-11-09 Thread Andy Gimblett
On 9 Nov 2009, at 17:41, Neil Brown wrote: Just to clarify -- I meant access to another MVar. Basically, if I do this: do v - newMVar addObserver sub (putMVar v) If when the observers are run, the MVar v (that I've allocated) is non-empty, my code will block until it is empty, which

[Haskell-cafe] classes question

2009-11-09 Thread Paul Tokarev
Hi. I am using Hugs 98 I have that piece of code: class PlusTimes a where plus :: a - a - a instance PlusTimes Int where plus x y = x + y when I run : plus 2 3 I get this error: ERROR - Unresolved overloading *** Type : (Num a, PlusTimes a) = a *** Expression : plus 2 3 What am I

Re: [Haskell-cafe] classes question

2009-11-09 Thread Ross Mellgren
You did not specify what type of number it is -- in Haskell numeric constants like 1 are actually typed as forall a. Num a -- that is, can be any type of Num. Try: plus (2::Int) 3 -Ross On Nov 9, 2009, at 1:44 PM, Paul Tokarev wrote: Hi. I am using Hugs 98 I have that piece of code:

Re: [Haskell-cafe] classes question

2009-11-09 Thread Joe Fredette
(+) is a name that is already taken by the Num typeclass, you're trying to overload it with a different class. It's equivalent to doing: foo :: Int foo = 1 foo :: String foo = abc this would cause an (obvious) namespace collision. If you want to redefine (+), you'll have to import a

Re: [Haskell-cafe] classes question

2009-11-09 Thread Joe Fredette
Oh, crap, I'm sorry, I completely misread your post... Disregard my previous message. /Joe On Nov 9, 2009, at 1:44 PM, Paul Tokarev wrote: Hi. I am using Hugs 98 I have that piece of code: class PlusTimes a where plus :: a - a - a instance PlusTimes Int where plus x y = x + y when

Re: [Haskell-cafe] Cabal

2009-11-09 Thread Duncan Coutts
On Sun, 2009-11-08 at 19:29 -0800, Philippos Apolinarius wrote: D:\ghc\ghcapicabal install mkcabal Note that as of cabal-install-0.8, the mkcabal functionality is integrated as cabal init (thanks to Brent Yorgey). This does not depend on less portable packages like pcre and readline (meaning it

[Haskell-cafe] strict mapM implementation correctness

2009-11-09 Thread Paolo Losi
Hi all, while coding recently I came across the need for a strict mapM (that I indicidently use for m = MaybeT IO). I implementented this with the following simple code (it works for my use case): mapM' :: Monad m = (a- m b) - [a] - m [b] mapM' _ [] = return [] mapM' f (x:xs) = do y - f x

Re: [Haskell-cafe] classes question

2009-11-09 Thread Paul Tokarev
Thanks, that works. But how sould I change my class definition, so that it works without (2::Int), but just with 2? Ross Mellgren wrote: You did not specify what type of number it is -- in Haskell numeric constants like 1 are actually typed as forall a. Num a -- that is, can be any

Re: [Haskell-cafe] classes question

2009-11-09 Thread Ross Mellgren
It's not your class definition that is the problem -- your class definition is good. The problem is that when you interact with it using the REPL, you don't specify any particular type you want so it's ambiguous. Usually this is not a problem in actual programs that you compile because

Re: [Haskell-cafe] is proof by testing possible?

2009-11-09 Thread muad
I have come across an example: However, the following proof of the lovely identity: sum . map (^3) $ [1..n] = (sum $ [1..n])^2 is perfectly rigorous. Proof: True for n = 0, 1, 2, 3, 4 (check!), hence true for all n. QED. In order to turn this into a full-fledged proof, all you have to do

Re: [Haskell-cafe] Cabal

2009-11-09 Thread Duncan Coutts
On Mon, 2009-11-09 at 17:40 +, Stephen Tetley wrote: 2009/11/9 Duncan Coutts duncan.cou...@googlemail.com: That should work, and probably the recommendation should be for cygwin users to edit their cabal config to at add C:\cygwin\lib and C:\cygwin \usr\include as standard. Hi

Re: [Haskell-cafe] Observer pattern in Haskell?

2009-11-09 Thread Tom Lokhorst
I haven't looked at the code extensively, I just wanted to comment on this point: There is no way to remove an observer, which is something I'd expect to have available. I realise this would require assigning a key to each observer (and thus perhaps storing them in an associative map) or some

[Haskell-cafe] Type-indexed expressions with fixpoint

2009-11-09 Thread Brent Yorgey
Hi all, This email is literate Haskell. I'm struggling to come up with the right way to add a fixpoint constructor to an expression language described by a type-indexed GADT (details below). Any suggestions, comments, or pointers welcome. {-# LANGUAGE KindSignatures, GADTs #-} Consider the

[Haskell-cafe] Exciting job opportunity

2009-11-09 Thread siki
Principal investment firm based in Manhattan is looking for an outstanding software developer to maintain and develop proprietary accounting and portfolio management systems. You should have at least a bachelor’s degree in computer science from a top university and impeccable coding style.

Re: [Haskell-cafe] ANN: acme-dont

2009-11-09 Thread Richard O'Keefe
On Nov 9, 2009, at 11:27 PM, Gracjan Polak wrote: With special apologies to Luke Palmer that it took the Haskell community 7.5 years to catch up with Perl. We may not have had the simple name don't, but we've been able to write const $ return () for a long time.

[Haskell-cafe] Help Haskell driving Medical Instruments

2009-11-09 Thread Philippos Apolinarius
Recently, I received as gift medical instruments designed by one of my father former students. There is a description of these instruments on my web page. Here is the address: http://www.discenda.org/med/ By the way, I am not that guy that appears in a picture wearing emg sensors. That said,

Re: [Haskell-cafe] is proof by testing possible?

2009-11-09 Thread Curt Sampson
On 2009-11-09 14:22 -0800 (Mon), muad wrote: Proof: True for n = 0, 1, 2, 3, 4 (check!), hence true for all n. QED. ... Actually, the test is that it's true for 0 through 4 is not sufficient for a proof; you also need to prove in some way that you need do no further tests. Showing that

Re: [Haskell-cafe] Help Haskell driving Medical Instruments

2009-11-09 Thread Jason Dusek
Does marking the call `unsafe` make any difference? This is running on a *NIX of some flavour? -- Jason Dusek ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe