Re: [Haskell-cafe] pleac, examples, etc

2006-11-14 Thread Cale Gibbard

On 14/11/06, chris moline <[EMAIL PROTECTED]> wrote:

--- brad clawsie <[EMAIL PROTECTED]> wrote:
> it would be great if some of the more informed
> posters here took a stab
> at filling in
>
>
http://pleac.sourceforge.net/pleac_haskell/index.html
>
> a neat site for cookbook-style problem solving

What I've always found funny about pleac is that none
of the examples are actually Haskell, but some weird
Haskell-with-oo-features. Does anyone know what
language it is?

Here are some examples:

password = [1..8].mapM (\_ -> rand (0, chars.length
-1) >>> (chars!))

-- in haskell, regexp are first class, then can be
appended, sometimes easier to read
m0' s =  (s ==~ dec_number) 


They are actually Haskell, but notice the appendix:
http://pleac.sourceforge.net/pleac_haskell/a1102.html

It's Haskell with a completely bizarre prelude. No real new features
were added to the language itself.

Replacing composition with reverse function application is a waste of
operator symbols.

Personally, if I was going to change (.), it would be to define it as
fmap, which (as a number of people, myself included, have pointed out)
together with the instance of Functor for ((->) e) would generalise
ordinary composition, map, liftM, etc.

- Cale
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] pleac, examples, etc

2006-11-14 Thread chris moline
--- brad clawsie <[EMAIL PROTECTED]> wrote:
> it would be great if some of the more informed
> posters here took a stab
> at filling in 
> 
>
http://pleac.sourceforge.net/pleac_haskell/index.html
> 
> a neat site for cookbook-style problem solving

What I've always found funny about pleac is that none
of the examples are actually Haskell, but some weird
Haskell-with-oo-features. Does anyone know what
language it is?

Here are some examples:

password = [1..8].mapM (\_ -> rand (0, chars.length
-1) >>> (chars!))

-- in haskell, regexp are first class, then can be
appended, sometimes easier to read
m0' s =  (s ==~ dec_number) 
 

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] pleac, examples, etc

2006-11-14 Thread Pixel
Spencer Janssen <[EMAIL PROTECTED]> writes:

> Please do not use the PLEAC Haskell cookbook for learning Haskell.   The
> author redefined many of the standard operators to produce code  that isn't
> standard Haskell.
>
> Here are some choice snippets from the first chapter:
>
> Now, we all know that the (.) operator is function composition,  right?  Not
> in this example!  The author has silently defined "(.) =  flip ($)" -- a sort
> of reverse function application.
>> cut2fmt xs = xs.foldl aux (1,[]).snd.(GrabAll:).reverse
>
> Ah yes, (^) is surely exponent here?  Nope, it's some kind of unholy
> combination of show and (++).
>> s9 = "I have "^10+1^" guanacos."
>
> More of the same:
>> piece = s!![-8 .. -5]
>
>
> Complaining aside, I do agree with you: we need more example-style
> documentation.  Rewriting the PLEAC cookbook might be a good start.

i agree. A friend of mine did this haskell PLEAC version, and i would
really like to have a /standard/ haskell one.
(alas i've no more time to do it myself...)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] pleac, examples, etc

2006-11-13 Thread Spencer Janssen
Please do not use the PLEAC Haskell cookbook for learning Haskell.   
The author redefined many of the standard operators to produce code  
that isn't standard Haskell.


Here are some choice snippets from the first chapter:

Now, we all know that the (.) operator is function composition,  
right?  Not in this example!  The author has silently defined "(.) =  
flip ($)" -- a sort of reverse function application.

> cut2fmt xs = xs.foldl aux (1,[]).snd.(GrabAll:).reverse

Ah yes, (^) is surely exponent here?  Nope, it's some kind of unholy  
combination of show and (++).

> s9 = "I have "^10+1^" guanacos."

More of the same:
> piece = s!![-8 .. -5]


Complaining aside, I do agree with you: we need more example-style  
documentation.  Rewriting the PLEAC cookbook might be a good start.



Cheers,
Spencer Janssen

On Nov 13, 2006, at 11:57 PM, brad clawsie wrote:

it would be great if some of the more informed posters here took a  
stab

at filling in

http://pleac.sourceforge.net/pleac_haskell/index.html

a neat site for cookbook-style problem solving

from looking over haskell documentation for a few months now, i would
say what is missing is one central cookbook-style document (want to
query a database? want to parse xml? etc etc)

thanks
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] pleac, examples, etc

2006-11-13 Thread brad clawsie
it would be great if some of the more informed posters here took a stab
at filling in 

http://pleac.sourceforge.net/pleac_haskell/index.html

a neat site for cookbook-style problem solving

from looking over haskell documentation for a few months now, i would
say what is missing is one central cookbook-style document (want to
query a database? want to parse xml? etc etc)

thanks
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe