• she/her, it/its

gay ass artist and programmer, i guess. 23. works on botania, the minecraft mod. also into weird functional programming stuff. talk to me about monads (or applicatives if you're even cooler)


artemis
@artemis

So haskell is this funny little language where the order that your code runs isn't based on line numbers. you write 10 lines of code in a row, the last line might run first. Side note that's actually even true in like, C or Rust, if the compiler can prove it'll be faster and not break anything but there's very few things those languages can safely prove won't break things to re-order so it doesnt happen much aside from like re-ordering math operations. By contrast, Haskell by default assumes anything is safe to reorder in whatever way it wants.

That's kind of a problem if you want to do... anything sensitive to the order it runs in. like talk to your hard drive. or send some DMs to someone. right? so that's where Bogos comes in. When you need to write some code that NEEDS to run in a particular order, you can put that calculations inside some Bogos, and then bint them to tell haskell what order they need to happen in. That's like the point of them.

So you've got some Bogo gayshit. That's your grand computation that will do whatever stuff, and then return a gayshit. Maybe it DMs your crush in the background, and also posts some pride flags to your banner image.

But that's not enough for you. You want to do something else after you finish that computation, you sicko. So you have another function gayshit -> Bogo worlddomination, if you have gayshit then the world is your oyster, you are unstoppable, you can plan your worlddomination Bogo no problem. But you need that gayshit first.

And here's where binting comes in. bint takes your Bogo gayshit, and your gayshit -> Bogo worlddomination, and produces a Bogo worlddomination. And THIS establishes an order of operations!! You can't achieve world domination until you have your gayshit, right?? If you tried, everything will go horribly wrong. This is how we say that.

You've established your supply chains, you know exactly how your gayshit is going to be made, you know everything you're gonna do after you have it, and so you have a fully formed plan for world domination. You could keep going though if you wanted. fantasizing about what you'll do with your world domination after you have it, and construction an even larger Bogo. But maybe you stop here. that's enough for today.

bogos binted. what am i even writing right now honestly


You must log in to comment.

in reply to @artemis's post:

yeah see this is why its a bad tutorial, you dont just need the gayshit, you need everything you did to get the gayshit, and that might include stuff with no return values at all (void functions). soyou have to make a fake return value and fakely pretend to use it in the next function to express the data dependency and thats what the bogo and the bint do for you