In principle I can do this, but:
1. how do I hide the import of show String to replace it w/ my own?
2. If I do replce show String what else will break?
3. If instead I define an eshow function that strips "", how do I minimize
the perforamnce hit of quote stripping?
4. If I want to share my code,
> > Alex, you might want to explain to people (such as myself)
> > who don't know how Perl etc decide how much white space to insert
> > in the string that's broken across a line. One space? None?
> > What of the indentation spaces on the new line? What if
> > you really want those spaces to a
I've been using a preprocessor to Haskell that I call HacWrite, which
adds a new kind of string appropriate for entering text. Such strings
can span multiple lines and can be escaped using curly brackets:
var1 = 2*2
var2 = 4*var1
var3 = «Foobar»
sqlstring = «insert into mytable values
On 8 Jun, Paul Hudak wrote:
> show x should be a string that when printed looks like the value that
> you would have to type to generate it directly. This example is most
> instructive:
[...]
and this is just cute:
main = putStr (quine q)
quine s = s ++ show s
q = "main = putStr (quine q)\
--6TrnltStXW4iwmi0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Tue Jun 08 1999, S. Alexander Jacobson ->
: Fair enough, but then the function should not be called show. The spec
: for show here is an internal serialization format. I guess the right
:
Anatoli Tubman:
> How can I *efficiently* print (i.e. find the decimal, or in
> general N-ary, representation of) large Integers, like factorial of 1?
>
> The implementation of showInt taken from Standard Prelude:
...
> (2) crawls like hell (when fixed with strictness).
> I don't kno
python, does something similar.. they have a """ which allows pre-formated text.
so you can do (psuedo-code)...
string license = """
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 33
"S. Alexander Jacobson" wrote:
> HacWrite certainly seems like an improvement over Haskell.
> However, it is just not as good as the scripting languages.
> HacWrite still requires the author to differentiate between strings and
> other types, still requires explicit use of show and still requires
HacWrite certainly seems like an improvement over Haskell.
However, it is just not as good as the scripting languages.
HacWrite still requires the author to differentiate between strings and
other types, still requires explicit use of show and still requires more
typing and curly balancing. Isn't
Anatoli Tubman wrote:
> How can I *efficiently* print (i.e. find the decimal, or in
> general N-ary, representation of) large Integers, like factorial of 1?
Use hbc? It uses the gmp routine to convert an Integer to a String.
Converting 1! to a String takes much less time than computing
To my
>> People say, that the transformations like x - x -> 0 :: Integer
>> are hardly ever applicable, because x may occur `undefined'.
Fergus Henderson <[EMAIL PROTECTED]> writes
> This issue was already resolved -- someone already mentioned the solution.
> But obviously you missed i
> Alex, you might want to explain to people (such as myself)
> who don't know how Perl etc decide how much white space to insert
> in the string that's broken across a line. One space? None?
> What of the indentation spaces on the new line? What if
> you really want those spaces to appear in t
eshow needs to apply to show to non string types.
-Alex-
___
S. Alexander Jacobson Shop.Com
1-212-697-0184 voiceThe Easiest Way To Shop
On Tue, 8 Jun 1999, Martin Norb{ck wrote:
> Tue Jun 08 1
On Tue, 8 Jun 1999, Paul Hudak wrote:
> I agree that Haskell's string notation could be improved, but note that
> you could write:
>
> > sqlstring1 = "insert into mytable values \
> > \(NULL,'"#var1++"','"#(var1+var2)++"','"++var3++"')"
>
That is arguably even more ugly than just consistently
> > var1 = 2*2
> > var2 = 4*var1
> > var3 = "Foobar""
> > sqlstring = "insert into mytable values "++
> > "(NULL,'"++(show var1)++"','"++(show var2)++"','"++var3"');"
>
> It would be much nicer if Haskell did what perl,php, and tcl do:
> > sqlstring="insert into mytable values (NULL,'$var1','$va
On 07-Jun-1999, S.D.Mechveliani <[EMAIL PROTECTED]> wrote:
> One more question on the program simplification and `bottom'.
>
> People say, that the transformations like x - x -> 0 :: Integer
> are hardly ever applicable, because x may occur `undefined'.
This issue was already resolved --
16 matches
Mail list logo