|
reference semantics bitch
|
# ? Oct 9, 2015 17:18 |
|
|
# ? May 13, 2024 00:09 |
|
fleshweasel posted:reference semantics bitch ya, no wannabe functional langs like scala, f#, etc stop you from mutating objects inside supposedly pure data structures. haskell does, and i want to say that erlang might? even ocaml doesn't. gonadic io fucked around with this message at 17:26 on Oct 9, 2015 |
# ? Oct 9, 2015 17:22 |
|
python didn't seem to have any inbuilt way to flatten an arbitrarily nested list down to a single list which is dumb as poo poo
|
# ? Oct 9, 2015 17:32 |
|
MALE SHOEGAZE posted:python didn't seem to have any inbuilt way to flatten an arbitrarily nested list down to a single list which is dumb as poo poo def flattenAll(xs): xs.map(flattenAll) or whatever python's syntax is idk do not call on infinite generators
|
# ? Oct 9, 2015 17:46 |
|
MALE SHOEGAZE posted:python didn't seem to have any inbuilt way to flatten an arbitrarily nested list down to a single list which is dumb as poo poo tbf it's not like every language has that? I can only remember racket and erlang I wonder how many people proposed it and got rejected
|
# ? Oct 9, 2015 17:49 |
|
or i guess you only recurse if you're given a list, otherwise just return the element this is a gonadic io fucked around with this message at 17:53 on Oct 9, 2015 |
# ? Oct 9, 2015 17:50 |
|
don't start with the catamorphisms that are just monads in the theory of categories
|
# ? Oct 9, 2015 17:54 |
|
monad only pawn in theory of categories
|
# ? Oct 9, 2015 17:56 |
this is terrible programmer thread, please use existing words only
|
|
# ? Oct 9, 2015 17:57 |
|
this is a copromorphism in the category of postings
|
# ? Oct 9, 2015 17:57 |
|
is it time for monad discussion???
|
# ? Oct 9, 2015 17:57 |
|
https://mail.python.org/pipermail/python-dev/2006-September/068957.html
|
# ? Oct 9, 2015 17:57 |
|
ugh there they go again with the "it's easy to c&p soemthing from stack overflow so we won't put it in the standard library" what happened to batteries included
|
# ? Oct 9, 2015 18:01 |
|
Shaggar posted:is it time for monad discussion??? dont moan at me
|
# ? Oct 9, 2015 18:04 |
|
Barnyard Protein posted:i could have done it in a nice way with a scheme or racket, a smarter person maybe could have done it better with java8. but java8's functional interfaces don't allow for functions with more that two inputs. Not sure about your specific case, but you can define your own interface that has a method with three arguments and label it with @FunctionalInterface , and Java will then happily allow you to use lambda expressions for that interface.
|
# ? Oct 9, 2015 18:19 |
|
i hate monad chat because i assume everyone else is joking about not understanding them and im the only doofus who genuinely doesnt know wtf they are
|
# ? Oct 9, 2015 18:23 |
|
Monads are whatever you need them to be
|
# ? Oct 9, 2015 18:24 |
|
i need them to be easy to explain toa total dumbfuck
|
# ? Oct 9, 2015 18:25 |
|
If you understand a monad it ceases to exist
|
# ? Oct 9, 2015 18:26 |
St Evan Echoes posted:i hate monad chat because i assume everyone else is joking about not understanding them and im the only doofus who genuinely doesnt know wtf they are
|
|
# ? Oct 9, 2015 18:28 |
|
A monad is a space burrito. By which I mean it's just a type and three functions (map, join, and pure) that have particular signatures and respect the monad laws, plus some syntax sugar.
|
# ? Oct 9, 2015 18:29 |
|
Picture three burritos on the edge of a cliff...
|
# ? Oct 9, 2015 18:30 |
|
Soricidus posted:this is a copromorphism in the category of postings lmao
|
# ? Oct 9, 2015 18:32 |
|
For real though it's: can you define singleton and flatMap for your data structure. If yes than it's a monad if no then it's not.
|
# ? Oct 9, 2015 18:36 |
|
not terribad programming related, but relevant because CEO asshat and firing an entire engineering team: "Volkswagen's US CEO testified Thursday that the decision to use emissions cheating software was not made at the corporate level. Instead, it was 'software engineers who put this in for whatever reason,' Michael Horn told a congressional panel that is investigating the scandal." http://arstechnica.com/tech-policy/2015/10/volkswagen-pulls-2016-diesel-lineup-from-us-market/ i rofl'd.
|
# ? Oct 9, 2015 18:42 |
i was so triggered yesterday about this, ugh. they just were doing what they were told to
|
|
# ? Oct 9, 2015 18:43 |
|
ah yes the classic german excuse
|
# ? Oct 9, 2015 18:44 |
Shaggar posted:ah yes the classic german excuse
|
|
# ? Oct 9, 2015 18:45 |
|
Shaggar posted:ah yes the classic german excuse
|
# ? Oct 9, 2015 18:46 |
|
i wouldn't say triggered, i was loving pissed. i am wondering about the laws there about that sort of thing, and what if some asshat pulls this in the united states and what laws could protect the engineering team.
|
# ? Oct 9, 2015 18:46 |
|
there are whistleblower laws but lots of times whistleblowing leads to you being arrested as a terrorist. since its vw they could probably have told the EPA and been fine cause its not like its ford or chevy.
|
# ? Oct 9, 2015 18:49 |
|
Shaggar posted:there are whistleblower laws but lots of times whistleblowing leads to you being arrested as a terrorist. whistleblowing = time to shop for estates in moscow?
|
# ? Oct 9, 2015 18:51 |
|
only if putin doesn't have a stake in the entity you're exposing
|
# ? Oct 9, 2015 18:52 |
|
Shaggar posted:only if putin doesn't have a stake in the entity you're exposing Then you flee to the us
|
# ? Oct 9, 2015 19:04 |
|
Nitrocat posted:i wouldn't say triggered, i was loving pissed. i am wondering about the laws there about that sort of thing, and what if some asshat pulls this in the united states and what laws could protect the engineering team. lol yes, the usa definitely has laws to prevent employees being hosed over by their corporate masters, that's exactly what the last few decades of capitalist deregulation have produced
|
# ? Oct 9, 2015 19:06 |
|
firing software engineering teams makes your stock go up tho. nuremberg defense continues to fail
|
# ? Oct 9, 2015 19:19 |
|
MALE SHOEGAZE posted:python didn't seem to have any inbuilt way to flatten an arbitrarily nested list down to a single list which is dumb as poo poo if you tried this on a string you'd get a stack overflow
|
# ? Oct 9, 2015 19:31 |
|
gonadic io posted:ya, no wannabe functional langs like scala, f#, etc stop you from mutating objects inside supposedly pure data structures. python's documentation on this says cahins.from_iterable is the preferred way: http://docs.python.org/2.7/library/functions.html#sum x = [[1, 2], [3, 4], [5, 6]] list(itertools.chain.from_iterable(x)) which is the equivilent of saying [ for x for x in x for x in x].
|
# ? Oct 9, 2015 20:00 |
|
LeftistMuslimObama posted:I dug up the "text adventure" I wrote in TurboPascal in 10th grade. I didn't know anything about non-array data structures or about loading from/saving to files so the entire game map is encoded as several hundred methods. Each method does the following: I found the source code to this in an old dropbox: http://pastebin.com/Qvg91WBn
|
# ? Oct 9, 2015 21:35 |
|
|
# ? May 13, 2024 00:09 |
|
Soricidus posted:this is a copromorphism in the category of postings
|
# ? Oct 9, 2015 21:42 |