Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-21 Thread Ian Lynagh
On Fri, Jun 20, 2008 at 07:57:58AM +0200, Ketil Malde wrote: Albert Y. C. Lai [EMAIL PROTECTED] writes: While we are kind of on this topic, what makes the characters ħ þ prefix operator by default, while º and most other odd ones infix? alphanumeric vs non-alphanumeric Testing this,

Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-21 Thread jinjing
After some fiddling with this style, here is what I came up with for the 8 queens problem in the 99 problem set. It's quite entertaining ... ( note: it's brute force and requires a combination library ) queens2 n = n.permutations.filter all_satisfied where all_satisfied queens = queens.diff_col

Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-19 Thread Ketil Malde
jinjing [EMAIL PROTECTED] writes: Any way here's the code: module Dot where import Prelude hiding ( (.) ) (.) :: a - (a - b) - b a . f = f a infixl 9 . Isn't this (roughly?) the same as flip ($)? As a side note, may I advise you to use another symbol, and leave the poor dot alone?

Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-19 Thread Duncan Coutts
On Thu, 2008-06-19 at 11:33 +0800, jinjing wrote: Hi guys, This is my second attempt to learn Haskell :) Any way here's the code: module Dot where import Prelude hiding ( (.) ) (.) :: a - (a - b) - b a . f = f a infixl 9 . Note that if you redefine (.) composition to be

Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-19 Thread Gwern Branwen
On 2008.06.19 11:33:56 +0800, jinjing [EMAIL PROTECTED] scribbled 0.5K characters: Hi guys, This is my second attempt to learn Haskell :) Any way here's the code: module Dot where import Prelude hiding ( (.) ) (.) :: a - (a - b) - b a . f = f a infixl 9 . So for example, 99

Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-19 Thread Adam Vogt
* On Thursday, June 19 2008, Ketil Malde wrote: As a side note, may I advise you to use another symbol, and leave the poor dot alone? Overloading it as a module separator is bad enough. If you have a keyboard that allows greater-than-ascii input, there are plenty of options: « » ¡ £ ¥ ł € ® ª...

Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-19 Thread Chaddaï Fouché
2008/6/19 jinjing [EMAIL PROTECTED]: encode xs = xs.group.map token where token x = (x.length, x.head) Working in this direction is a question of taste, but the choice of the dot for the operator is a pretty bad idea... On the other hand, my favourite would be : encode = map (length head) .

Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-19 Thread Brent Yorgey
On Thu, Jun 19, 2008 at 3:35 AM, Ketil Malde [EMAIL PROTECTED] wrote: jinjing [EMAIL PROTECTED] writes: Any way here's the code: module Dot where import Prelude hiding ( (.) ) (.) :: a - (a - b) - b a . f = f a infixl 9 . Isn't this (roughly?) the same as flip ($)? As a side

Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-19 Thread Albert Y. C. Lai
Adam Vogt wrote: While we are kind of on this topic, what makes the characters ħ þ prefix operator by default, while º and most other odd ones infix? alphanumeric vs non-alphanumeric ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-19 Thread Derek Elkins
On Thu, 2008-06-19 at 15:24 -0400, Brent Yorgey wrote: On Thu, Jun 19, 2008 at 3:35 AM, Ketil Malde [EMAIL PROTECTED] wrote: jinjing [EMAIL PROTECTED] writes: Any way here's the code: module Dot where import Prelude hiding ( (.) )

Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-19 Thread Ketil Malde
Albert Y. C. Lai [EMAIL PROTECTED] writes: While we are kind of on this topic, what makes the characters ħ þ prefix operator by default, while º and most other odd ones infix? alphanumeric vs non-alphanumeric Testing this, I find that isAlpha is True also for 'º', but as the OP claims,