[Haskell-cafe] Re: ANNOUNCE: SourceGraph 0.5.2.0

2009-10-04 Thread Christian Maeder
Ivan Lazar Miljenovic wrote: Christian Maeder christian.mae...@dfki.de writes: Ivan Lazar Miljenovic wrote: installation went well, but I get a rather uninformative error message for 505 source files: cabal build: [505 of 505] Compiling Main :o There is no way that there's 505

[Haskell-cafe] Re: ANNOUNCE: SourceGraph 0.5.2.0

2009-10-04 Thread Ivan Lazar Miljenovic
Christian Maeder christian.mae...@dfki.de writes: My code (505 source files) is valid, as I wanted to indicate above. (I did count SourceGraph source files.) Ahhh, OK. Does SourceGraph maybe pick up more source files than transitively imported from a top-level module? At the moment, yes...

[Haskell-cafe] better way to do this?

2009-10-04 Thread Michael Mossey
I'm looking for a hint to write the following code with less redundancy. I have a constructor called BoxBounds, and I want to make one with random values. randomBox :: IO BoxBounds randomBox = do x - getStdRandom (randomR (-10,10)) y - getStdRandom (randomR (-70,70)) t - getStdRandom

Re: [Haskell-cafe] better way to do this?

2009-10-04 Thread Eugene Kirpichov
[x,y,t,b,l,r] - mapM (getStdRandom . randomR) [(-10,10), (-70,70), ...] return (BoxBounds ...) 2009/10/4 Michael Mossey m...@alumni.caltech.edu: I'm looking for a hint to write the following code with less redundancy. I have a constructor called BoxBounds, and I want to make one with random

Re: [Haskell-cafe] better way to do this?

2009-10-04 Thread Felipe Lessa
On Sun, Oct 04, 2009 at 01:55:11PM +0400, Eugene Kirpichov wrote: [x,y,t,b,l,r] - mapM (getStdRandom . randomR) [(-10,10), (-70,70), ...] return (BoxBounds ...) import Control.Applicative let f = getStdRandom . randomR g1 = \x - f (-x,x) g2 = f (5,10) in BoxBounds $ g1 10 * g1 70 * g2

Re: [Haskell-cafe] better way to do this?

2009-10-04 Thread Duncan Coutts
On Sun, 2009-10-04 at 02:52 -0700, Michael Mossey wrote: I'm looking for a hint to write the following code with less redundancy. I have a constructor called BoxBounds, and I want to make one with random values. randomBox :: IO BoxBounds randomBox = do x - getStdRandom (randomR (-10,10))

Re: [Haskell-cafe] better way to do this?

2009-10-04 Thread Michael Mossey
Duncan Coutts wrote: On Sun, 2009-10-04 at 02:52 -0700, Michael Mossey wrote: I'm looking for a hint to write the following code with less redundancy. I have a constructor called BoxBounds, and I want to make one with random values. randomBox :: IO BoxBounds randomBox = do x - getStdRandom

Re: [Haskell-cafe] better way to do this?

2009-10-04 Thread Duncan Coutts
On Sun, 2009-10-04 at 05:11 -0700, Michael Mossey wrote: Duncan Coutts wrote: Others have already answered but I'd like to suggest that you avoid using IO here. There's no need for this to be impure. Can you point me to a tutorial that covers the basics of randomness in Hasell? I find it

[Haskell-cafe] Need some help with Alex macros

2009-10-04 Thread Niklas Broberg
Hi all, I'm going crazy trying to get Alex to do what I want. I have the following regexp macros: @octEscape = [0123]? $octdig{1,2} @hexEscape = 'u' $hexdig{4} @charEscape = '\\' (@octEscape | @hexEscape | b | t | n | f | r | \ | \') and the following rules: \' (. # [\'\\] | @charEscape)

Re: [Haskell-cafe] better way to do this?

2009-10-04 Thread Ryan Ingram
And, to go further, once you embrace determinism in your randomness, you can do all sorts of really cool things. From the perspective of a games programmer: You can run the same simulation code on two different network nodes, and reliably get the same result, allowing you to just transfer user

[Haskell-cafe] Can HXT and Parsec 3 be used in the same library?

2009-10-04 Thread John Millikin
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm writing a library that needs to parse both plain text (with Parsec) and XML (with HXT). HXT's .cabal file specifies that it only works with parsec (= 2.1 3), but it still builds when I depend on parsec = 3. It's only during cabal install that

[Haskell-cafe] Where do these warnings come from?

2009-10-04 Thread Colin Paul Adams
Does anyone recognize which module/function would emit the following warnings? WARNING: nonstandard use of escape in a string literal LINE 11: '# Pandoc\r\n\r\nPandoc is a program for converting ... ^ HINT: Use the escape string syntax for escapes, e.g., E'\r\n'. --

Re: [Haskell-cafe] Where do these warnings come from?

2009-10-04 Thread Anton van Straaten
Colin Paul Adams wrote: Does anyone recognize which module/function would emit the following warnings? WARNING: nonstandard use of escape in a string literal LINE 11: '# Pandoc\r\n\r\nPandoc is a program for converting ... ^ HINT: Use the escape string syntax for

Re: [Haskell-cafe] Where do these warnings come from?

2009-10-04 Thread Colin Paul Adams
Anton == Anton van Straaten an...@appsolutions.com writes: Anton Colin Paul Adams wrote: Does anyone recognize which module/function would emit the following warnings? WARNING: nonstandard use of escape in a string literal LINE 11: '# Pandoc\r\n\r\nPandoc is a

Re: [Haskell-cafe] killer app sought

2009-10-04 Thread John A. De Goes
With few exceptions, no such thing as a killer server-side app. The Web 3.0 paradigm is simple: all work except sharing and persistence of data is done on the client. Regards, John A. De Goes N-Brain, Inc. The Evolution of Collaboration http://www.n-brain.net|877-376-2724 x 101

Fwd: [Haskell-cafe] killer app sought

2009-10-04 Thread Alberto G. Corona
Yes, Maybe The piece of the web that desperately need a boost in performance, declarativeness, safety, static typing threading, modularity etc etc etc is the Web Browser. 2009/10/4 John A. De Goes j...@n-brain.net With few exceptions, no such thing as a killer server-side app. The Web 3.0

Re: [Haskell-cafe] killer app sought

2009-10-04 Thread Keith Sheppard
IMO google web toolkit has done this for Java and I haven't tried it but maybe http://www.haskell.org/haskellwiki/Haskell_in_web_browser does or will do this for Haskell. I still think that there is a place for web applications that are smart on the server side though. Best -Keith On Sun, Oct 4,

[Haskell-cafe] ANN: TxtSushi 0.4.0

2009-10-04 Thread Keith Sheppard
Hello Cafe, I've just uploaded TxtSushi 0.4.0 to hackage. TxtSushi is a collection of command line utilities for processing comma-separated and tab-delimited files. I posted details on my blog (along with an advertisement to see if others are interested in hacking TxtSushi):

[Haskell-cafe] Curried function terminology

2009-10-04 Thread michael rice
This is from Learn You A Haskell: == Curried functions Every function in Haskell officially only takes one parameter. So how is it possible that we defined and used several functions that take more than one parameter so far? Well, it's a clever trick! All the functions that accepted

[Haskell-cafe] Is c2hs able to generate FunPtr rather than just the function?

2009-10-04 Thread Rafal Kolanski
Hi Everyone, I'm trying to figure out an elegant way of letting the Haskell garbage collector deal with structures allocated from C. So I have the C pair: fluid_event_t* new_fluid_event(void); void delete_fluid_event(fluid_event_t* evt); I've handled the new_fluid_event thing nicely,