Re: [Haskell-cafe] instance Enum Double considered not entirely great?

2011-09-26 Thread Evan Laforge
On Mon, Sep 26, 2011 at 10:50 AM, Chris Smith wrote: > On Mon, 2011-09-26 at 18:53 +0200, Lennart Augustsson wrote: >> If you do [0.1, 0.2 .. 0.3] it should leave out 0.3.  This is floating >> point numbers and if you don't understand them, then don't use them. >> The current behaviour of .. for f

Re: [Haskell-cafe] instance Enum Double considered not entirelygreat?

2011-09-26 Thread Richard O'Keefe
On 27/09/2011, at 4:55 PM, Chris Smith wrote: > So there are two perspectives here. One is that we should think in > terms of exact values of the type Float, which means we'd want to > exclude it, because it's larger than the top end of the range. The > other is that we should think of approxima

Re: [Haskell-cafe] instance Enum Double considered not entirelygreat?

2011-09-26 Thread Richard O'Keefe
On 27/09/2011, at 3:54 PM, Donn Cave wrote: > Quoth "Richard O'Keefe" , > > [ ... re " Why would you write > an upper bound of 0.3 on a list if you don't expect that to be included > in the result? " ] > >> Because upper bounds are *UPPER BOUNDS* and are NOT as a rule included >> in the res

[Haskell-cafe] A Crypto-API-Tests package

2011-09-26 Thread Thomas DuBuisson
FYI, since I figure you three are the ones interested in this right now: I'll be releasing crypto-api-tests [1] to hackage someday (this weekend?). If you want to give it a spin or add KATS before the first release then feel free. OTOH, it's not like I'd stop accepting patches after release 0.1.

Re: [Haskell-cafe] instance Enum Double considered not entirelygreat?

2011-09-26 Thread Chris Smith
On Mon, 2011-09-26 at 19:54 -0700, Donn Cave wrote: > Pardon the questions from the gallery, but ... I can sure see that > 0.3 shouldn't be included in the result by overshooting the limit > (i.e., 0.30004), and the above expectations about > [0,2..9] are obvious enough, but now I have

Re: [Haskell-cafe] instance Enum Double considered not entirelygreat?

2011-09-26 Thread Donn Cave
Quoth "Richard O'Keefe" , [ ... re " Why would you write an upper bound of 0.3 on a list if you don't expect that to be included in the result? " ] > Because upper bounds are *UPPER BOUNDS* and are NOT as a rule included > in the result. If you write [0,2..9] you > - DO expect 0 in the r

Re: [Haskell-cafe] instance Enum Double considered not entirely great?

2011-09-26 Thread Richard O'Keefe
On 27/09/2011, at 6:50 AM, Chris Smith wrote: > On Mon, 2011-09-26 at 18:53 +0200, Lennart Augustsson wrote: >> If you do [0.1, 0.2 .. 0.3] it should leave out 0.3. This is floating >> point numbers and if you don't understand them, then don't use them. >> The current behaviour of .. for floatin

[Haskell-cafe] Much faster complex monad stack based on CPS state

2011-09-26 Thread Nicu Ionita
Hello list, Starting from this emails (http://web.archiveorange.com/archive/v/nDNOvSM4JT3GJRSjOm9P) I could refactor my code (a UCI chess engine, with complex functions, in which the search has a complex monad stack) to run twice as fast as with even some hand unroled state transformer! So fr

Re: [Haskell-cafe] mapM is supralinear?

2011-09-26 Thread Arseniy Alekseyev
Garbage collection takes amortized O(1) per allocation, doesn't it? On 26 September 2011 18:00, Lennart Augustsson wrote: > You seem to ignore garbage collection. > > On Sat, Sep 24, 2011 at 6:40 AM, Arseniy Alekseyev > wrote: >> >> > Apparently it doesn't, and it seems to be fixed now. >> >> Do

Re: [Haskell-cafe] instance Enum Double considered not entirely great?

2011-09-26 Thread Richard O'Keefe
On 26/09/2011, at 11:08 AM, Daniel Fischer wrote: > > And: distinguish NaNs or identify them all? > I lean towards identifying them all, I've never cared for whether they come > from 0/0, Infinity - Infinity or what, but I could be convinced. There are very many bit patterns that count as NaNs,

Re: [Haskell-cafe] which tags program should I use?

2011-09-26 Thread Claus Reinke
suggests using :etags in GHCI or hasktags, or gasbag. Of the three, hasktags comes closest to "working" but it has (for me) a major inconvenience, namely it finds both function definitions and type signatures, resulting in two TAGS entries such as: Some customization required? Tweaking the outp

Re: [Haskell-cafe] which tags program should I use?

2011-09-26 Thread Erik Hesselink
I use hothasktags [1] which works very well. The only problems are sometimes with obscure extensions, where haskell-src-exts (which hothasktags uses) can't parse the file, but that happens very rarely. Regarding speed: it takes 2-3 s on about 250 source files totaling about 25000 lines on my lapto

Re: [Haskell-cafe] which tags program should I use?

2011-09-26 Thread Evan Laforge
> suggests using :etags in GHCI or hasktags, or gasbag.  Of the three, > hasktags comes closest to "working" but it has (for me) a major > inconvenience, namely it finds both function definitions and type > signatures, resulting in two TAGS entries such as: > > ./Main.hs,63 > module Main where 6,7

[Haskell-cafe] Build local-gc branch of GHC

2011-09-26 Thread Andreas Voellmy
Hi, I've been trying to get and build a branch of ghc that includes the new local GC algorithm ( http://www.haskell.org/pipermail/cvs-ghc/2011-June/062748.html), but I haven't been able to build it successfully. Here is what I've done: 1. Got the latest source tree using these commands: $ git cl

Re: [Haskell-cafe] instance Enum Double considered not entirely great?

2011-09-26 Thread Chris Smith
On Mon, 2011-09-26 at 18:52 +0300, Yitzchak Gale wrote: > Chris Smith wrote: > > class Ord a => Range a where... > > Before adding a completely new Range class, I would suggest > considering Paul Johnson's Ranged-sets package: Well, my goal was to try to find a minimal and simple answer that does

Re: [Haskell-cafe] instance Enum Double considered not entirely great?

2011-09-26 Thread Chris Smith
On Mon, 2011-09-26 at 18:53 +0200, Lennart Augustsson wrote: > If you do [0.1, 0.2 .. 0.3] it should leave out 0.3. This is floating > point numbers and if you don't understand them, then don't use them. > The current behaviour of .. for floating point is totally broken, IMO. I'm curious, do you

Re: [Haskell-cafe] mapM is supralinear?

2011-09-26 Thread Lennart Augustsson
You seem to ignore garbage collection. On Sat, Sep 24, 2011 at 6:40 AM, Arseniy Alekseyev < arseniy.alekse...@gmail.com> wrote: > > Apparently it doesn't, and it seems to be fixed now. > > Does anyone know what exactly the bug was? Because this seems like a > serious bug to me. I've run into it m

Re: [Haskell-cafe] instance Enum Double considered not entirely great?

2011-09-26 Thread Lennart Augustsson
I totally agree with you. Haskell is very broken when it comes to [x..y] for floating point. It's an attempt to make it more "friendly" for naive users, but there is no way FP can be made friendly. Any such attempts will fail, so make it usable for people who understand FP instead. -- Lennart

Re: [Haskell-cafe] instance Enum Double considered not entirely great?

2011-09-26 Thread Lennart Augustsson
If you do [0.1, 0.2 .. 0.3] it should leave out 0.3. This is floating point numbers and if you don't understand them, then don't use them. The current behaviour of .. for floating point is totally broken, IMO. -- Lennart On Fri, Sep 23, 2011 at 6:06 AM, Chris Smith wrote: > On Fri, 2011-09-

Re: [Haskell-cafe] Attoparsec: Limiting Parsers to N Bytes, or Combing Parsers?

2011-09-26 Thread Yitzchak Gale
Evan Laforge wrote: >> hex2 = (+)<$>  ((*16)<$>  higit)<*>  higit >> higit = subtract (fromEnum '0')<$>  satisfy isHexDigit >> color = Color<$>  hex2<*>  hex2<*>  hex2 Twan van Laarhoven wrote: > How is "subtract (fromEnum '0')" supposed to convert a hex digit to an Int > or Word8? I think you nee

Re: [Haskell-cafe] instance Enum Double considered not entirely great?

2011-09-26 Thread Yitzchak Gale
Chris Smith wrote: > class Ord a => Range a where... Before adding a completely new Range class, I would suggest considering Paul Johnson's Ranged-sets package: http://hackage.haskell.org/package/Ranged-sets Ranges have many more natural operations, and interactions with other classes, than you

Re: [Haskell-cafe] Attoparsec: Limiting Parsers to N Bytes, or Combing Parsers?

2011-09-26 Thread Twan van Laarhoven
On 24/09/11 05:21, Evan Laforge wrote: hex2 = (+)<$> ((*16)<$> higit)<*> higit higit = subtract (fromEnum '0')<$> satisfy isHexDigit color = Color<$> hex2<*> hex2<*> hex2 How is "subtract (fromEnum '0')" supposed to convert a hex digit to an Int or Word8? I think you need digitToInt (or

[Haskell-cafe] Job opportunities at Citrix Systems (Cambridge, UK)

2011-09-26 Thread Mike McClurg
Hi folks, I just wanted to let everyone know that Citrix is hiring developers to work on the OCaml-based XenAPI toolstack. We are looking to recruit top-class engineers to work on the toolstack; applicants must have a good knowledge of data structures and algorithms, experience of programming in

Re: [Haskell-cafe] instance Enum Double considered not entirely great?

2011-09-26 Thread Richard O'Keefe
On 23/09/2011, at 4:06 PM, Chris Smith wrote: > On Fri, 2011-09-23 at 11:02 +1200, Richard O'Keefe wrote: >> I do think that '..' syntax for Float and Double could be useful, >> but the actual definition is such that, well, words fail me. >> [1.0..3.5] => [1.0,2.0,3.0,4.0] Why did anyone ev