Hacker News new | ask | show | jobs
by DougWebb 3857 days ago
A pure functional toaster would work one of two ways:

1) It would just be a solid box with no openings. Inside would be full of wondrous magic, but interacting with the outside world involves side-effects so interaction would not be allowed.

2) It would have a glass panel on the side, which you'd hold your untoasted bread against. A slice of toasted bread would pop out of the top. You'd never know where it came from, but you'd be happy that your original slice hasn't been modified.

2 comments

Keep going, I want to hear how monads get mapped into the world of toast. :-)
You can think of monads as abstractions that may or may not return toasted objects.
So maybe toast?
Only for a moment. An extensible claw would fly out, grab the untoasted bread from your hand and fling it into the garbage can, after a brief but unpredicatable interval.