Re: [Haskell-cafe] Re: What's the deal with Clean?

2009-11-11 Thread Henning Thielemann
Stephen Tetley schrieb:
 Why speak nonsense when you can test it?
 
 // 
 
 
 module nonsense
 
 import StdEnv
 
 nonsense = map ((^) 2)
 
 Start = nonsense [1,2,3]
 
 // 
 
 
  Running gives:
 
 [2,4,8]

I think they wanted square numbers, not powers of two.

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


Re: [Haskell-cafe] Re: What's the deal with Clean?

2009-11-11 Thread Stephen Tetley
Hi Henning

I spotted that (and also that Clean doesn't have sections) after my
blood pressure returned to normal.

Best wishes

Stephen



 [2,4,8]

 I think they wanted square numbers, not powers of two.


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


Re: [Haskell-cafe] Re: What's the deal with Clean?

2009-11-08 Thread Ketil Malde
L Spice jadenb1...@yahoo.com writes:

 Doaitse Swierstra wrote:

One of this differences between Haskell and Clean I did not see mentioned in
 this discussion is that Clean does not allow so-called partial
 parametrisation. I.e. all function calls have to be fully saturated

 I don't understand what you mean. Can you give an example ?

 I think the idea was that Clean doesn't support a syntax like map
 (**2)

This terminology is new to me, I would normally call that partial
application.  Googling partial parametrization gives me some papers¹
that appear to use this term as a synonym.

I'm surprised that (if) Clean doesn't support it.

-k

¹ http://cat.inist.fr/?aModele=afficheNcpsidt=5420616
  and  http://www.springerlink.com/content/wg64116566522061/
-- 
If I haven't seen further, it is by standing in the footprints of giants
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: What's the deal with Clean?

2009-11-08 Thread Stephen Tetley
Why speak nonsense when you can test it?

// 

module nonsense

import StdEnv

nonsense = map ((^) 2)

Start = nonsense [1,2,3]

// 

 Running gives:

[2,4,8]


Best wishes

Stephen

2009/11/8 L Spice jadenb1...@yahoo.com:
 John van Groningen johnvg at cs.ru.nl writes:

 Doaitse Swierstra wrote:
 One of this differences between Haskell and Clean I did not see mentioned in
 this discussion is that Clean
 does not allow so-called partial parametrisation. I.e. all function calls 
 have
 to be fully saturated

 I don't understand what you mean. Can you give an example ?

 Kind regards,

 John van Groningen

 I think the idea was that Clean doesn't support a syntax like map (**2) for 
 a
 function that will take a list and square its elements.  The call to map there
 is not fully saturated, since it's waiting for another argument.

 (As a disclaimer, I've not used Clean, so I could be speaking nonsense; it's
 just how I read the original statement.)

 ___
 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


Re: [Haskell-cafe] Re: What's the deal with Clean?

2009-11-08 Thread Stephen Tetley
My impression is the saturated-ness that Doaitse speaks of is covered
in Urban Boquist's phd thesis on the GRIN intermediate language -
circa page 31.

http://www.cs.chalmers.se/~boquist/phd/

As per the code snippet above Clean handles partial application
entirely adequately.

Best wishes

Stephen

 Doaitse Swierstra wrote:
 One of this differences between Haskell and Clean I did not see mentioned 
 in
 this discussion is that Clean
 does not allow so-called partial parametrisation. I.e. all function calls 
 have
 to be fully saturated
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: What's the deal with Clean?

2009-11-08 Thread Richard O'Keefe




One of this differences between Haskell and Clean I did not see  
mentioned in

this discussion is that Clean does not allow so-called partial
parametrisation. I.e. all function calls have to be fully saturated


I think there may be a misunderstanding here.

Beware: I haven't used Clean in a while.

(1) Clean didn't have sections.
This is no big deal.  Clean does have flip in StdFunc.
(x +)   = (+) x
(+ y)   = (flip (+)) y

(2) Clean requires saturated *DEFINITIONS*.
If you declare
f :: A B C - D
then each rule you give for f must have exactly three arguments.
If you declare
f :: A - B - C - D
then each rule you give for f must have exactly one argument.
See section 3.7 of the Clean 2.1 language report.

This has no consequences for how you can *apply* such a
function.  Section 3.7.1 of the report is explicit:

In CLEAN all symbols (functions and constructors) are
defined with fixed arity.  However, in an application
it is of course allowed to apply them to an arbitrary
number of arguments.  A curried application of a
function is an application of a function with a number
of arguments which is less than its arity (note that
in CLEAN the arity of a function can be derived from
its type).  With the aid of the predefined internal
function _AP a curried function applied on the
required number of  arguments is transformed into an
equivalent uncurried function application.  The type
axiom's (sic.) of the CLEAN type system include for
all  s defined with arity n the equivalence of
s::(t1-(t2-(...(tn-tr)...)) with
s::t1 t2 ... tn - tr.

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


[Haskell-cafe] Re: What's the deal with Clean?

2009-11-07 Thread L Spice
John van Groningen johnvg at cs.ru.nl writes:

 Doaitse Swierstra wrote:
 One of this differences between Haskell and Clean I did not see mentioned in
this discussion is that Clean
 does not allow so-called partial parametrisation. I.e. all function calls have
to be fully saturated
 
 I don't understand what you mean. Can you give an example ?
 
 Kind regards,
 
 John van Groningen

I think the idea was that Clean doesn't support a syntax like map (**2) for a
function that will take a list and square its elements.  The call to map there
is not fully saturated, since it's waiting for another argument.

(As a disclaimer, I've not used Clean, so I could be speaking nonsense; it's
just how I read the original statement.)

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