tag:blogger.com,1999:blog-8640596986273216089.post4278758922304833516..comments2023-08-15T06:10:51.086-03:00Comments on Ariel Flesler: Haskell Functions for JavascriptAriel Fleslerhttp://www.blogger.com/profile/17700414222186772120noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-8640596986273216089.post-77311854285322739722010-08-23T14:39:03.184-03:002010-08-23T14:39:03.184-03:00Right, haven't made a formal release, I'm ...Right, haven't made a formal release, I'm currently too busy.<br /><a href="http://code.google.com/p/flesler-projects/source/browse/trunk#trunk/javascript/hs" rel="nofollow">Here</a> are the changes.Ariel Fleslerhttps://www.blogger.com/profile/17700414222186772120noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-62621759864213584602010-08-23T14:16:49.041-03:002010-08-23T14:16:49.041-03:00Cool, but where have you uploaded the changes?Cool, but where have you uploaded the changes?georgy7https://www.blogger.com/profile/08045472627366630623noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-32366593491024996742010-08-23T10:45:27.663-03:002010-08-23T10:45:27.663-03:00@httpcatharsis
Ok, that's done@httpcatharsis<br />Ok, that's doneAriel Fleslerhttps://www.blogger.com/profile/17700414222186772120noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-10261008632438884592010-08-22T20:20:52.468-03:002010-08-22T20:20:52.468-03:00You're right, will do that asap.You're right, will do that asap.Ariel Fleslerhttps://www.blogger.com/profile/17700414222186772120noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-3629041582547848972010-08-22T07:20:43.873-03:002010-08-22T07:20:43.873-03:00There is no window object in ecma-262-3. So it may...There is no window object in ecma-262-3. So it may not work in QtScript and probably Rhino. We'll have to do something like "window = this".georgy7https://www.blogger.com/profile/08045472627366630623noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-36209779747980505932009-11-27T15:14:46.844-03:002009-11-27T15:14:46.844-03:00Ohhh, you took the code from my comment. I wasn...Ohhh, you took the code from my comment. I wasn't sure where were you looking at.<br />I was explaining "chained" currying, it was just a theoretical example.Ariel Fleslerhttps://www.blogger.com/profile/17700414222186772120noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-19136341312115286062009-11-27T14:24:39.344-03:002009-11-27T14:24:39.344-03:00You're right. Actually I tried with your conso...You're right. Actually I tried with your console <i>after</i> posting the comment - dunno why :)<br /><br />Your example is still ambigious though. At least the naming. If add2 is a function which adds 2 to any given number, namely a partially saturated add; I assume add5 is likely so.<br /><br />It good to find out that the library is not faulty, but the example is (to some extend)<br /><br />Nice work!Ozgurhttps://www.blogger.com/profile/11391574793211104178noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-43190211016094920142009-11-27T14:18:21.229-03:002009-11-27T14:18:21.229-03:00Hi Ozgur
That's how it works in here as well. ...Hi Ozgur<br />That's how it works in here as well. Try add(2)(3) in the console, you'll get 5.Ariel Fleslerhttps://www.blogger.com/profile/17700414222186772120noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-80148585116967401252009-11-27T12:58:53.469-03:002009-11-27T12:58:53.469-03:00A little comment on chaining curried functions. So...A little comment on chaining curried functions. Sorry if I get you wrong.<br /><br />add2 = add(2);<br />add5 = add2(3);<br /><br />By this example, assuming add is a function which takes to ints and returns an int originally, ie. a -> a -> a, this is not allowed in Haskell.<br /><br />add x y = x + y<br />add2 = add 2 -- add2 is of type a->a now<br />add5 = add2 3 -- add5 is of type a now, having the value 5.<br /><br />Cheers!Ozgurhttps://www.blogger.com/profile/11391574793211104178noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-72714441913131315172009-03-28T11:49:00.000-03:002009-03-28T11:49:00.000-03:00thanks! still learning this stuffthanks! still learning this stuffdual monitorshttp://www.multi-monitors.com/noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-26601929175973858992009-01-16T09:31:00.000-02:002009-01-16T09:31:00.000-02:00Hi AntonThat's pretty much the same I did. But you...Hi Anton<BR/><BR/>That's pretty much the same I did. But yours can't be "chained".<BR/><BR/>For example:<BR/><BR/>add2 = add(2);<BR/>add5 = add2(3);<BR/><BR/>Curried functions also returned curried ones.Ariel Fleslerhttps://www.blogger.com/profile/17700414222186772120noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-41462466333671596922009-01-15T19:11:00.000-02:002009-01-15T19:11:00.000-02:00I've implemented currying somewhat differently...I've implemented currying somewhat differently for my projects:<BR/><BR/>function curry()<BR/>{<BR/> var args = jQuery.makeArray(arguments);<BR/> var fn = args.shift();<BR/> <BR/> return function()<BR/> {<BR/> return fn.apply(this, args.concat(jQuery.makeArray(arguments)));<BR/> };<BR/>}<BR/><BR/>// example:<BR/>function add(x,y) { return x + y; }<BR/>var add1 = curry(add, 1);<BR/>alert(add1(2)); // alerts "3"Anonymousnoreply@blogger.com