@popefucker@cybre.space for functions with no side effects (those that just take something and return something) it doesn't matter what order we do them in.
but functions that ask the user questions and wait for responses? the order matters!
so we have to wrap up whatever our function does in a higher order type:
askAndResponse :: String -> IO (String)
let's say this function displays whatever string we pass to it to the user, then waits for user response...
@popefucker@cybre.space monoids aren't so important, but monads are significant because they're what allows for composable code with "side effects"
typically, we want to be able to compose functions together:
h = f . g
because this makes designing programs easier.
but when it comes to functions that have side effects (like writing files or displaying stuff on the screen), we want those to be isolated from other functions, because the *order* in which we do things is suddenly important
@popefucker@cybre.space
* the equals sign works the same as in algebra - whenever you see the LHS, you can just replace it with the RHS (and visa versa)
* types are just sets - if you write a function, it takes elements from one set and returns elements of another set, for example:
isEven :: Integer -> Boolean
isEven n = case n `mod` 2 of
0 -> True
otherwise -> False
is a function that takes elements from the set of all integers, and returns elements from the set of Booleans.
@popefucker@cybre.space http://haskellbook.com/ is pretty good and starts from first principles, but costs money
http://book.realworldhaskell.org/ goes into a bunch of mathematical details later on.
those are both kinda generic, though, so I'll give you some specific stuff that might be useful to someone with a maths background in the next toot
@Efi *falls off you*
@LottieVixen that's why it doesn't work - jpg includes a bunch of stuff to stop glitches and corruption, so it's hard to... glitch or corrupt it
gross bugs, weight, body image, food,
@nimtendogs I stopped having sugar in tea when I found a giant cockroach in my sugar pot
@kibi oh gosh that sucks, I hope tomorrow is better friend ❤
@radtabby wow I've never seen this... and yet I feel soooo much nostalgia
Holy shit
Dirty Loops Baby (JB cover by Dirty Loops)
This is hot as fuck!
@Efi you're not worthless, but I still want a hug~
@DialMforMara woah nice!!!
@DialMforMara oh wow, maybe I'll tune in at some point...
@DialMforMara ooo, how long is there left?
hi I'm avery, a cute lizardsquid with 3 hearts full of love!
nonbinary ░ they/she ░ australia ░ 29yo
I post: silly lizardy nonsense, world building, conlangs, doctor who
polyam, demi, open. I love affection!
hugs and cuddles and such are ok, but everything else please ask first
languages: English • Welsh (very basic)
I have a private account, ask for access!
(some old accounts:
@gwyfyndraig
@liquid_lizsquid
)