?

Log in

No account? Create an account
map/reduce - Lindsey Kuper [entries|archive|friends|userinfo]
Lindsey Kuper

[ website | composition.al ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

map/reduce [Apr. 19th, 2009|12:34 am]
Lindsey Kuper
[Tags|]

I just actually wrote this and actually used it in my actual compiler:

(map (lambda (body)
       (fold-left replace-operator body uvar* lbl*))
     body*)

fold-left is reduce. You guys, for all my talk, I don't think I've ever actually used this for, you know, fixing an actual bug before. But I actually thought of it and it actually solves exactly the problem that I needed it to solve. I'm blown away.

LinkReply

Comments:
From: (Anonymous)
2009-04-19 10:19 pm (UTC)
Theorem:
Any problem can be solved with the application of enough catamorphisms.

Corollary (1):
If a function doesn't have a fold in it, then it's not yet finished.

Corollary (2):
If you haven't folded over it at least once, then you didn't really need that data structure anyway.
(Reply) (Thread)
[User Picture]From: oniugnip
2009-04-20 02:38 pm (UTC)


Edited at 2009-04-20 02:39 pm (UTC)
(Reply) (Parent) (Thread)
From: (Anonymous)
2009-04-21 03:12 am (UTC)
omgomgomgomg that Lambda Cats page is so many different kinds of awesome. I suspect my chortling has everyone on the floor think I'm crazy (but then they already knew that anyway).

I am so stealing some of those to put in my course web pages!
(Reply) (Parent) (Thread)
[User Picture]From: lindseykuper
2009-04-21 03:40 am (UTC)
Okay, let's see. You seem to be at the University of Calgary. You know something about this stuff and something about that stuff, too. You have course web pages. "Everyone on the floor" suggests "dorm", which, to me, suggests that you're an undergrad or perhaps an international grad student.

Keep talking. This game is fun!
(Reply) (Parent) (Thread)
From: (Anonymous)
2009-04-23 04:26 am (UTC)
Eeep! *redface*

I just realized that I probably come across a little stalker-ish. Sorry... that's (obviously?) not my intent!

Just a grad student, nearing the end of my thesis (I hope, but then I've been hoping that for a year or two now) and studying (as you seem to be) something somewhere at the intersection of category theory and compilers. (In short: I'm re-purposing Curry-Howard-Lambek -- but feeding it a linearly distributive category "meshed" with the standard cartesian closed one -- and thereby inventing a new programming language.) So yeah, a lot of what you write about is of passing interest (or at least entertaining to read).

[You're welcome to find out all (for some values of "all") about me here:
http://pages.cpsc.ucalgary.ca/~nicholss/]

I first stumbled across the journal when you made this post:
http://lindseykuper.livejournal.com/176143.html
the image in which caught my eye as it drifted past in one of those "the last 25 images posted to LJ" aggregators. (Specifically, I noticed the parts about type theory, formal methods and proof theory, which were very closely aligned with what I was doing way back at the beginning of my degree.) As I recall, I scanned the post, went "hmm. interesting" was about to close it, but instead clicked on the "shoebox full of tapes" link. Whereupon I was confronted with post 22 (Hast Thou Considered the Tetrapod), and since I am an incorrigable Mountain Goats fan, that was enough for me to file the URL away in my bookmark file. ("Awesome!" I recall thinking, "Another proof theorist / Mountain Goats fan!")

Er. And about every 8-10 months I notice the link buried in my bookmarks and check it out. Except a lot more recently, since you've started talking about your compiler, which (despite my not being anything of a Schemer (yes, sorry, another Haskellite in your midst)) has made for interesting reading.

Um, anyway. Yeah.


> on the floor" suggests "dorm"

Sorry to lead you astray, but no, I was only referring to the floor on which my lab is situated.
(Reply) (Parent) (Thread)
[User Picture]From: lindseykuper
2009-04-23 11:47 pm (UTC)
I just realized that I probably come across a little stalker-ish. Sorry... that's (obviously?) not my intent!

Oh, no -- if anyone was sounding stalker-ish, it was me up there. The thing is that, usually, when the same anonymous commenter hangs around for this long, he or she eventually starts signing his or her name in some way or another. I assumed that remaining anonymous was a conscious decision on your part, and I decided to take it as a "betcha can't figure out what my name is" challenge. (I'm pretty sure I wouldn't have been able to, though.)

Welcome! It's good to put a name and a face to an IP address.
(Reply) (Parent) (Thread)