
encryptionTooSimple d = "This encryption key is too simple (must be at least " ++(show (d::Integer))++ characters long)"
- i don't like separating the string from the code for simple strings
if you don't extract the string, how can it be a parameter of/variable in your application?
- do you really suggest giving this translators? You can be sure it won't compile any more ;p
actually, this version seems to come from an out-of-date editor
buffer (missing quote).. it won't compile!-)
<GRIPE>
one thing I really don't like about Haskell is it's lacking
support for HERE documents, as you'll find them in shells or
in Perl. Am I the only one who's constantly bitten by this?
</GRIPE>
<ROUGH SUGGESTION>
Something like:
encryptionTooSimple :: Integer -> String
encryptionTooSimple d = <

"C.Reinke"
encryptionTooSimple d = "This encryption key is too simple (must be at least " ++(show (d::Integer))++ characters long)"
- i don't like separating the string from the code for simple strings
if you don't extract the string, how can it be a parameter of/variable in your application?
(GNU) C uses xgettext which extracts the tagged strings. All you have to do to i18n is to replace: printf("This encryption key ... at least %d ...", ...) with printf(_("This encryption key ... at least %d ..."), ...) [...]
<GRIPE> one thing I really don't like about Haskell is it's lacking support for HERE documents, as you'll find them in shells or in Perl. Am I the only one who's constantly bitten by this? </GRIPE>
<ROUGH SUGGESTION>
Something like:
encryptionTooSimple :: Integer -> String encryptionTooSimple d = <
you have 2 propositions in one: multi-line strings and interpolated strings. * multi-line strings: - either HERE-documents (perl, sh...) - more complicated delimiter alike """ ... """ in python - nestable delimiter alike qq( ... (...) ...) in perl * interpolated strings - dollar marked variable expanded in strings (perl, sh...) - expression in the string alike "1+1 = #{1+1}" in Ruby - not really string interpolation, but there is also the Python way based on highly sugared sprintf Of course, all this can be found at http://merd.net/pixel/language-study/syntax-across-languages.html#Strings :) I think it would be a very nice addition in haskell's syntax
participants (2)
-
C.Reinke
-
Pixel