Re: [Haskell-cafe] Bathroom reading

2007-08-15 Thread Ketil Malde
On Tue, 2007-08-14 at 17:22 +0200, Bas van Dijk wrote: On 8/14/07, Dougal Stanton [EMAIL PROTECTED] wrote: I'm looking for cool but mind-bending examples of functional brilliance. Maybe: http://www.haskell.org/haskellwiki/Blow_your_mind

Re: [Haskell-cafe] ANNOUNCE: Guihaskell and PropLang 0.1

2007-08-15 Thread Dougal Stanton
On 15/08/07, Asumu Takikawa [EMAIL PROTECTED] wrote: == GuiHaskell Guihaskell is a graphical REPL using PropLang, a GUI combinator library built on top of Gtk2hs, which aims to be an IDE for Haskell written in Haskell. It's still rough around the edges, so think of this as an alpha release.

Re: [Haskell-cafe] ANNOUNCE: Guihaskell and PropLang 0.1

2007-08-15 Thread Neil Mitchell
Hi Dougal, It's cross platform, and will use GHC and Hugs if they are already installed. Thanks Neil On 8/15/07, Dougal Stanton [EMAIL PROTECTED] wrote: On 15/08/07, Asumu Takikawa [EMAIL PROTECTED] wrote: == GuiHaskell Guihaskell is a graphical REPL using PropLang, a GUI combinator

[Haskell-cafe] Re: Re[2]: Why monad tutorials don't work

2007-08-15 Thread Dominic Steinitz
Miguel Mitrofanov miguelimo38 at yandex.ru writes: Grrr...must...hold...my...tongue... Dan, as a former student of a clone of that physics teacher, I am really interested in what you will say when you fail to hold your tongue. -- Bill Wood MV I have to admit I was wondering

Re: [Haskell-cafe] Explaining monads

2007-08-15 Thread Andy Gimblett
On Tue, Aug 14, 2007 at 05:53:05PM -0700, Michael Vanier wrote: For what it's worth, the nature of Haskell is such that you do (at least currently) have to spend a lot of time reading research papers to understand what's going on. Maybe that will change sometime, but probably not soon. This

[Haskell-cafe] Haskell for the Enterprise (topic for a MSc dissertation?)

2007-08-15 Thread Lars Oppermann
Hi All, This is my first post here, so I'll start with a quick introduction... I live and work in Hamburg, Germany. My day job is as a software engineer at Sun Microsystems at the OpenOffice.org development team where I'm mostly doing XML (ODF) related things. Beside of that, I'm currently

[Haskell-cafe] Re: Re[2]: Why monad tutorials don't work

2007-08-15 Thread Andy Gimblett
On Wed, Aug 15, 2007 at 12:50:42PM +, Dominic Steinitz wrote: Miguel Mitrofanov miguelimo38 at yandex.ru writes: Grrr...must...hold...my...tongue... Dan, as a former student of a clone of that physics teacher, I am really interested in what you will say when you fail to hold

Re: [Haskell-cafe] Re: defining last using foldr

2007-08-15 Thread Chaddaï Fouché
2007/8/15, Aaron Denney [EMAIL PROTECTED]: The original last fail on empty list, it's far easier to obtain the same semantic with foldl than with foldr, in fact it isn't hard at all to make it polymorphic without hassle (contrary to the foldr case) _if_ you remember that there _is_ a

Re: [Haskell-cafe] Re:Explaining monads

2007-08-15 Thread Jeff Polakow
Hello, Hence the need to perform a run operation like runIdentity, evalState or runParser (for Parsec) to get something useful to happen. Except for lists we don't seem to do this. I suppose lists are so simple that the operators :, ++ and the [] constructor do all we ever need with

[Haskell-cafe] Re: defining last using foldr

2007-08-15 Thread Aaron Denney
On 2007-08-15, Chaddaï Fouché [EMAIL PROTECTED] wrote: Still I don't see why foldl would make it harder to use Maybe than foldr (in fact it's easier). You're right. I just wasn't looking at it quite properly. -- Aaron Denney -- ___ Haskell-Cafe

Re: [Haskell-cafe] Re: Re[2]: Why monad tutorials don't work

2007-08-15 Thread Dan Piponi
On 8/15/07, Andy Gimblett [EMAIL PROTECTED] wrote: I assumed he was just trying not to sing the Spider Pig song. I've been banned from singing that around the house. And the cat version. But I was mainly thinking about how the physicist's definition of tensor needn't be accepted as an

Re: [Haskell-cafe] Explaining monads

2007-08-15 Thread Paul Hudak
I've seen the analogy with recipes used before, but I think that you need to be careful when you try to distinguish the analogy to monads from the analogy to functions. The reason is that, in the one-of-many ways that I view monads, a monad is just a high-order /function /that abstracts away

[Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-15 Thread Brian Hulley
Hi, On http://hackage.haskell.org/trac/haskell-prime/wiki/LambdaCase the proposed syntax for lambda case is: case of alts but this has a really bad downside for interactive editors: it doesn't allow one to distinguish between an incomplete construct and a completed construct thus

Re: [Haskell-cafe] Re: Hints for Euler Problem 11

2007-08-15 Thread Mathias Biilmann Christensen
Spotted this thread as I was working on a Haskell solution for this one myself - here's the solution I came up with: module Main where import List raw_matrix = 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 ++ 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 ++ 81

Re: [Haskell-cafe] Re: Hints for Euler Problem 11

2007-08-15 Thread Pekka Karjalainen
On 8/15/07, Mathias Biilmann Christensen [EMAIL PROTECTED] wrote: Spotted this thread as I was working on a Haskell solution for this one myself - here's the solution I came up with: [ ... ] raw_matrix = 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 ++ 49 49 99 40 17 81 18

Re: [Haskell-cafe] Bathroom reading

2007-08-15 Thread Dan Piponi
On 8/14/07, Dougal Stanton [EMAIL PROTECTED] wrote: I'm looking for cool but mind-bending examples of functional brilliance. One of my favourite examples is: http://citeseer.ist.psu.edu/hinze99functional.html Anyone who studies binomial heaps is struck by the similarity to binary arithmetic.

Re: [Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-15 Thread Stefan O'Rear
On Wed, Aug 15, 2007 at 06:58:40PM +0100, Duncan Coutts wrote: On Wed, 2007-08-15 at 10:50 -0700, Stefan O'Rear wrote: OTOH, your proposal provides (IMO) much more natural syntax for multi-pattern anonymous functions, especially if we stipulate that unlike a case (but like a lambda) you

[Haskell-cafe] Re: Why monad tutorials don't work

2007-08-15 Thread Aaron Denney
On 2007-08-14, Michael Vanier [EMAIL PROTECTED] wrote: I'm reminded of a physics teacher who was having a similar problem explaining the concept of tensors, until he said that a tensor is something that transforms like a tensor does!. Which is silly. A tensor is a linear function of vectors

[Haskell-cafe] Re: Hints for Euler Problem 11

2007-08-15 Thread Aaron Denney
On 2007-08-15, Pekka Karjalainen [EMAIL PROTECTED] wrote: On 8/15/07, Mathias Biilmann Christensen [EMAIL PROTECTED] wrote: Spotted this thread as I was working on a Haskell solution for this one myself - here's the solution I came up with: [ ... ] raw_matrix = 08 02 22 97 38 15 00 40 00 75

Re: [Haskell-cafe] monte carlo trouble

2007-08-15 Thread Paul Johnson
Chad Scherrer wrote: There's a problem I've been struggling with for a long time... I need to build a function buildSample :: [A] - State StdGen [(A,B,C)] given lookup functions f :: A - [B] g :: A - [C] The idea is to first draw randomly form the [A], then apply each lookup function and

Re: [Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-15 Thread Duncan Coutts
On Wed, 2007-08-15 at 11:06 -0700, Stefan O'Rear wrote: Why not just: sumTo0 = foldr (\0 k - 0 n k - n + k) 0 Because it would break a very large amount of old code, and I think H' was supposed to be upward compatible: Aye, that'd be bad. foo = getSomethingCPS $ \

Re: [Haskell-cafe] Haskell for the Enterprise (topic for a MSc dissertation?)

2007-08-15 Thread Paul Johnson
Lars Oppermann wrote: I would love to hear your comments on this. Has this been done over and over already? Are there any source which you think of from the top of your head which I should check out? Books that you would want to recommend? Sounds interesting. I for one would like to read a

Re: [Haskell-cafe] monte carlo trouble

2007-08-15 Thread Thomas Hartman
have you looked at pfp, the haskell probabilistic functional programming library ? http://web.engr.oregonstate.edu/~erwig/pfp/ the paper http://web.engr.oregonstate.edu/~erwig/papers/abstracts.html#JFP06a describes modeling various statisticy things this way, like tree growth and the monty

Re: [Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-15 Thread Brian Hulley
Stefan O'Rear wrote: On Wed, Aug 15, 2007 at 06:58:40PM +0100, Duncan Coutts wrote: On Wed, 2007-08-15 at 10:50 -0700, Stefan O'Rear wrote: OTOH, your proposal provides (IMO) much more natural syntax for multi-pattern anonymous functions, especially if we stipulate that unlike a case

Re: [Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-15 Thread Brandon Michael Moore
On Wed, Aug 15, 2007 at 11:06:36AM -0700, Stefan O'Rear wrote: On Wed, Aug 15, 2007 at 06:58:40PM +0100, Duncan Coutts wrote: On Wed, 2007-08-15 at 10:50 -0700, Stefan O'Rear wrote: OTOH, your proposal provides (IMO) much more natural syntax for multi-pattern anonymous functions,

[Haskell-cafe] Re: Syntax for lambda case proposal could be \of

2007-08-15 Thread Benjamin Franksen
Brian Hulley wrote: Stefan O'Rear wrote: On Wed, Aug 15, 2007 at 06:58:40PM +0100, Duncan Coutts wrote: On Wed, 2007-08-15 at 10:50 -0700, Stefan O'Rear wrote: OTOH, your proposal provides (IMO) much more natural syntax for multi-pattern anonymous functions, especially if we

Re: [Haskell-cafe] monte carlo trouble

2007-08-15 Thread Chad Scherrer
Thanks for your replies. I actually starting out returning a single element instead. But a given lookup might return [], and the only way I could think of to handle it in (State StdGen a) would be to fail in the monad. But that's not really the effect I want - I'd rather have it ignore that

Re: [Haskell-cafe] monte carlo trouble

2007-08-15 Thread Thomas Hartman
I've seen PFP, but I don't see where that would help here. I'd still end up with an enormous list of tuples. I'm not sure I understand what you need, but did you read the bits about replacing a pure state expansion (all the possibile states) with an approximation using random/io ? the

Re: [Haskell-cafe] monte carlo trouble

2007-08-15 Thread Chad Scherrer
Funny you should say that, I was just experimenting with generating one at a time using (StateT StdGen Maybe). If I get stuck (again) I'll check out ListT. Thanks! Chad On 8/15/07, Paul Johnson [EMAIL PROTECTED] wrote: Chad Scherrer wrote: Thanks for your replies. I actually starting out

Re: [Haskell-cafe] Re: Re[2]: Why monad tutorials don't work

2007-08-15 Thread Dan Weston
Dan Piponi wrote: But I was mainly thinking about how the physicist's definition of tensor needn't be accepted as an irreducible given, but is a consequence of the definition of tensor product through its universal property: http://planetmath.org/encyclopedia/TensorProduct.html Having said

Re: [Haskell-cafe] Haskell for the Enterprise (topic for a MSc dissertation?)

2007-08-15 Thread Lars Oppermann
On 8/15/07, Paul Johnson [EMAIL PROTECTED] wrote: I'm not sure what you mean by modelling: functional programmers don't see modelling as separate from coding: the code is the model, and if thats not abstract enough then you didn't do it right. [...] With modeling I meant the process of

Re: [Haskell-cafe] Re: Re[2]: Why monad tutorials don't work

2007-08-15 Thread Dan Piponi
On 8/15/07, Dan Weston [EMAIL PROTECTED] wrote: You too could have invented Universal Algebra and Category Theory. I nominate Dan Piponi to write it and eagerly await its release! I've already started on it. Well, that's not the exact title and subject. And as an example I'll probably use the

Re: [Haskell-cafe] defining last using foldr

2007-08-15 Thread Alexteslin
Aaron Denney wrote: (Quoting reformatted. Try to have your responses below what you are responding to. It makes it easier to read as a conversation.) On 2007-08-14, Alexteslin [EMAIL PROTECTED] wrote: Aaron Denney wrote: Folds replace the cons operator (:) with the function you pass

Re: [Haskell-cafe] Re: Re[2]: Why monad tutorials don't work

2007-08-15 Thread Dipankar Ray
At this point I must mention that Tim Gowers has an excellent article on Tensor Products, entitled How to lose your fear of tensor products: http://www.dpmms.cam.ac.uk/~wtg10/tensors3.html Tim Gowers is a pretty ok mathematician - worth taking tips from, I'd say ;)

[Haskell-cafe] Re: defining last using foldr

2007-08-15 Thread Jon Fairbairn
Alexteslin [EMAIL PROTECTED] writes: I am really sorry, but i still can't define the function. The chapter the exercise is in precedes algebraic types or Maybe a types. And is seems that must being easy to define. I answered some exercises on using foldr such as summing for example, but

[Haskell-cafe] Pattern matching articles/explanations

2007-08-15 Thread Ian Duncan
Hello everyone, I've been working on improving my Haskell knowledge, and in doing so, I have read a little about as-patterns as well as some form of pattern that uses ~ that I don't really understand. I suspect there are even more lesser-known pattern matching expressions than just these,

Re: [Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-15 Thread Isaac Dupree
Duncan Coutts wrote: On Wed, 2007-08-15 at 18:23 +0100, Brian Hulley wrote: Therefore I propose: \of alts which doesn't suffer this problem since the keyword of can never follow a '\' in the existing grammar. Or how about: \case of alts which seems clearer to me.

Re: [Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-15 Thread Dan Weston
I came really late to this discussion, so I assume someone has already proposed using (Control.Applicative.|) to select the first matching pattern of an unnamed cased object. Can someone point me to where that was proposed and why it was rejected? Dan Weston Isaac Dupree wrote: Duncan

Re: [Haskell-cafe] GHC linking problems

2007-08-15 Thread SevenThunders
SevenThunders wrote: I have a large Haskell/C project that needs to be linked against an even larger set of C libraries and object files (OpNet) on a linux box (Fedora Core 7). So far I have been able to link my Haskell libraries to some C test code containing a main function without

[Haskell-cafe] Re: Re[2]: Why monad tutorials don't work

2007-08-15 Thread Dominic Steinitz
Dan Piponi dpiponi at gmail.com writes: On 8/15/07, Dan Weston westondan at imageworks.com wrote: You too could have invented Universal Algebra and Category Theory. I nominate Dan Piponi to write it and eagerly await its release! I've already started on it. Well, that's not the exact

Re: [Haskell-cafe] defining last using foldr

2007-08-15 Thread Chaddaï Fouché
2007/8/15, Alexteslin [EMAIL PROTECTED]: I am really sorry, but i still can't define the function. The chapter the exercise is in precedes algebraic types or Maybe a types. And is seems that must being easy to define. If you don't have Maybe, you still have it's older brother, namely lists

Re: [Haskell-cafe] monte carlo trouble

2007-08-15 Thread Chaddaï Fouché
2007/8/15, Chad Scherrer [EMAIL PROTECTED]: If there's a way to lazily sample with replacement from a list without even requiring the length of the list to be known in advance, that could lead to a solution. I'm not sure what you mean by with replacement but I think it don't change the

Re: [Haskell-cafe] monte carlo trouble

2007-08-15 Thread Chad Scherrer
Yeah, I did have troubles with (StateT StdGen Maybe). If it hits a Nothing, I'd like it to skip that one and try again with the next state. But instead, Nothing is treated as a failure condition that makes the whole thing fail. I just found MaybeT on the wiki, which looks like it could work. I'll

[Haskell-cafe] Erlang VM in Haskell

2007-08-15 Thread Joel Reymont
Folks, I would like to write an Erlang VM in Haskell. I first thought of OCaml but Haskell has SMP and lazy evaluation may come in handy. Plus, I'll need help in this project like in no other and support from the Haskell community has always been outstanding. I'm doing this to learn more

Re: [Haskell-cafe] Erlang VM in Haskell

2007-08-15 Thread Chaddaï Fouché
2007/8/16, Joel Reymont [EMAIL PROTECTED]: I'm doing this to learn more about the Erlang internals and to acquire some skills in the process. I'm also hoping to be at least as fast as the existing Erlang VM (written in C) That don't seem too realistic since the Erlang development team is big

Re: [Haskell-cafe] monte carlo trouble

2007-08-15 Thread Steve Schafer
On Thu, 16 Aug 2007 00:05:14 +0200, you wrote: I'm not sure what you mean by with replacement With replacement means that you select a value from the source, but you don't actually remove it. That way, it's still available to be selected again later. Steve Schafer Fenestra Technologies Corp.

[Haskell-cafe] Problem installing GHC6.6

2007-08-15 Thread ok
Trying to install GHC 6.6 on a Solaris 2.9 box (do I have the last 2.9 box in captivity? I've asked for 2.10, really and truly I have) I ran into two problems. (1) Somewhere it was assumed that only FreeBSD didn't have stdint.h. Solaris 2.9 doesn't have stdint.h. That was an easy patch. (2)