The map() function applies a function across vectors, lists, or data frames efficiently. Syntax: map(.x, .f, ...) where .x is data, .f is function, ... for extra args. Examples: square vector elements via ~.x^2, get means of column across list of data frames with ~mean(.x$y), apply custom functions to rows/cols like df$z <- map_dbl(df, add_cols).
I feel that most programming languages are #male: the #imperative#paradigm (do this, then do that) matches the stereotype of "man commanding". Object-oriented #OO paradigm, same thing. #Functional paradigm resembles an assembly line, also stereotypically male.
I recently got some help from the #TypeScript Discord community and learned how to use "tagged union types" in order to solve a problem.
That term was from a 7 year old blog post and I wanted to find some more recent documentation to help me cement my understanding.
It took me a while, but I finally found something in a "TS for Functional Programmers" guide that's "designed for Haskell or ML programmers". It's apparently called a "discriminated union" and it's TypeScript's closest equivalent to data in #Haskell.
#functional#3dprinting
The dishwasher filter frame broke, so #ftijpi . The design looks easy, but it took quite some measurements and prototypes for the mesh to fit in.
The first prototype looked good in theory but failed after the first washing cycle (@65C).
I knew #PLA would warp and it did. The experiment failed successfully.
Now, I did a slight design change (2 supporting pillars) and printed in #TPU, which should be heat resistant up to 80C.
We'll see.
One of the things I like from #functional programming that more people need to use is "just use lists".
so many backend devs twist themselves into knots building complex APIs that can return a list of results, a single result, or a "no result found" error, when you could just return a list, a list with one element, or no elements.
Rainbow (as a terminal app) is starting to come together. The image shows part of a fully functional program that is also the instruction manual. Each section has its own execution context so it is easy to write self documenting code because the code can be executed exactly where it is defined as an example. #forth#programming#programminglanguages#ConcatenativeProgramming#functional
I have strong opinions about games and game culture, but I'll mostly post about technical stuff in here.
(probably)
(maybe)
(well, i guess my current propic already says a lot)
#Teaching#functional#programming to industry peers and graduate students in academia is mighty rewarding. But having to teach FP to junior IT programmers and novice CS students can be quite frustrating.
In #computing, deep experience and broad perspective matter much, much more than possessing mere skills.
Rainbow has no conditional statements nor branching capability (as these are evil) but it has a switch that selects between cases and puts the matching result onto the stack. This can be used to implement 'ifelse' and 'if' as shown. #Rainbow#FORTH#functional
Time for the #introduction post. I’m Vlad, a functional human being that is currently working on a proprietary #distributed querying #SQL system, mostly written in #scala with a small bit of #rust. I used to tinker with #embedded and #homelab things before the pandemic and haven’t quite gotten back to it yet. I’d like to post some more #functional programming content, perhaps some #photography and definitely a few #shitpost about politics or the lame state of software engineering in companies…