I hate it when someone tells me, "well Python and JavaScript can be programmed in functional programming style, so they are just as good as any other functional programming language," and "something something objects are the same thing as closures."
Then my program crashes and I spend 20 minutes debugging only to find that for the 100th time I wrote a method like this:
def getThing(self): self.thing
instead of like this:
def getThing(self): return self.thing
...where basically the problem is most of my program is written in functional programming style, except you STILL have to write the fucking "return" statement as the last line of the function.
If your language has "return" as a built-in control flow, it is hopelessly imperative not functional, and there is not a single monad framework or higher-order-function library anywhere that will make your language functional.
Stop telling me imperative languages like Python and JavaScript are just as good as functional languages, they are objectively worse than functional languages.
I'm trying to decide if the simplicity of just making every struct field public in #rustlang, actually worth the risk of people/future me, not using the constructors and/or adding mut and changing the validity guarantees that come with using constructors or transformers that are accompanied by the struct.
> Banana-RDF contains a more general library to work with RDF from Scala. It allows different underlying implementations like Jena and Sesame. A long term project will be to unify our work with that library.
It's so frustrating that whenever I ask about Functional Programming-style crates in Rust, the answer I get is mostly discouragement about doing full FP in rust.
Isn't rust supposed to have FP support?
Isn't FP supposed to help your programs be simpler, regardless of how purely functional your language is?
Been learning Haskell, and I’m starting to see how inefficient OOP is. For example, taken from “Programming with Haskell” from Graham Hutton with Quick Sort. Something like this in many languages requires way more lines of code. I hear Rust follows same approach to things, so that’s next.
There was a post pointing to the beautiful more than 30 years old #functionalprogramming paper "Why Functional Programming Matters" John Hughes. I could not find the post again to reply,
The paper gives a definition of "foldtree" on page 7:
"
foldtree f g a (Node label subtrees) =
f label (foldtree f g a subtrees)
foldtree f g a (Cons subtree rest) =
g (foldtree f g a subtree) (foldtree f g a rest)
foldtree f g a Nil = a
"
I wonder what the type of "foldtree" could be. Since the last argument
is "treeof ∗" in the first declaration but "(listof (treeof ∗)" in the second.
foldtree :: (a -> b -> b) -> (b -> b -> b) -> b -> Tree a -> b
foldtree f g a (Node x []) = f x a
foldtree f g a (Node x (t:ts)) =
g (foldtree f g a t) (foldtree f g a (Node x ts))
But probably I'm miss something here, since it takes only two declarations.
This language (that I only became aware today) seems the most similar to #scala syntax wise compared to the more recent new age langs that are targeting #wasm.
Also says it wants a "blend of fp" and bring it to more mainstream ppl.
Some obvious extras or improvements seem to come from #rust (at least on a quick look) which are nice.
But, the more the merrier, #FunctionalProgramming languages, static strong typed (it seems).
Does anyone know of an APL compiler or transpiler that can generated Vulkan or OpenGL shader scripts? (Free/libre would be most appreciated.) I think Aaron Hsu might have engineered something like this at some point, but I can't find anything about it at all right now, probably thanks to our amazing new "AI-enhanced" search engines.
This chapter took me a while and I need to reimplement it again. I think translate-codon should use a map . Having to wrap codons with codon-strings does not feel right , but I don't understand what partition returns.
Not sure about throw-away maybe a recursion is too much for this ? Maybe there are other built-ins I can use.
Using map more than once does not feel right. I think processing one rna a time would make it more simple.
I'm looking for recent books or up-to-date text on #FunctionalProgramming with PHP. #PHP is changing rapidly and all the books I see are nearly a decade old. Any good recommendations? #FP
"In a functional architecture, the basic unit is also a function, but a much larger business-oriented one that I like to call a workflow. Each workflow represents a unit of functionality—a feature, use case, scenario, story, or whatever you want to call it. Just as functions are “things” at the coding level, these workflows are things at the architectural level, and the basic building blocks of the architecture"
➥ Increment Magazine
Sure, one can use SDL2 or whatever to draw lines, and, sure, these figures have "aliasing", but the tasks call for aliased figures. (I already did antialiased lines in ATS for a different task.)