[Haskell-cafe] Gitit - Encoding

2008-12-30 Thread Arnaud Bailly
Hello, I have started using Gitit and I am very happy with it and eager to start hacking. I am running into a practical problem: characters encoding. When I edit pages using accented characters (I am french), the accents get mangled when the page come back from server. The raw files are

Re: [Haskell-cafe] Gitit - Encoding

2008-12-30 Thread Jeremy Shaw
Hello, I have not looked at the gitit source code, but I have had this problem in other HAppS applications. The problem is that by default HAppS does nothing about string encodings. The easy fix is to use utf-8 and unicode everywhere. ('easy' compared to supporting multiple encodings). The goal

[Haskell-cafe] Re: [Haskell] hsc2hs can't find gcc under windows

2008-12-30 Thread Duncan Coutts
On Tue, 2008-12-30 at 13:32 +0900, Curt Sampson wrote: Duncan, Good to talk to you again. You may remember me from ICFP. Indeed. :-) Anyway, thanks for the hint; I can probably make a workaround by adding the appropriate options for hsc2hs to the QAM build system. If you happen to know

Re: [Haskell-cafe] instance Enum [Char] where ...

2008-12-30 Thread Adrian Neumann
Better would be [] = 0 ['a'] = 1 ['b'] = 2 ... ['z'] = 26 ['a','a'] = 27 ['a','b'] = 28 (asuming Char = ['a'..'z']) Am 30.12.2008 um 04:25 schrieb JustinGoguen: I am having difficulty making [Char] an instance of Enum. fromEnum is easy enough: map fromEnum to each char in the string and

Re: [Haskell-cafe] Strange error with HDBC-odbc and MySQL

2008-12-30 Thread John Goerzen
Justin Bailey wrote: I have run into a weird bug with HDBC-odbc that only occurs on my unix system. When I execute a select which returns more than 435 rows twice in the same process, the second execution fails with this error message: OK, sorry for missing that detail. Are you *sure* it

Re: [Haskell-cafe] instance Enum [Char] where ...

2008-12-30 Thread Thomas Davie
Am 30.12.2008 um 04:25 schrieb JustinGoguen: I am having difficulty making [Char] an instance of Enum. fromEnum is easy enough: map fromEnum to each char in the string and take the sum. However, toEnum has no way of knowing what the original string was. The problem you're having is that

[Haskell-cafe] Enum and Bounded in generic type

2008-12-30 Thread raeck
Hi, how can I make the following code work? (show all the possible values of a type 'a') showAll :: (Eq a, Bounded a, Enum a) = a - [a] showAll a = [minBound..maxBound]::[a] it keeps saying that I could fix the problem by adding (Enum a) and (Bounded a) the the context, but I failed when I

Re: [Haskell-cafe] Enum and Bounded in generic type

2008-12-30 Thread Derek Elkins
On Tue, 2008-12-30 at 17:12 +, ra...@msn.com wrote: Hi, how can I make the following code work? (show all the possible values of a type 'a')  showAll :: (Eq a, Bounded a, Enum a) = a - [a] showAll a = [minBound..maxBound]::[a] The bottom 'a' has nothing to do with the 'a' in the

Re: [Haskell-cafe] Enum and Bounded in generic type

2008-12-30 Thread Robert Greayer
Raeck said: Hi, how can I make the following code work? (show all the possible values of a type 'a') showAll :: (Eq a, Bounded a, Enum a) = a - [a] showAll a = [minBound..maxBound]::[a] What you are really looking for, I think, is a polymorphic value of type [a], where a is some

[Haskell-cafe] Re: Gitit - Encoding

2008-12-30 Thread John MacFarlane
Arnaud, You just need to make sure that the raw page files (stored in git) use UTF-8. Then accented characters should appear correctly. Sample: http://johnmacfarlane.net:5001/Multilingual (The UTF-8 requirement should be documented...I'll make a note of it.) John +++ Arnaud Bailly [Dec 30 08

[Haskell-cafe] Re: Gitit - Encoding

2008-12-30 Thread John MacFarlane
Jeremy, Thanks, this is useful. Gitit already uses UTF-8 where it should, I think, but I hadn't noticed the issue with look* functions and ToMessage instances in HAppS. This affects gitit too (try typing an accented string into the search box, for example). I strongly agree that HAppS should

Re: [Haskell-cafe] Lack of inlining - slow parsing with Data.Binary

2008-12-30 Thread Thomas Schilling
Which version of binary did you use? There were similar problems a while ago, but, IIRC, they're supposed to be fixed (apparently too *many* INLINE pragmas were the problem). 2008/12/26 Eugene Kirpichov ekirpic...@gmail.com: Hi, I'm parsing Java classfiles with Data.Binary, the code is here:

[Haskell-cafe] Re: Gitit - Encoding

2008-12-30 Thread Arnaud Bailly
Hi Jeremy and John, Thank you very much Jeremy for your very detailed answer ! I checked in Gitit source and found various occurences of usage of Byte8 strings, which John as confirmed. I switched template.html to advertising encoding of iso-8859-1 and things are working ok. I setup LANG (and

Re: [Haskell-cafe] Don't make 'show*' functions

2008-12-30 Thread Henning Thielemann
wren ng thornton schrieb: Thomas DuBuisson wrote: Jeff Heard proclaimed: There are multiple distinct reasons people use Show, and this gets confusing. This is exactly what I was getting at. I see four uses being discussed: Indeed, though I think the situation is even worse. It seems to

Re: [Haskell-cafe] Function composition

2008-12-30 Thread Henning Thielemann
On Mon, 29 Dec 2008, Martijn van Steenbergen wrote: Conal Elliott wrote: If you think of f (here f=not) as an semantic editor (transformer) of values, then 'result', 'first', and 'second' are semantic editor combinators, which can be composed together arbitrarily. See

Re: [Haskell-cafe] Re: instance Enum [Char] where ...

2008-12-30 Thread Henning Thielemann
Justin Goguen schrieb: My purpose is to have operations such as [aa..bc] be possible, with its result being [aa, ab, ac ..snip.. ba, bb, bc] ... what do you want to get, if the lengths of the start and the end string do not match? Maybe what you are after is the Ix class: Prelude

Re: [Haskell-cafe] Gitit - Encoding

2008-12-30 Thread Henning Thielemann
On Tue, 30 Dec 2008, Arnaud Bailly wrote: Hello, I have started using Gitit and I am very happy with it and eager to start hacking. I am running into a practical problem: characters encoding. When I edit pages using accented characters (I am french), the accents get mangled when the page come

[Haskell-cafe] Reading group for Programming Collective Intelligence

2008-12-30 Thread Creighton Hogg
Hello Haskellers, For those of your who aren't nose-deep in Real World Haskell at the moment, I'd like to start a small group for the O'Reilly book Programming Collective Intelligence*. I think it might be very instructive to convert the examples exercises to Haskell. I think it would be good

Re: [Haskell-cafe] Reading group for Programming Collective Intelligence

2008-12-30 Thread Andrew Wagner
I think this sounds like a great idea! I'll have to get ahold of the book first though. On Tue, Dec 30, 2008 at 8:10 PM, Creighton Hogg wch...@gmail.com wrote: Hello Haskellers, For those of your who aren't nose-deep in Real World Haskell at the moment, I'd like to start a small group for

[Haskell-cafe] fedora-devshell and Haskell

2008-12-30 Thread Yaakov Nemoy
Hi Folks, I spent the better part of yesterday working on some tools for doing Fedora packages for Cabal. I've put up a blog report with some preliminary explanations on how to use it, but it might be of value to regular Haskell programmers. The post can be found below.

Re: [Haskell-cafe] fedora-devshell and Haskell

2008-12-30 Thread Gregory Collins
Yaakov Nemoy loupgaroubl...@gmail.com writes: Hi Folks, I spent the better part of yesterday working on some tools for doing Fedora packages for Cabal. I've put up a blog report with some preliminary explanations on how to use it, but it might be of value to regular Haskell programmers. The

[Haskell-cafe] Re: Gitit - Encoding

2008-12-30 Thread John MacFarlane
I switched template.html to advertising encoding of iso-8859-1 and things are working ok. I setup LANG (and LC_ALL) to fr_FR.UTF-8. When I set meta tag with utf-8 encoding, things get messy. John: I checked your url and, oddly enough, characteres appears OK when I manually change page

[Haskell-cafe] Updating doubly linked lists

2008-12-30 Thread S. Günther
Hello, I was trying to wrap my head around the stuff at http://haskell.org/haskellwiki/Tying_the_Knot (again) and along the way came a question: Is it possible to change a particular node of the doubly linked list? That is to say, that would like to have a function: update :: DList a - a - DList