RE: [Haskell-cafe] Re: map (-2) [1..5]

2006-09-11 Thread Simon Peyton-Jones
| Well, it seems a shame that we don't have postfix operators already. | I guess that means I am arguing we should introduce a unary postfix | operator, and not even have sugar for factorial, as it conflicts with | array access. | | We *almost* do: | Hugs.Base let (!) 0 = 1; (!) x = x*((!) (x-1))

Re: [Haskell-cafe] HaXml and ghci unresolved symbol

2006-09-11 Thread Malcolm Wallace
Andrea Rossato [EMAIL PROTECTED] wrote: So, I'm not able to create an object file (dynamically) linked to HaXml. This is the reason why hxml doesn't work with ghc (and ghci) but works perfectly with hugs. Now, I don't know whether I should contact the HaXml author or submit a bug report

Re: [Haskell-cafe] HaXml and ghci unresolved symbol

2006-09-11 Thread Udo Stenzel
Andrea Rossato wrote: It seems related to dynamic linking: I created a separated module (Xml.hs) that imports Text.XML.HaXml and parses a xml string. I then created a file (xml.hs) that imports Xml and prints name, defined in Xml.hs. The expected output should be elementTest. Whatever it is,

Re: [Haskell-cafe] HaXml and ghci unresolved symbol

2006-09-11 Thread Andrea Rossato
Il Mon, Sep 11, 2006 at 11:30:41AM +0200, Udo Stenzel ebbe a scrivere: Whatever it is, I cannot reproduce any of your problems. I installed HaXml-1.13.2 from source using Cabal, and both ghc -c Xml.hs and ghc --make xml.hs work as expected, even without the -package switch. This is GHC 6.4.1

Re: [Haskell-cafe] Slow IO

2006-09-11 Thread Daniel Fischer
Am Sonntag, 10. September 2006 02:29 schrieben Sie: Hello, Try Don Stewart's ByteString library (http://www.cse.unsw.edu.au/~dons/fps.html). It is much faster than the standard Haskell IO and now has lazy. -Jeff Yay, that's really an improvement! Depending on the size of the file/graph

[Haskell-cafe] Argument order of expNat (Was: map (-2) [1..5])

2006-09-11 Thread Henning Thielemann
On Sat, 9 Sep 2006, Brian Hulley wrote: negate (expNat 4 2) because this would free the ^ symbol for some more widely applicable use, and would also make the particular choice of exponentiation operator more explicit Agreed, though I'd want expt to be part of a typeclass

[Haskell-cafe] Numeric type classes (Was: map (-2) [1..5])

2006-09-11 Thread Henning Thielemann
On Sat, 9 Sep 2006, Ross Paterson wrote: On Sat, Sep 09, 2006 at 12:57:56AM -0400, Cale Gibbard wrote: Num itself needs to be split, but we can't do it sanely without something like class aliases. I think that a finer grain numeric hierarchy, while retaining Num, etc, is feasible

[Haskell-cafe] Type class hierarchy for floats (Was: map (-2) [1..5])

2006-09-11 Thread Henning Thielemann
On Sat, 9 Sep 2006, Jón Fairbairn wrote: Aaron Denney [EMAIL PROTECTED] writes: On 2006-09-08, Jón Fairbairn [EMAIL PROTECTED] wrote: Why shouldn't Naturals be more primitive than Integers? Certainly they're more primitive. Too primitive to have reasonable algebraic properties.

Re: [Haskell-cafe] Re: map (-2) [1..5]

2006-09-11 Thread Henning Thielemann
On Sun, 10 Sep 2006, Aaron Denney wrote: Of course, there's always a typeclass, where we could add all sorts of other encodings of the Peano axioms, such as binary trees,, but I don't see that that buys us much if we don't also get access to operations beyond them, such as (an

[Haskell-cafe] Re: Re[2]: [Haskell] Proposal: unification of style of function/data/type/class definitions

2006-09-11 Thread Taral
On 9/11/06, Bulat Ziganshin [EMAIL PROTECTED] wrote: Expr Bool = Eq (Expr t) (Expr t) | forall t . Eq t Still confusing, but less so. The problem is that it's really backwards. The symbol being defined is Eq. Eq (Expr t) (Expr t) | Eq t = Expr Bool but that doesn't fit well, does it?

[Haskell-cafe] Re: Argument order of expNat (Was: map (-2) [1..5])

2006-09-11 Thread Aaron Denney
On 2006-09-11, Henning Thielemann [EMAIL PROTECTED] wrote: On Sat, 9 Sep 2006, Brian Hulley wrote: negate (expNat 4 2) because this would free the ^ symbol for some more widely applicable use, and would also make the particular choice of exponentiation operator more explicit

Re[2]: [Haskell-cafe] Slow IO

2006-09-11 Thread Bulat Ziganshin
Hello Daniel, Monday, September 11, 2006, 6:05:38 PM, you wrote: The problem spec states that the input file contains about 500 test cases, each given by between 1 and 100,000 lines, each line containing a single word of between 2 and 1000 letters. So the file should be about 12.5G on

[Haskell-cafe] Re: Numeric type classes (Was: map (-2) [1..5])

2006-09-11 Thread Ross Paterson
On Mon, Sep 11, 2006 at 04:26:30PM +0200, Henning Thielemann wrote: On Sat, 9 Sep 2006, Ross Paterson wrote: I think that a finer grain numeric hierarchy, while retaining Num, etc, is feasible without changing the language: unlike the case of monads, the people who will be defining

[Haskell-cafe] Re: evaluate vs seq

2006-09-11 Thread apfelmus
Hello Michael, you are correct. Only * (a `seq` return a) = evaluate a *right now*, then produce an IO action which, when executed, returns the result of evaluating a. Thus, if a is undefined, throws an exception right now. is a bit misleading as there is no evaluation right now. It's

Re: [Haskell-cafe] Re: Re[2]: [Haskell] Proposal: unification of styleof function/data/type/class definitions

2006-09-11 Thread Brian Hulley
Taral wrote: On 9/11/06, Bulat Ziganshin [EMAIL PROTECTED] wrote: Expr Bool = Eq (Expr t) (Expr t) | forall t . Eq t Still confusing, but less so. The problem is that it's really backwards. The symbol being defined is Eq. Eq (Expr t) (Expr t) | Eq t = Expr Bool but that doesn't fit

[Haskell-cafe] Re: map (-2) [1..5]

2006-09-11 Thread Aaron Denney
On 2006-09-10, Neil Mitchell [EMAIL PROTECTED] wrote: Hi, I think in practice this wouldn't really be an issue. When you're using natural numbers, you tend to be in a situation where you're either numbering things statically, and not doing any calculations with them, or you're using them as

[Haskell-cafe] Re: map (-2) [1..5]

2006-09-11 Thread Aaron Denney
On 2006-09-11, Simon Peyton-Jones [EMAIL PROTECTED] wrote: | Well, it seems a shame that we don't have postfix operators already. Actually, the up-coming GHC 6.6 does allow this. Awesome. -- Aaron Denney -- ___ Haskell-Cafe mailing list

Re: Re: [Haskell-cafe] Slow IO

2006-09-11 Thread Tom Phoenix
On 9/11/06, Daniel Fischer [EMAIL PROTECTED] wrote: The problem spec states that the input file contains about 500 test cases, each given by between 1 and 100,000 lines, each line containing a single word of between 2 and 1000 letters. So the file should be about 12.5G on average. I don't

[Haskell-cafe] Re: map (-2) [1..5]

2006-09-11 Thread Aaron Denney
On 2006-09-11, Henning Thielemann [EMAIL PROTECTED] wrote: On Sun, 10 Sep 2006, Aaron Denney wrote: Of course, there's always a typeclass, where we could add all sorts of other encodings of the Peano axioms, such as binary trees,, but I don't see that that buys us much if we don't also

[Haskell-cafe] Re: Numeric type classes (Was: map (-2) [1..5])

2006-09-11 Thread Aaron Denney
On 2006-09-11, Henning Thielemann [EMAIL PROTECTED] wrote: On Sat, 9 Sep 2006, Ross Paterson wrote: On Sat, Sep 09, 2006 at 12:57:56AM -0400, Cale Gibbard wrote: Num itself needs to be split, but we can't do it sanely without something like class aliases. I think that a finer grain

Re: [Haskell-cafe] Re: Re[2]: [Haskell] Proposal: unification of styleof function/data/type/class definitions

2006-09-11 Thread Brian Hulley
Taral wrote: On 9/11/06, Bulat Ziganshin [EMAIL PROTECTED] wrote: Expr Bool = Eq (Expr t) (Expr t) | forall t . Eq t Still confusing, but less so. The problem is that it's really backwards. The symbol being defined is Eq. Eq (Expr t) (Expr t) | Eq t = Expr Bool but that doesn't fit

Re: [Haskell-cafe] Re: Re[2]: [Haskell] Proposal: unification of styleof function/data/type/class definitions

2006-09-11 Thread Taral
On 9/11/06, Brian Hulley [EMAIL PROTECTED] wrote: data Expr t = If (Expr Bool) (Expr t) (Expr t) Expr Bool = Eq (Expr t) (Expr t) | Eq t Expr Int = Lit Int Meh. I'm still not big on it, since in a normal function, the guard is based on a

[Haskell-cafe] Heap profiling

2006-09-11 Thread Mark Goldman
Does anyone know if there is a way around the 20 charachter identifier limitation when heap profiling? I have a number of identifiers that indistinguishably break that limit. -mdg -- Our problems are mostly behind us, now all we have to do is fight the solutions.

Re: [Haskell-cafe] Heap profiling

2006-09-11 Thread Donald Bruce Stewart
bitshifter: Does anyone know if there is a way around the 20 charachter identifier limitation when heap profiling? I have a number of identifiers that indistinguishably break that limit. Add custom {-# SCC mybetteridentifier #-} pragmas next to the places with overly long names? -- Don