tag:blogger.com,1999:blog-11295132.post7948805726669382520..comments2024-02-24T01:46:31.188-08:00Comments on A Neighborhood of Infinity: Monads in C, pt. IIsigfpehttp://www.blogger.com/profile/08096190433222340957noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-11295132.post-47494269772128406682009-12-06T23:02:31.303-08:002009-12-06T23:02:31.303-08:00Nice, this code is good to show that monads can be...Nice, this code is good to show that monads can be implemented in C. <br />If anyone wants to refine it, one way is to embed it in a macro, in order to use any other type.<br />More laborious option is to implement manifest types.<br />Want it lazy? Implement lambda calculus including an eta-conversion, fixed point combinators, ...<br />Good idea for course semester project.<br />See the wizard book for manifest types and Essentials of Programming Languages Friedman et al, not the last edition, the black cover, to implement lambda-calculusAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-11295132.post-90894412985340293942009-02-24T03:38:00.000-08:002009-02-24T03:38:00.000-08:00D'oh, ignore that last comment, I mistakenly thoug...D'oh, ignore that last comment, I mistakenly thought it was returning a pointer to the structure not a copy. :-/Unknownhttps://www.blogger.com/profile/08075296498582938825noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-23830574195674728712009-02-24T02:33:00.000-08:002009-02-24T02:33:00.000-08:00This code is dangerous and will likely crash since...This code is dangerous and will likely crash since you are returning pointers to memory allocated on the stack!Unknownhttps://www.blogger.com/profile/08075296498582938825noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-31142675923932543882007-09-17T19:10:00.000-07:002007-09-17T19:10:00.000-07:00Thanks for the nice post!Thanks for the nice post!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11295132.post-58841270328318413342007-03-02T06:27:00.000-08:002007-03-02T06:27:00.000-08:00Monads work in eager or lazy languages, it makes l...Monads work in eager or lazy languages, it makes little difference. In a sense monads are just mathematical constructions defined by some equations, so what matters is what things evaluate to, not the order they're evaluated in.<BR/><BR/>Having said that...in Haskell there is a nice way to use monads to make it convenient to write strict code even though the language is lazy.sigfpehttps://www.blogger.com/profile/08096190433222340957noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-28067538437690548132007-03-02T02:45:00.000-08:002007-03-02T02:45:00.000-08:00Well, all these C functions are eager. Isn't it th...Well, all these C functions are eager. Isn't it the main point that Haskell functions are lazy? Or it doesn't really matter?Anonymousnoreply@blogger.com