Belisarius Cawl
kiwifarms.net
- Joined
- Mar 16, 2024
Continuations are brain-melting thoughall of these are just delimited continuations with extra steps
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Continuations are brain-melting thoughall of these are just delimited continuations with extra steps
that's why you wrap them up in nice hygienic macros and make them into whatever goofy high-level nonlocal control structure you wantContinuations are brain-melting though
What does this even meanreturning from a function is really just calling a function with less steps
well to implement the ability to call a function you need to provide it with some way to come back to the code that called it, and this is actually often done by arranging to pass it another function (a "continuation") which is then called when the function "returns"What does this even mean
oh continuations are pretty easy i am currently having a bit of trouble with monadsI've learned about some pretty arcane stuff but so far I'm still drawing the line at continuations
I think it's one of the most beginner unfriendly languages out there, because it leads to really bad habits and taking shortcuts.Python is probably the most "beginner friendly" though, which is where this conversation began, and it's decently widespread and well known.
Continuations are quite fun to work with, though they can be a bitch to learn if you don't live and breathe FP.I've learned about some pretty arcane stuff but so far I'm still drawing the line at continuations
for monads I usually refer to this video:from what i know a monad is simply anything that acts like a monad which is not very helpful since i have trouble remembering the monad laws as they are usually expressed in completely incomprehensible haskell niggerscribbles
Perl, JavaScript and R are much clearer "winners" in this categoryI think it's one of the most beginner unfriendly languages out there, because it leads to really bad habits and taking shortcuts.
Yeah, hence why I said one of, not the.Perl, JavaScript and R are much clearer "winners" in this category
yes it's absolutely not as readable or straightforward or elegant as its proponents frequently claimed back in the dayI think it's one of the most beginner unfriendly languages out there, because it leads to really bad habits and taking shortcuts.
man 1 make)Is any of this in book form? (I prefer reading over lectures)Yeah, hence why I said one of, not the.
Also, pits of success is a great talk about what makes a good language: https://youtube.com/watch?v=US8QG9I1XW0
I couldn't find this talk written down. However there's this blog post by the presenter that links some useful ressources.Is any of this in book form? (I prefer reading over lectures)
oi mate.from what i know a monad is simply anything that acts like a monad which is not very helpful since i have trouble remembering the monad laws as they are usually expressed in completely incomprehensible haskell niggerscribbles
1 + 2 + 3 == (1 + 2) + 3 == 1 + (2 + 3) and 1 + 0 == 1 "abc" ++ "efg" ++ "hjk" == "abc" ++ ("efg" == 'hjk") and "abc" + "" == "abc" fmap functions that would work on orginal Category. And for easiest functor it is just a container. fmap (+1) Just 5 == Just 6 Because Maybe Int preserves all operations that you can do on Int. fmap (+2) [1, 2, 3] == [3,4,5] Because again List of Ints preserves all operations that you can do on Int. You use fmap to apply them. m a -> (a -> m b) -> m b . m a is a monad that transforms a the way functor would do. a -> m b is a function that takes not-transformed a and returns monad of b m b is monad of b which is returned value [1, 2, 3] and function that for number returns list of numbers length n so foo 1 == [1], foo 2 == [2,2], foo 3 == [3,3,3] etc. fmap foo [1,2,3] = [[1], [2,2], [3,3,3]] However bind does apply associative binary operation (which is concat for lists) and we are left with bind foo [1,2,3] == [1, 2, 2, 3, 3, 3] fmap toNumber (Just "123') == Just (Just 123) but using monad you get bind toNumber (Just "123") == Just 123 Which alows for chaining of operations.Could also be summarized as anything that is flatmap-able is a monad.--snip--
so monads are just types wrapped in another type with maybe some additional information tacked on?Monads are easy once you start using them
That's functors. Monads additionally have defined way of combining them with associative binary operation.so monads are just types wrapped in another type with maybe some additional information tacked on?
JS is a beautiful functional language used exclusively to write unholy abominations.javascript is actually quite unique among potential beginner languages because everybody already has a decent js repl installed even if they're a retarded windows peasant (if you doubt what i am talking about, please open the inspect element menu in the browser you are using to read this and look for the "console" tab. there it is!)
it is also actually pretty close to scheme if you ignore how weird and badly thought out a lot of its specifics are and be careful about not triggering the weird type conversion shit
it would be good to move beginners off of it the moment they write something more complicated than a breakout clone so they don't have to enjoy javascript edge case prison for the rest of their lives
and that would teach that changing languages is not some kind of impossible thing that takes years but in fact something basically every programmer does when they need to make a quick script to do some retarded shit and their main language would make it a bit too unwieldy (or there's a weird dsl that's a good idea for that specific task, see:man 1 make)
tbh, even as someone who has a degree in this shit, category theory terminology always makes my eyes glaze over when I read it.That's functors. Monads additionally have defined way of combining them with associative binary operation.
Category theory is sort of like Algol 68 to abstract algebra's Algol 60: It does something very similar but is adds a lot more complexity than seems justified by the gain in expressiveness, introduces entirely new terminology for things that we already had perfectly good names for, and everybody involved is (as near as I can tell) some sort of Commie scum (which explains the change in terminology, since Communism demands permanent revolution).tbh, even as someone who has a degree in this shit, category theory terminology always makes my eyes glaze over when I read it.
Cat theory isn’t real it’s a scary story they tell math undergradsJS is a beautiful functional language used exclusively to write unholy abominations.
tbh, even as someone who has a degree in this shit, category theory terminology always makes my eyes glaze over when I read it.