Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Let-in vs beta-redex
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Michal Moskal <malekith@p...>
Subject: Re: [Caml-list] Let-in vs beta-redex
On Mon, Sep 01, 2003 at 06:15:54PM +0200, Lukasz Stafiniak wrote:
> Hi,
> 
> Is let-in more efficient than beta-redex or are they computationally
> equivalent? Is let-in a syntax-sugar of beta-redex?
> 
> E.g.
> 
> let x = sin 2. in x *. x *. x;;
> 
> (fun x -> x *. x *. x) (sin 2.);;

let in is *not* equivalent to beta-redex because of typing. Type
variables are not generalized in beta-redex, for example consider:

let id x = x in
(id 1, id true)

vs.

(fun id -> (id 1, id true)) (fun x -> x)

-- 
: Michal Moskal :: http://www.kernel.pl/~malekith : GCS {C,UL}++++$ a? !tv
: PLD Linux ::::::::: Wroclaw University, CS Dept : {E-,w}-- {b++,e}>+++ h

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners