Path: news.cs.au.dk!not-for-mail From: "Kasper Østerbye" Newsgroups: comp.lang.beta Subject: Re: Curry Date: Mon, 27 Sep 1999 11:06:15 +0200 Organization: University of Aarhus, Department of Computer Science (DAIMI) Lines: 92 Message-ID: <7snc27$bb0n1$1@xinwen.cs.au.dk> References: NNTP-Posting-Host: xmas.cs.au.dk X-Trace: xinwen.cs.au.dk 938423175 11895521 255.255.255.255 (27 Sep 1999 09:06:15 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 27 Sep 1999 09:06:15 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Xref: news.cs.au.dk comp.lang.beta:12093 Hi, This is probably more complex than what you asked for, but it gives an idea. -- Kasper (# BinFunc: (# x,y : @integer res: @integer curry: (# boundx: @integer; enter boundx exit &UnFunc(# do (boundx,x) -> this(BinFunc) -> res #)[] #); enter (x,y); do INNER exit res #); UnFunc: (# x:@integer; curry: (# boundx@integer; enter boundx exit &IntegerValue(# do boundx -> this(UnFunc) -> value #)[] #); enter x do INNER exit res #); Add:BinFunc(# do x+y -> res #); inc :^ UnFunc; const: ^IntegerValue; do (7,9) -> putInt; newLine; 1 -> (&Add[]).curry -> inc[]; 8 -> inc -> putInt; newLine; 10 -> inc.curry -> const[]; const -> putInt; newLine; const -> putInt; newLine; #); Yoann Padioleau wrote in message news:wi6d7v8xstx.fsf@hcand.irisa.fr... > > > How to write the curry function in beta ? > > In haskell we write things like that: > > curry f x y = f(x,y) > > add(x,y) = x+y > addc = curry add > inc = addc 1 > > > > > Is this possible in haskell ?? > > I write those things in beta, but my function curry > is not generic. Moreover we can't make easyly anonymous function in BETA, why ?? > > I mean that i must write : > > > curry : (# anonsub: (# .... #) > ... > exit anonsub## > #) > > > > Why can't we write > exit (# .... #)## > > > ?? > > > > -- > pad