Re: [Haskell-cafe] Binary constants in Haskell

2007-10-25 Thread Ketil Malde
Don Stewart [EMAIL PROTECTED] writes: Are there binary constants in Haskell, as we have, for instance, 0o232 for octal and 0xD29A for hexadecimal? No, though it is an interesting idea. Presumably it is less common since octal and hexadecimal are more compact and almost as easy to interpret

Re: [Haskell-cafe] Binary constants in Haskell

2007-10-25 Thread Josef Svenningsson
On 10/24/07, Neil Mitchell [EMAIL PROTECTED] wrote: Hi Are there binary constants in Haskell, as we have, for instance, 0o232 for octal and 0xD29A for hexadecimal? No, though it is an interesting idea. You can get pretty close with existing Haskell though: (bin 100010011)

Re: [Haskell-cafe] Binary constants in Haskell

2007-10-25 Thread Dusan Kolar
Hello all, // PLS, no flame I think the question was not whether there's a way, how to handle the problem of encryption of a binary number to anything suitable and, more or less, readable by a human and transforming it to a binary form, but whether there's such a literal or not and whether

Re: [Haskell-cafe] Binary constants in Haskell

2007-10-25 Thread Ketil Malde
Dusan Kolar [EMAIL PROTECTED] writes: // PLS, no flame I apologize if my post came across as such, that was certainly not the intent. I think the question was [..] whether there's such a literal or not and whether it is bad idea to have something like 0b10111011. I agree. From my point

Re: [Haskell-cafe] Binary constants in Haskell

2007-10-25 Thread Iavor Diatchki
Hi, We have no binary literals in Haskell and there are situations when it would have been useful to have this feature (e.g., if the spec of something that you are working with is already provided using this notation). While it may be useful to have overloaded binary literals in the usual

Re: [Haskell-cafe] Binary constants in Haskell

2007-10-25 Thread Stefan O'Rear
On Thu, Oct 25, 2007 at 02:40:36PM +0200, Josef Svenningsson wrote: On 10/24/07, Neil Mitchell [EMAIL PROTECTED] wrote: Hi Are there binary constants in Haskell, as we have, for instance, 0o232 for octal and 0xD29A for hexadecimal? No, though it is an interesting idea.

Re: [Haskell-cafe] Binary constants in Haskell

2007-10-25 Thread Claus Reinke
From my point of view, the difference between 0b10111011 and (bin[1,0,1,1,1,0,1,1]) is 22-10 that is 12 characters. how about using ghc's new overloaded strings for this? 10111011::Binary there used to be a way to link to ghc head's docs, but i can't find it right now. the test is

Re: [Haskell-cafe] Binary constants in Haskell

2007-10-25 Thread Don Stewart
claus.reinke: From my point of view, the difference between 0b10111011 and (bin[1,0,1,1,1,0,1,1]) is 22-10 that is 12 characters. how about using ghc's new overloaded strings for this? 10111011::Binary there used to be a way to link to ghc head's docs, but i can't find it right

Re: [Haskell-cafe] Binary constants in Haskell

2007-10-25 Thread Don Stewart
dons: claus.reinke: From my point of view, the difference between 0b10111011 and (bin[1,0,1,1,1,0,1,1]) is 22-10 that is 12 characters. how about using ghc's new overloaded strings for this? 10111011::Binary there used to be a way to link to ghc head's docs, but i

Re: [Haskell-cafe] Binary constants in Haskell

2007-10-25 Thread Henning Thielemann
On Thu, 25 Oct 2007, Don Stewart wrote: claus.reinke: how about using ghc's new overloaded strings for this? 10111011::Binary there used to be a way to link to ghc head's docs, but i can't find it right now. the test is

Re: [Haskell-cafe] Binary constants in Haskell

2007-10-25 Thread Henning Thielemann
On Thu, 25 Oct 2007, Stefan O'Rear wrote: On Thu, Oct 25, 2007 at 02:40:36PM +0200, Josef Svenningsson wrote: On 10/24/07, Neil Mitchell [EMAIL PROTECTED] wrote: You can get pretty close with existing Haskell though: (bin 100010011) where bin :: Integer - Integer, and is

Re: [Haskell-cafe] Binary constants in Haskell

2007-10-25 Thread Stefan O'Rear
On Thu, Oct 25, 2007 at 09:41:27PM +0200, Henning Thielemann wrote: Total functions, full laziness, and compile time evaluation of finite non-bottom CAFs... If I write a program that approximates a big but fixed number of digits of Pi - how can we prevent the compiler from computing Pi,

Re: [Haskell-cafe] Binary constants in Haskell

2007-10-25 Thread Henning Thielemann
On Thu, 25 Oct 2007, Stefan O'Rear wrote: On Thu, Oct 25, 2007 at 09:41:27PM +0200, Henning Thielemann wrote: Total functions, full laziness, and compile time evaluation of finite non-bottom CAFs... If I write a program that approximates a big but fixed number of digits of Pi - how

Re: [Haskell-cafe] Binary constants in Haskell

2007-10-25 Thread John Meacham
On Thu, Oct 25, 2007 at 04:06:56PM +0200, Dusan Kolar wrote: Hello all, // PLS, no flame I think the question was not whether there's a way, how to handle the problem of encryption of a binary number to anything suitable and, more or less, readable by a human and transforming it to a

Re: [Haskell-cafe] Binary constants in Haskell

2007-10-25 Thread John Meacham
On Thu, Oct 25, 2007 at 09:52:27AM -0700, Don Stewart wrote: dons: claus.reinke: From my point of view, the difference between 0b10111011 and (bin[1,0,1,1,1,0,1,1]) is 22-10 that is 12 characters. how about using ghc's new overloaded strings for this? 10111011::Binary

Re: [Haskell-cafe] Binary constants in Haskell

2007-10-24 Thread Don Stewart
briqueabraque: Hi, Are there binary constants in Haskell, as we have, for instance, 0o232 for octal and 0xD29A for hexadecimal? No, though it is an interesting idea. -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Binary constants in Haskell

2007-10-24 Thread Neil Mitchell
Hi Are there binary constants in Haskell, as we have, for instance, 0o232 for octal and 0xD29A for hexadecimal? No, though it is an interesting idea. You can get pretty close with existing Haskell though: (bin 100010011) where bin :: Integer - Integer, and is left as an exercise for

Re: [Haskell-cafe] Binary constants in Haskell

2007-10-24 Thread Don Stewart
ndmitchell: Hi Are there binary constants in Haskell, as we have, for instance, 0o232 for octal and 0xD29A for hexadecimal? No, though it is an interesting idea. You can get pretty close with existing Haskell though: (bin 100010011) where bin :: Integer - Integer, and is

Re: [Haskell-cafe] Binary constants in Haskell

2007-10-24 Thread Dan Weston
Prelude read 0o232 :: Int 154 Prelude read 0xD29A :: Int 53914 Prelude Maurí­cio wrote: Hi, Are there binary constants in Haskell, as we have, for instance, 0o232 for octal and 0xD29A for hexadecimal? Thanks, Maurício ___ Haskell-Cafe mailing list