6 ms·
using recursion involves functions as basic block of logic, that represent sub-parts of a domain That's what functions do. often creates finite set of self de
by CyberDildonics 3y ago
using recursion involves functions as basic block of logic, that represent sub-parts of a domain
That's what functions do.
often creates finite set of self dependent functions
This doesn't have anything to do with recursion.
all you do is call and pass other functions, that will call each others
You this doesn't have anything to do with recursion.
If you consider `map` or `fold` these create opaque functional processes that operate very automatically.
I think you mean, they iterate for you. They don't use recursion.
On the other hand in OO you needed (until very recently) to create iterators and empty structure to modify step by step.
I really don't understand all this. You know most iteration is done with a for loop right?
PEG parsing where the monadic flavor replaces an externally managed stack
This seems like you're trying to write a satire of someone soaked in haskell. Everyone is else is just writing for loops and moving on.
- agumonkey 3y ago> This doesn't have anything to do with recursion. recursion is compressing the domain so small it eats itself, crafting a small set of function is mirroring this, kinda like grammars > You this doesn't have anything to do with recursion. > I think you mean, they iterate for you. They don't use recursion. afaik map and fold were defined recursively ... foldl f z (x:xs) = foldl f (f z x) xs albeit accumulative recursion (maybe that's what you mean by iterating) > I really don't understand all this. You know most iteration is done with a for loop right? that was what i was pointing at, iterators are not encapsulated enough > This seems like you're trying to write a satire of someone soaked in haskell. Everyone is else is just writing for loops and moving on. I'd appreciate if you didn't make it personal. Also, you forgot ocaml, lisp, prolog.
- CyberDildonics 3y agorecursion is compressing the domain so small it eats itself, crafting a small set of function is mirroring this, kinda like grammars I don't think this means anything. At best it's a completely abstract claim with nothing backing it up. It isn't "compressing a domain" to do iteration differently. afaik map and fold were defined recursively Fundamentally they are useful because the do the iteration for you. Internally it doesn't matter if the iteration is done in a roundabout way with recursion, they aren't about recursion and don't really have anything to do with them, just because some language decides to do iteration with recursion. that was what i was pointing at, iterators are not encapsulated enough You keep saying iterators, I keep saying iteration, but the only difference here is that the recursive version hides the accumulation in the arguments on the function. There isn't any more encapsulation, just a variable moved into the function argument. The brevity is from haskell's type deduction, not recursion.
- agumonkey 3y agoGrammars are not iteration concepts. Map doesn't do iteration. It's not about Haskell.
- CyberDildonics 3y agohttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... https://www.geeksforgeeks.org/python-map-function/ https://www.geeksforgeeks.org/python-map-function/ The whole point of map is that it does the iteration for you and you pass it a function. Iteration is literally the reason it exists.
- agumonkey 3y agomap predates javascript and python by decades
- CyberDildonics 3y agoWhat does that have to do with the fact that map iterates over a data structure?
- agumonkey 3y agoYou can't rely on how these languages describe mapping. Map doesn't simply iterate (that would be forEach), it creates another piece of information containing f(a) for all a in the input sequence. What would iterating over a tree yields ? what would mapping over a tree yields ? how do you define the latter ?
- CyberDildonics 3y agoYou can't rely on how these languages describe mapping. Says who? You didn't back this claim up with anything. Map doesn't simply iterate No one has ever said it 'only' iterates, you hallucinated this claim. The whole point that I've made is that just because a language like haskell uses recursion for iteration, it doesn't mean iteration and recursion are the same thing or that things that iterate have anything to do with recursion.