Re: [Haskell-cafe] So how do people pronounce 'cabal' around here?

2008-05-28 Thread Benjamin L. Russell
Not always. Just to be sure, I just checked the Longman Dictionary of Contemporary English Online (http://pewebdic2.cw.idm.fr/topbar.html), and it came up with the following pronunciation for cabal: \kəˈbæl\ In fact, this was the only pronunciation listed, so the other pronunciation is not

[Haskell-cafe] re: a build problem

2008-05-28 Thread Galchin, Vasili
Hi Duncan, In response to your below, I am running runhaskell Setup.hs configure -v3 --prefix=$HOME. Is v3 the current highest Cabal highest verbosity level? FYI basically I am running ghc that I just built a couple of days ago from the ghc source distribution. Vasili (I. Galchin) ;^) On

Re: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-28 Thread Bulat Ziganshin
Hello Henning, Wednesday, May 28, 2008, 9:51:28 AM, you wrote: We could simulate a list with strict elements, i.e. data StrictList a = Elem !a (StrictList a) | End by an unboxed array with a cursor to the next element to be evaluated and a function that generates the next element.

[Haskell-cafe] What's NaN?

2008-05-28 Thread PR Stanley
Hello Why does sqrt (-16) return NaN? What is NaN? Thanks Paul ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] What's NaN?

2008-05-28 Thread Yann Golanski
Quoth PR Stanley on Wed, May 28, 2008 at 08:04:44 +0100 Hello Why does sqrt (-16) return NaN? What is NaN? NaN stands for Not a Number. See the complex library for how to have complex numbers. -- [EMAIL PROTECTED] -= H+ =- www.kierun.org PGP: 009D 7287 C4A7 FD4F

[Haskell-cafe] Re: a build problem

2008-05-28 Thread Galchin, Vasili
In order to save everybody on Haskell Cafe a lot of time, I bootstrapped my ghc from Ubuntu ghc 6.8.2 using source from http://www.haskell.org. Regards, Vasili On Wed, May 28, 2008 at 1:14 AM, Galchin, Vasili [EMAIL PROTECTED] wrote: Hi Duncan, In response to your below, I am running

[Haskell-cafe] Type Coercion

2008-05-28 Thread PR Stanley
Hi (16 :: Float) is a perfectly legitimate statement although I'm surprised that it's allowed in a type strong language such as Haskell. It's a bit like casting in good old C. What's going on here? Paul ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Type Coercion

2008-05-28 Thread Thomas Davie
On 28 May 2008, at 09:34, PR Stanley wrote: Hi (16 :: Float) is a perfectly legitimate statement although I'm surprised that it's allowed in a type strong language such as Haskell. It's a bit like casting in good old C. What's going on here? It's not a coercion -- it happens at compile

Re: [Haskell-cafe] What's NaN?

2008-05-28 Thread Lennart Augustsson
Try reading http://www.physics.ohio-state.edu/~dws/grouplinks/floating_point_math.pdf On Wed, May 28, 2008 at 8:04 AM, PR Stanley [EMAIL PROTECTED] wrote: Hello Why does sqrt (-16) return NaN? What is NaN? Thanks Paul ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Re: the Network.URI parser

2008-05-28 Thread Peter Gammie
On 28/05/2008, at 12:28 PM, Miguel Mitrofanov wrote: I am taking comments on a web forum from arbitrary people. The interpretation of the HTML occurs at the user's browser. A lot of people will be using outdated browsers (IE 5.5 / 6), ergo security (at the source) becomes my problem. I

Re: [Haskell-cafe] Type Coercion

2008-05-28 Thread Ketil Malde
PR Stanley [EMAIL PROTECTED] writes: (16 :: Float) is a perfectly legitimate statement although I'm surprised that it's allowed in a type strong language such as Haskell. It's a bit like casting in good old C. What's going on here? The literal 16 is really shorthand for fromIntegral

Re: [Haskell-cafe] Type Coercion

2008-05-28 Thread Salvatore Insalaco
2008/5/28 PR Stanley [EMAIL PROTECTED]: Hi (16 :: Float) is a perfectly legitimate statement although I'm surprised that it's allowed in a type strong language such as Haskell. It's a bit like casting in good old C. What's going on here? Don't worry: it's not a cast. Numeric constants like 16

Re: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-28 Thread Henning Thielemann
On Wed, 28 May 2008, Bulat Ziganshin wrote: Hello Henning, Wednesday, May 28, 2008, 9:51:28 AM, you wrote: We could simulate a list with strict elements, i.e. data StrictList a = Elem !a (StrictList a) | End by an unboxed array with a cursor to the next element to be evaluated and

Re[2]: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-28 Thread Bulat Ziganshin
Hello Henning, Wednesday, May 28, 2008, 12:22:54 PM, you wrote: Whenever an element with an index beyond the cursor is requested, sufficiently many new elements are written to the array and the cursor is advanced. As far as I know, ByteString.Lazy is chunky, that is laziness occurs only

Re: [Haskell-cafe] Re: Examples of using Haskell for mathematics

2008-05-28 Thread Conor McBride
Hi On 28 May 2008, at 10:33, Jose A. Ortega Ruiz wrote: [..] I've enjoyed immensely several entries in Dan Piponi's 'A Neighborhood of Infinity'. In particular, 'Infinitesimal rotations and Lie algebras': http://sigfpe.blogspot.com/2008/04/infinitesimal-rotations-and- lie.html made me

Re: [Haskell-cafe] Re: Aren't type system extensions fun? [Further analysis]

2008-05-28 Thread Roberto Zunino
Andrew Coppin wrote: (id 'J', id True) -- Works perfectly. \f - (f 'J', f True) -- Fails miserably. Both expressions are obviously perfectly type-safe, and yet the type checker stubbornly rejects the second example. Clearly this is a flaw in the type checker. When you type some

Re: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-28 Thread Ketil Malde
Bulat Ziganshin [EMAIL PROTECTED] writes: well, i don't understand difference between your idea and lazybs implementation HT said earlier that: This would still allow the nice tricks for recursive Fibonacci sequence definition. Which I guess refers to something like: fibs = 1 : 1 :

Re: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-28 Thread Henning Thielemann
On Wed, 28 May 2008, Duncan Coutts wrote: On Wed, 2008-05-28 at 10:22 +0200, Henning Thielemann wrote: On Wed, 28 May 2008, Bulat Ziganshin wrote: Hello Henning, Wednesday, May 28, 2008, 9:51:28 AM, you wrote: We could simulate a list with strict elements, i.e. data StrictList a

[Haskell-cafe] Re: static linking

2008-05-28 Thread Peter Gammie
Hello, Further on my static linking woes: debian ~$ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.8.2 -debian ~$ cat T.hs main :: IO () main = putStrLn Hello world -debian ~$ ghc -optl-static -static --make T.hs Linking T ...

Re: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-28 Thread Ketil Malde
Ketil Malde [EMAIL PROTECTED] writes: You've lost me at least. ...but perhaps I can find my way back on my own? Today, you can choose between Array, with lazy elements, or UArray, with strict elements. Lazy arrays have the elements defined in advance, strict ones have them calculated in

[Haskell-cafe] Benchmarking Framework

2008-05-28 Thread Tom Harper
I am in the process of writing a library for my MSc dissertation and would like to do some benchmarking. In doing so I need to compare the time and space of my library with some other code. Is there a framework for doing so in Haskell, aside from the Profiling tools in GHC? Basically I'm

Re: [Haskell-cafe] Benchmarking Framework

2008-05-28 Thread Ketil Malde
Tom Harper [EMAIL PROTECTED] writes: I am in the process of writing a library for my MSc dissertation and would like to do some benchmarking. In doing so I need to compare the time and space of my library with some other code. Is there a framework for doing so in Haskell, aside from the

Re: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-28 Thread Duncan Coutts
On Wed, 2008-05-28 at 10:22 +0200, Henning Thielemann wrote: On Wed, 28 May 2008, Bulat Ziganshin wrote: Hello Henning, Wednesday, May 28, 2008, 9:51:28 AM, you wrote: We could simulate a list with strict elements, i.e. data StrictList a = Elem !a (StrictList a) | End

[Haskell-cafe] Re: static linking

2008-05-28 Thread Simon Marlow
Peter Gammie wrote: Hello, Further on my static linking woes: debian ~$ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.8.2 -debian ~$ cat T.hs main :: IO () main = putStrLn Hello world -debian ~$ ghc -optl-static -static --make T.hs Linking T ...

[Haskell-cafe] Re: Examples of using Haskell for mathematics

2008-05-28 Thread Jose A. Ortega Ruiz
Brent Yorgey [EMAIL PROTECTED] writes: Hi all! In a couple weeks I will be giving a short (15-min.) talk to an audience of mostly mathematicians, entitled Executable Mathematics: A Whirlwind Introduction to Haskell. The idea will be to give a flavor of Haskell, its uniquenesses, and why it

Re: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-28 Thread Ketil Malde
Henning Thielemann [EMAIL PROTECTED] writes: We could simulate a list with strict elements, i.e. data StrictList a = Elem !a (StrictList a) | End by an unboxed array with a cursor to the next element to be evaluated and a function that generates the next element. [...] looks like

Re: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-28 Thread Henning Thielemann
On Wed, 28 May 2008, Ketil Malde wrote: Bulat Ziganshin [EMAIL PROTECTED] writes: well, i don't understand difference between your idea and lazybs implementation HT said earlier that: This would still allow the nice tricks for recursive Fibonacci sequence definition. Which I guess

Re: [Haskell-cafe] Type Coercion

2008-05-28 Thread Abhay Parvate
To add to this: There are other constants which are polymorphic, not only numbers. Examples where you could add type signatures to make the type explicit are the empty list '[]' and the 'Nothing' constructor of 'Maybe a'. Adding type signatures to these will not be type casts, but telling the

Re: [Haskell-cafe] So how do people pronounce 'cabal' around here?

2008-05-28 Thread Darrin Thompson
2008/5/28 Clifford Beshers [EMAIL PROTECTED]: But if you say it that way, you get kicked out of the cabal. I thought the first rule was There is no cabal. Oh wait, that's Debian. Oh wait... aa! -- Darrin ___ Haskell-Cafe mailing list

[Haskell-cafe] is there some book about haskell and data struct and alg?

2008-05-28 Thread smellcode
is there some book about haskell and data struct and alg? i mean data struct and algorithm in haskell i am freshman i want to study haskell with data struct and alg -- Hu Jinpu (nickname: smellcode) Web developer email =~ /(^hujinpu)\@(gmail)\.(com)$/ or email.gsub!(/hujinpu/, 'smellcode')

Re: [Haskell-cafe] is there some book about haskell and data struct and alg?

2008-05-28 Thread Iavor Diatchki
Hi, Purely Functional Data Structures by Chris Okasaki is a good one. Here is a link to it on Amazon: http://www.amazon.com/Purely-Functional-Structures-Chris-Okasaki/dp/0521663504 Good luck! -Iavor 2008/5/28 smellcode [EMAIL PROTECTED]: is there some book about haskell and data struct and

Re: [Haskell-cafe] is there some book about haskell and data struct and alg?

2008-05-28 Thread Loup Vaillant
2008/5/28 Iavor Diatchki [EMAIL PROTECTED]: Hi, Purely Functional Data Structures by Chris Okasaki is a good one. Here is a link to it on Amazon: http://www.amazon.com/Purely-Functional-Structures-Chris-Okasaki/dp/0521663504 Good luck! -Iavor Argh, I'm predated by a few seconds! :-) Before

Re: [Haskell-cafe] is there some book about haskell and data struct and alg?

2008-05-28 Thread Richard Kelsall
smellcode wrote: is there some book about haskell and data struct and alg? i mean data struct and algorithm in haskell i am freshman i want to study haskell with data struct and alg I expect this is obvious, but just in case, there is a list here http://haskell.org/haskellwiki/Books which

Re: [Haskell-cafe] Benchmarking Framework

2008-05-28 Thread Marc Weber
On Wed, May 28, 2008 at 11:41:34AM +0100, Tom Harper wrote: I am in the process of writing a library for my MSc dissertation and would like to do some benchmarking. In doing so I need to compare the time and space of my library with some other code. Is there a framework for doing so in

Re: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-28 Thread Don Stewart
lemming: I wonder whether the following idea has been investigated or implemented somewhere: We could simulate a list with strict elements, i.e. data StrictList a = Elem !a (StrictList a) | End I've used the above structure itself, as a useful alternative to fully lazy lists.

Re: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-28 Thread Henning Thielemann
On Wed, 28 May 2008, Ketil Malde wrote: Ketil Malde [EMAIL PROTECTED] writes: You've lost me at least. ...but perhaps I can find my way back on my own? Today, you can choose between Array, with lazy elements, or UArray, with strict elements. ... and ByteStrings, where in principle the

Re: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-28 Thread Henning Thielemann
On Wed, 28 May 2008, Don Stewart wrote: by an unboxed array with a cursor to the next element to be evaluated and a function that generates the next element. Whenever an element with an index beyond the cursor is requested, sufficiently many new elements are written to the array and the

Re: [Haskell-cafe] Type Coercion

2008-05-28 Thread Andrew Coppin
PR Stanley wrote: Hi (16 :: Float) is a perfectly legitimate statement although I'm surprised that it's allowed in a type strong language such as Haskell. It's a bit like casting in good old C. What's going on here? It's not a type cast, it's a class method: class Num n where ...

Re: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-28 Thread Andrew Coppin
Bulat Ziganshin wrote: Hello Henning, looks like lazy.bytestring generalized to any a That sounds like a darn useful thing to have... [OTOH, currently unboxed arrays are available only for a select few types, so good luck implementing this in a clean way!]

Re: [Haskell-cafe] Re: Aren't type system extensions fun? [Further insight]

2008-05-28 Thread Andrew Coppin
Luke Palmer wrote: When you're reasoning about this, I think it would help you greatly to explicitly put in *all* the foralls. In haskell, when you write, say: map :: (a - b) - [a] - [b] All the free variables are *implicitly* quantified at the top level. That is, when you write the above,

Re: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-28 Thread Don Stewart
bulat.ziganshin: Hello Andrew, Wednesday, May 28, 2008, 10:37:47 PM, you wrote: looks like lazy.bytestring generalized to any a That sounds like a darn useful thing to have... well, support on only Word8 as base type isn't some fundamental limit, just creators of bytestring package was

Re: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-28 Thread Ketil Malde
Don Stewart [EMAIL PROTECTED] writes: http://code.haskell.org/~dons/uvector http://code.haskell.org/~dons/code/uvector (I presume? The other URL gives a 404) -k -- If I haven't seen further, it is by standing in the footprints of giants ___

[Haskell-cafe] An alternative break

2008-05-28 Thread Pieter Laeremans
Hello, I need a break function that splits the list one element further than the ordinary break. This is the simplest solution I could imagine: breakI :: (a - Bool) - [a] - ([a], [a]) breakI p s = case break p s of ([], []) - ([], []) (x, []) - (x, [])

Re: [Haskell-cafe] An alternative break

2008-05-28 Thread Philip Weaver
On Wed, May 28, 2008 at 2:53 PM, Pieter Laeremans [EMAIL PROTECTED] wrote: Hello, I need a break function that splits the list one element further than the ordinary break. This is the simplest solution I could imagine: breakI :: (a - Bool) - [a] - ([a], [a]) breakI p s = case break p s of

Re: [Haskell-cafe] An alternative break

2008-05-28 Thread Joachim Breitner
Hi, Am Mittwoch, den 28.05.2008, 23:53 +0200 schrieb Pieter Laeremans: Hello, I need a break function that splits the list one element further than the ordinary break. This is the simplest solution I could imagine: breakI :: (a - Bool) - [a] - ([a], [a]) breakI p s = case break p s of

Re: [Haskell-cafe] Re: Aren't type system extensions fun? [Further insight]

2008-05-28 Thread Lennart Augustsson
These things become easier if you are explicit about type applications (which Haskell isn't). Phillippa mentioned it in an earlier post, but here it is again. First the old stuff, if you have a term of type (S-T) then the (normal form of) term must be (\ x - e), where x has type S and e has type

Re: [Haskell-cafe] Re: Aren't type system extensions fun? [Further insight]

2008-05-28 Thread Ryan Ingram
On 5/28/08, Isaac Dupree [EMAIL PROTECTED] wrote: Andrew Coppin wrote: Finally, that seems to make actual sense. I have one final question though: forall x, y. x - y - Z forall x. x - (forall y. y - Z) Are these two types the same or different? [Ignoring for a moment the obvious

[Haskell-cafe] ambiguous constraint errors

2008-05-28 Thread Evan Laforge
I have two related questions: #1 I'm getting some annoying type errors that I don't fully understand, and wind up having to do a workaround that I don't totally like. Here's a simplified version of my situation: data Ambi m = Ambi { ambi_monad :: m Int , ambi_int :: Int } some_ambi

Re: [Haskell-cafe] So how do people pronounce 'cabal' around here?

2008-05-28 Thread Richard A. O'Keefe
On 28 May 2008, at 1:04 pm, Dan Piponi wrote: In particular, which syllable gets the stress, and what are the lengths of the two vowels? Couldn't find anything in the FAQ (http://www.haskell.org/haskellwiki/Cabal/FAQ). I've always pronounced it k'BAHL, but was surprised to find that the OED

Re: [Haskell-cafe] is there some book about haskell and data struct and alg?

2008-05-28 Thread Benjamin L. Russell
Although all the source code for the pdf version (http://www.cs.cmu.edu/~rwh/theses/okasaki.pdf) of Purely Functional Data Structures is provided in Standard ML, not Haskell, I found a broken link to the supposedly equivalent Haskell source code on Books - HaskellWiki

[Haskell-cafe] type-level integers using type families

2008-05-28 Thread Peter Gavin
Has anyone else tried implementing type-level integers using type families? I tried using a couple of other type level arithmetic libraries (including type-level on Hackage) and they felt a bit clumsy to use. I started looking at type families and realized I could pretty much build an entire