Re: [Haskell-cafe] How to decide if a number is an integer?

2009-09-29 Thread Jimmy Hartzell
Use properFraction: http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v%3AproperFraction Hi, In other weak-type language, `round i == i` would work. But in haskell, what should I do? Thanks. -- 竹密岂妨流水过 山高哪阻野云飞

Re: [Haskell-cafe] How to decide if a number is an integer?

2009-09-29 Thread Jimmy Hartzell
properFraction l of (_, 0) - l _ - 0 -- always goes here. On Tue, Sep 29, 2009 at 2:18 PM, Jimmy Hartzell j...@shareyourgifts.net wrote: Use properFraction: http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v%3AproperFraction Hi,   In other weak-type language, `round i

Re: [Haskell-cafe] How to decide if a number is an integer?

2009-09-29 Thread Jimmy Hartzell
Did you test the properFraction-based code in isolation? If code is broken, it's important to figure out which part of it is broken. Also, this function is not divided into constituent parts, but is a long unruly mess. Dividing it into parts would make it much much more readable, and you would

Re: [Haskell-cafe] How to decide if a number is an integer?

2009-09-29 Thread Jimmy Hartzell
On Tue, Sep 29, 2009 at 3:07 PM, Jimmy Hartzell j...@shareyourgifts.net wrote: Did you test the properFraction-based code in isolation? If code is broken, it's important to figure out which part of it is broken. Also, this function is not divided into constituent parts, but is a long unruly

Re: [Haskell-cafe] accessible layout proposal?

2009-09-23 Thread Jimmy Hartzell
visibly accessible. Jimmy Hartzell ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] accessible layout proposal?

2009-09-23 Thread Jimmy Hartzell
I am a bit puzzled here. This seems to mean something like If you take readable code using an operator you can make it less readable, and when you do that you create another problem as well, and an even less readable hack can fix that. I know an old lady who swallowed a fly...

[Haskell-cafe] accessible layout proposal?

2009-09-22 Thread Jimmy Hartzell
be willing to help undertake a project to patch ghc to support it? Alternatively, you can try to talk me out of liking the proposal so much, but that is much less likely to work. Jimmy Hartzell ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] accessible layout proposal?

2009-09-22 Thread Jimmy Hartzell
On Sep 22, 2009, at 8:01 PM, Jimmy Hartzell wrote: I am in love with this proposal: http://www.haskell.org/haskellwiki/Accessible_layout_proposal I hadn't read it before. Now that I have, I really do not like it. Syntactic sugar causes cancer of the semicolon as Alan Perlis once said

Re: [Haskell-cafe] accessible layout proposal?

2009-09-22 Thread Jimmy Hartzell
Daniel Fischer wrote: Or, what I do: concat [ ( , str , ) ] This is a lot better, true, but it still takes a lot of typing, and the first element is now special-cased, preventing easy copy-and-paste (although, admittedly, much less opportunity for mistake). On a more

Re: [Haskell-cafe] accessible layout proposal?

2009-09-22 Thread Jimmy Hartzell
Richard O'Keefe wrote: After all, someone might have started with ( ( ++ str ++ ) ) and ended up with ( ( ++ str ++ ) -- (oops, no ++!) lineEnd -- forgot I needed this ) I asked for the trailing

Re: [Haskell-cafe] accessible layout proposal?

2009-09-22 Thread Jimmy Hartzell
Am Mittwoch 23 September 2009 04:06:11 schrieb Jimmy Hartzell: Daniel Fischer wrote: Or, what I do: concat [ ( , str , ) ] You're right: my objections to this seem mostly to be matters of taste -- as I think about it, I find fewer and fewer practical reasons