Re: [Haskell-cafe] Unicode strings

2006-11-05 Thread Piotr Kalinowski
Hello,http://repetae.net/repos/jhc/UTF8.hs has some nice functions for UTF-8 - unicode conversions.Regards,-- Intelligence is like a river: the deeper it is, the less noise it makes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Why Haskell?

2006-08-07 Thread Piotr Kalinowski
On 07/08/06, Johan Tibell <[EMAIL PROTECTED]> wrote:
Having someone pay a group of people to hack on Haskellimplementations would indeed be desirable. Without knowing the detailsUbuntu looks like a promising model. If we could just find a willingbillionaire out there...
If I were a billionaire I'd love to sponsor haskell development. Hmm, I'll add it to my goal list ;)Regards,-- Intelligence is like a river: the deeper it is, the less noise it makes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Why Not Haskell?

2006-08-06 Thread Piotr Kalinowski
On 07/08/06, Brian Hulley <[EMAIL PROTECTED]> wrote:
So now Ned, who's a very conscientious person, is faced with an impossiblemoral dilemma, ie a choice between helping Nick establish his business orlosing Homer (who's a bit slow when it comes to matters of conscience) as a
friend.A good friend should not put him in such a position ;)Regards,-- Intelligence is like a river: the deeper it is, the less noise it makes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Why Not Haskell?

2006-08-06 Thread Piotr Kalinowski

On 06/08/06, Brian Hulley <[EMAIL PROTECTED]> wrote:

Therefore I think this distinction between concepts is just sophistry.


The distinction is there and relies on the community and people being
honest to avoid situations as you described. If you don't want it
however (well in this case relying on honesty seems ... naive, to say
the least), you may choose a different license. You're free after all
:)


The system of owners of software encourages
software owners to produce something---
but not what society really needs.
And it causes intangible ethical pollution
that affects us all.

Is this not designed to stir up feelings of guilt in proprietary software
developers? And is it desirable to limit the production of software to "what
society really needs"? Eg I'm glad the Coca-Cola company chooses to produce
Coke because I like drinking it but in no way could it be said that I
actually *need* it, and I wouldn't expect them to reveal their secret recipe
so endless other companies could instantly start competing with them.


The Coke is not the best example. First of all you don't expect that
Coca-Cole gives you right to modify the drink to suit your needs.
Nobody knows even what that would be supposed to mean :)

Secondly, even if Stallman's philosophy is quite idealistic, there is
number of practices in software industry that make ethical doubts
arise (at least when I'm concerned). Yet still it is customers' choice
that they allow to be fooled.


I can't entirely dismiss GNU/FSF/GPL but it poses a fundamental conflict
with the only way I can see of earning a living so it's like a continuous
background problem which drains some of my energy and enthusiasm hence the
length of my rambling post where I made another attempt to understand my
relation to it.


Well, setting aside usefulness of GPL in a commercial world, it did
serve a purpose not allowing anybody to buy out the opensource world
and kill it, didn't it?

Regards,
--
Intelligence is like a river: the deeper it is, the less noise it makes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Compiling To C And Why Not Compiling To Java Or C#?

2006-08-06 Thread Piotr Kalinowski

On 06/08/06, Kaveh Shahbazian <[EMAIL PROTECTED]> wrote:

> how can we decrease Haskell popularity?

Why? Because someone must prevent mean programmers to try Haskell? Or
it is a bit of old holy codex? Or maybe I must feal tired of hearing
newbies questions?


No, no. He meant a mental exercise. You think how you can decrease
popularity. And the you gain insight what not to do. And perhaps you
can increase the popularity doing the exact opposite.

Regards,

--
Intelligence is like a river: the deeper it is, the less noise it makes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Why Not Haskell?

2006-08-06 Thread Piotr Kalinowski

On 06/08/06, Brian Hulley <[EMAIL PROTECTED]> wrote:

Afaict a license such as GPL allows anyone, even a non-programmer, to just
re-distribute whatever application you created because one condition of it
is that anyone should be free to share software with anyone else without
having to pay anything extra to the people who wrote it, and I think this is
essentially based on the notion that software should not be regarded as an
ownable or sellable "thing".


Actually, to the best of my knowledge, based on what Stallman said in
his life and reading the GPL license - it is not about software not
being sellable. The whole notion of open source is not in fact to
distribute it freely, because you can charge a fee for transfering
your work and the license does not impose any restrictions on that fee
(except the case of supplying the source code to someone who received
the work in binary form.)

Instead, the idea is that customers should be able to see the source
code and modify it according to their specific needs without paying
additional fees. And they should be able to distribute those changes.

Perhaps you encountered this: it's free as in freedom, not free as in free beer.

Regards,
Piotr Kalinowski

--
Intelligence is like a river: the deeper it is, the less noise it makes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Compiling To C And Why Not Compiling To Java Or C#?

2006-08-05 Thread Piotr Kalinowski

On 05/08/06, Antonio Cangiano <[EMAIL PROTECTED]> wrote:

Because we are humans and as such, we generally love to share our passions
with other people.
From a less sociological standpoint, a larger user base implies faster
development of interesting projects, more libraries, books, user groups,
conferences, etc...


Yes, yes. I'm simply not sure if making changes only to reach more and
more people is good.


On the other hand, individuals that need to belong to an elite, and the RTFM
crowd, will experience a further frustration to feed their insecure
personality.


I'm afraid I don't understand what you mean. Would you care to elaborate on it?

Regards,
--
Intelligence is like a river: the deeper it is, the less noise it makes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Compiling To C And Why Not Compiling To Java Or C#?

2006-08-05 Thread Piotr Kalinowski

On 05/08/06, Kaveh Shahbazian <[EMAIL PROTECTED]> wrote:

But there must be a way to populize Haskell!


What for?

Regards,
Piotr Kalinowski

--
Intelligence is like a river: the deeper it is, the less noise it makes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Variants of a recursive data structure

2006-08-03 Thread Piotr Kalinowski

On 03/08/06, Piotr Kalinowski <[EMAIL PROTECTED]> wrote:

I'm no expert, but was wondering, why not make labelled AST a tree,
which nodes are tupples holding a node of unlabeled tree and a label ?


Ups, I'm stupid. I guess I should think more before typing anything next time...

Regards,
--
Intelligence is like a river: the deeper it is, the less noise it makes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Variants of a recursive data structure

2006-08-03 Thread Piotr Kalinowski

Hi,

I'm no expert, but was wondering, why not make labelled AST a tree,
which nodes are tupples holding a node of unlabeled tree and a label ?

Regards,
--
Intelligence is like a river: the deeper it is, the less noise it makes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] What is the state if Unicode in Haskell implementations?

2006-07-31 Thread Piotr Kalinowski

On 31/07/06, Bulat Ziganshin <[EMAIL PROTECTED]> wrote:

first solution: http://haskell.org/haskellwiki/Library/Streams


Looks nice. Just a quick question - does it have an equivalent of
read(write)File?

Regards,
--
Intelligence is like a river: the deeper it is, the less noise it makes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] What is the state if Unicode in Haskell implementations?

2006-07-31 Thread Piotr Kalinowski
On 31/07/06, Olof Bjarnason <[EMAIL PROTECTED]> wrote:
1) reading UTF-8 coded text files into unicode-enabled Strings, lets call them UString
2) writing UStrings to UTF-8 coded text files3) using unicode strings in-code, that is in my .hs filesIn case of GHC:String (Char actually) is unicode enabled. The current stable version cannot read UTF-8 encoded source files though (I've written a converter to workaround it - it escapes the national characters). The development version however is capable of reading UTF-8 encoded source files and does encode read strings using unicode.
However - the IO is not aware of Unicode. So in order to do 1) and 2) you have to- read/write stream of bytes encoding text in UTF-8 from/to a file- convert it to/from Unicode encoding.The first one is just about reading/writing using normal IO operations. The second can be done with the following module:
http://repetae.net/john/repos/jhc/UTF8.hsNote also that the same procedure would apply to simply printing/reading to/from the screen.Does that help?
Regards,Piotr Kalinowski-- Intelligence is like a river: the deeper it is, the less noise it makes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] heap issues

2006-07-27 Thread Piotr Kalinowski

On 27/07/06, Jeff Polakow <[EMAIL PROTECTED]> wrote:

Also, there doesn't appear to be a  '-M' flag for ghc (I'm using 6.4.2
on windows xp).


I'm sure there is. You must add following arguments:

+RTS -M -RTS

Note the rts magic.

Regards,
--
Intelligence is like a river: the deeper it is, the less noise it makes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] seq - RTFM?

2006-07-21 Thread Piotr Kalinowski

On 21/07/06, Dusan Kolar <[EMAIL PROTECTED]> wrote:

Prelude> putStr "Ahoj\n"
Ahoj
Prelude> putStr "Ahoj\n" `seq` 3+3
6
Prelude> :q
Leaving GHCi.

And not

Prelude> putStr "Ahoj\n"
Ahoj
Prelude> putStr "Ahoj\n" `seq` 3+3
Ahoj
6


Well, I understand that seq evaluates the first argument. But the
result of evaluating putStr is a monadic action. Not execution of that
action.

Regards,
Piotr Kalinowski


--
Intelligence is like a river: the deeper it is, the less noise it makes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: ANN: System.FilePath 0.9

2006-07-18 Thread Piotr Kalinowski

On 18/07/06, Stephane Bortzmeyer <[EMAIL PROTECTED]> wrote:

For instance, many lazy (not in the Haskell meaning) programmers
believe that the path is safe if it does not include .. but it is
false (hint: ."."/foo/bar is a legal path on Unix).


I believe this does not cause trouble. If it is a shell expression, it
will go one level up. However, when treated as a filesystem path alone
it will stay beneath. After all, the filesystem does not interpret
quotation marks.

Regards,
Piotr Kalinowski
--
Intelligence is like a river: the deeper it is, the less noise it makes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Re[4]: [Haskell-cafe] EclipseFP (Haskell IDE) 0.10.0 released

2006-07-03 Thread Piotr Kalinowski

On 03/07/06, Bulat Ziganshin <[EMAIL PROTECTED]> wrote:

i answer in cafe so that Thiago can see you preferences :)


Ups. That's that 'Replay to all' phenomena again ;)


smart indentation is not easy for Haskell, i think. I don't even sure
that myself has some strict indenting rules. moreover, with many edits
of source files this again loses it's meaning


For me it would be sufficient to increase indentation after few
certain constructs (mostly those involving layout). Of course the
indentation needs to be inceased in such a case according to layout
rule instead of some fixed amount of whitespace.


i'm also curious about code completion - never worked with good one
(after the MultiEdit's support for C language constructs :) )


I was growing up without code completion. Therefore it's somehow
strange to let a computer insert some text instead of me. Like he knew
better ;) But completion of function names from few libraries would be
usefull after all..

Regards,
Piotr Kalinowski

--
Intelligence is like a river: the deeper it is, the less noise it makes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Functional progr., images, laziness and alltherest

2006-06-22 Thread Piotr Kalinowski

On 23/06/06, Brian Hulley <[EMAIL PROTECTED]> wrote:

> This equation is just a shortcut, so I can't see how can it be
> ill-typed. It means something like: if you add one element to an
> infinite list, will it be longer?

What does your intuition say about this?


It won't be longer. How can it be? It's already infinite ;) It's like
throwing things into bottomless hole and expecting it to get more
"full."


But this explanation might just be vapid sophistry. Do you *really* want to
trust it?


I perceive it as a way to explain to beginner students where bijection
idea comes from. It's all it means to me. I suppose the whole idea is
to start at something intuitive and then extend it to completely
counter-intuitive notion of being infinite.


Just that there is a conflict with intuition no matter which option you
choose: if I think that the list would be longer, I have to reject any proof
to the contrary, but then my intuitions about valid proof are confounded,
whereas if I accept the proof, my intuition about physical objects is
confounded: if the list doesn't get longer, then where *is* the thing I
added to it? Did it just disappear?
So for these reasons I find that infinity is a troublesome concept.


I suppose infinity can't be totally intuitive in the end. We are not
used to handle infinite objects and intuition as such was not
developed to handle them.

Regards,
Piotr Kalinowski

--
Intelligence is like a river: the deeper it is, the less noise it makes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Functional progr., images, laziness and alltherest

2006-06-22 Thread Piotr Kalinowski

On 22/06/06, Brian Hulley <[EMAIL PROTECTED]> wrote:
...

This doesn't mean that these contradictions reflect reality - just that
maths hasn't yet reached a true understanding of reality imho.


Well, I for instance believe that contradiction IS the true nature of
reality... ;)



For example, why do people accept that infinity == infinity + 1 ? Surely
this expression is just ill-typed. infinity can't be a number.


This equation is just a shortcut, so I can't see how can it be
ill-typed. It means something like: if you add one element to an
infinite list, will it be longer? I found the explanation in terms of
defining bijection between both lists very appealing (along with a
"metaphor" of taking one element at a time from both lists and never
being left with one of the lists empty, which was demonstrated here as
well).

Seems I don't understand your problem with infinity after all :)

Regards,
Piotr Kalinowski
--
Intelligence is like a river: the deeper it is, the less noise it makes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Functional progr., images, laziness and all the rest

2006-06-21 Thread Piotr Kalinowski

On 22/06/06, Brian Hulley <[EMAIL PROTECTED]> wrote:

1) Someone reading the code needs to do a lot of work to try to recover the
original equation


That's what comments are for, I suppose.


2) Wouldn't an imperative loop, using the original equation directly, have
made everything much simpler?
3) Therefore laziness has lead to obfuscated code.


In fact, according to your point 2, it is not the laziness that
brought us here, but being functional.

Just my 2 cents.

Regards,
Piotr Kalinowski

--
Intelligence is like a river: the deeper it is, the less noise it makes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Literate Haskell in Vim - a bug and a workaround (?)

2006-06-09 Thread Piotr Kalinowski

Hi,

I've been recently playing with literate haskell in latex mode in Vim.
The versions are:

Vim - 6.4.6
tex.vim - 30
lhaskell.vim - 1.01

I encountered a bug. If you put \section (or \subsection or \chapter
or other similar command), haskell syntax highlighting is lost from
this command onwards.

I tried some googling and searching this list's archives but found
nothing. After going through tex.vim and reading vim docs I found out,
that adding 'containedin tex.*Zone' to the following line:

syntax region lhsHaskellBeginEndBlock start="^\\begin{code}\s*$"
matchgroup=NONE end="\%(^\\end{code}.*$\)[EMAIL PROTECTED]"
[EMAIL PROTECTED],@beginCode

appears to solve the problem. Apparently the bug is caused by
texSectionZone (and other zones) syntax region which extends from
\section command until another \section command. Since
lhsHaskellBeginEndBlock region was not allowed inside texSectionZone,
it was not recognised. Adding containedin clause addresses this
problem letting vim to recognise \begin{code} as beginning of the
Haskell file part.

Such change however breaks tex lexical checks. More specifically -
texMatcher from tex.vim is unable to match braces around section
titles (chapter, subsection, etc.). I tried tampering with
lhaskell.vim for some time but found no way to fix it. (Which is not
surprising, given the fact that I am far from being vim expert. In
fact I know almost nothing about vim programming.)

Therefore the patch I attach simply turns lexical checks off setting
g:tex_no_error variable. The variable is then unset immediately after
loading tex.vim in order not to affect other buffers where it can work
correctly.

I attach the patch with those two changes. It is diff -u output. Any
comments are welcome. I would especially be happy to learn how to fix
texMatcher issue without turning it off.

Regards,
Piotr Kalinowski
--
Intelligence is like a river: the deeper it is, the less noise it makes
--- /usr/share/vim/vim64/syntax/lhaskell.vim	2006-05-23 14:03:58.0 +0200
+++ lhaskell.vim	2006-06-09 13:32:39.0 +0200
@@ -80,12 +80,23 @@
 
 " If user wants us to highlight TeX syntax, read it.
 if b:lhs_markup == "tex"
+" Turn off the tex matcher as in documents with sections it will
+" fail to match braces around section titles. Any other way to fix it?
+if !exists("g:tex_no_error")
+let g:tex_no_error = 1
+let unlet_tex_var  = 1
+endif
+
 if version < 600
 	source :p:h/tex.vim
 else
 	runtime! syntax/tex.vim
 	unlet b:current_syntax
 endif
+
+if exists("unlet_tex_var")
+unlet g:tex_no_error " Don't affect other buffers...
+endif
 endif
 
 " Literate Haskell is Haskell in between text, so at least read Haskell
@@ -97,7 +108,7 @@
 endif
 
 syntax region lhsHaskellBirdTrack start="^>" end="\%(^[^>]\)[EMAIL PROTECTED]" [EMAIL PROTECTED],lhsBirdTrack
-syntax region lhsHaskellBeginEndBlock start="^\\begin{code}\s*$" matchgroup=NONE end="\%(^\\end{code}.*$\)[EMAIL PROTECTED]" [EMAIL PROTECTED],@beginCode
+syntax region lhsHaskellBeginEndBlock start="^\\begin{code}\s*$" matchgroup=NONE end="\%(^\\end{code}.*$\)[EMAIL PROTECTED]" [EMAIL PROTECTED],@beginCode containedin=tex.*Zone
 
 syntax match lhsBirdTrack "^>" contained
 
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe