Live data from Hacker News

Functional programming jargon in plain English

github.com

61–70 of 191 posts

Re: Functional programming jargon in plain English

#61

Earlier quoted context omitted.

In my simple language, `F` is that context. And (A->B) is a single-argument function. // Int -> Float oneArgFn(x) = x + 1.1 // List of Int -> List of Float ctxOneArgFn(xs) = ListFunctor(oneArgFn, xs) //ie., map()

Single-argument doesn't capture the difference between functor and applicative. ex1 :: Functor f => f (Int, Int) -> f Int ex1 = map (uncurry (+)) Applies a multi-argument function within a functor. What applicative allows you do is take a product of contexts to a context of products, and lift a value to a context. pure :: a -> f a zip :: (Applicative f) => (f a, f b) -> f (a, b) This can then be used to make ex1 into…

Sure, it's a particular interpretation of `(f a, f b) -> f (a, b)`

    (a, b) is an a -> b
    (f a, f b) is an f a -> f b
Applicative, over an above this, is really just useful when you have (f a, f b, f c, ..)

Re: Functional programming jargon in plain English

#62
post #36

Pet peeve: The word "just" when used to gloss over something with the author don't know how to explain. Using "just" shift the burden from the author to the reader, since it signals it is the readers fault if they don't understand. > A homomorphism is just a structure preserving map. In fact, a functor is just a homomorphism between categories as it preserves the original category's structure under the mapping. How a…

Mathematicians use "just" with a specific meaning: it is not used to gloss over something that the author doesn't know how to explain. It has a purpose, useful for mathematically trained readers. For suc a reader, "a homomorphism is just a structure preserving map" makes it clear that "homomorphism" and "structure-preserving map" can be used interchangably, and that by understanding one of the concepts, you'll immedi…

Both you and goto11 make a good point.

What is needed is "Mathematical English in plain English."

Re: Functional programming jargon in plain English

#63
post #36

Pet peeve: The word "just" when used to gloss over something with the author don't know how to explain. Using "just" shift the burden from the author to the reader, since it signals it is the readers fault if they don't understand. > A homomorphism is just a structure preserving map. In fact, a functor is just a homomorphism between categories as it preserves the original category's structure under the mapping. How a…

Mathematicians use "just" with a specific meaning: it is not used to gloss over something that the author doesn't know how to explain. It has a purpose, useful for mathematically trained readers. For suc a reader, "a homomorphism is just a structure preserving map" makes it clear that "homomorphism" and "structure-preserving map" can be used interchangably, and that by understanding one of the concepts, you'll immedi…

This has not been true in my experience, as someone who is used to talking to a mathematician during my academic life (a bit). They prefer to not use words like "just X".

They generally reply in definite statements, "this is undecidable", "this is an example of X", "this can't be done without Y", they rarely say. "X is just Y", they would probably say, "X is Y".

The "just" implies some form of detail that might be missing in the relation generally. Even my mathematical text books of pretty advanced topics rarely used "just".

Again, what you say is most likely true when math people talk amongst themselves but I don't think they do so with other non math people. I was in compsci.

Re: Functional programming jargon in plain English

#64
post #63

Earlier quoted context omitted.

Mathematicians use "just" with a specific meaning: it is not used to gloss over something that the author doesn't know how to explain. It has a purpose, useful for mathematically trained readers. For suc a reader, "a homomorphism is just a structure preserving map" makes it clear that "homomorphism" and "structure-preserving map" can be used interchangably, and that by understanding one of the concepts, you'll immedi…

This has not been true in my experience, as someone who is used to talking to a mathematician during my academic life (a bit). They prefer to not use words like "just X". They generally reply in definite statements, "this is undecidable", "this is an example of X", "this can't be done without Y", they rarely say. "X is just Y", they would probably say, "X is Y". The "just" implies some form of detail that might be mi…

"just" is used across technical academia (including philosophy) to mean "nothing over and above"

Re: Functional programming jargon in plain English

#65
post #36

Pet peeve: The word "just" when used to gloss over something with the author don't know how to explain. Using "just" shift the burden from the author to the reader, since it signals it is the readers fault if they don't understand. > A homomorphism is just a structure preserving map. In fact, a functor is just a homomorphism between categories as it preserves the original category's structure under the mapping. How a…

Mathematicians use "just" with a specific meaning: it is not used to gloss over something that the author doesn't know how to explain. It has a purpose, useful for mathematically trained readers. For suc a reader, "a homomorphism is just a structure preserving map" makes it clear that "homomorphism" and "structure-preserving map" can be used interchangably, and that by understanding one of the concepts, you'll immedi…

That would be an extremely good thing to explain in the introduction. I feel like this kind of very culturally-specific usage of everyday words is what makes math/CS papers so impenetrable for many people.

The word "easy" is another example: saying "it is easy to show X" (just?) means that X can be derived from the already stated theorems in a more-or-less mechanical way without having to introduce new concepts. It does not in any way suggest that deriving this will be "easy" for a student reading the paper.

(Of course the most challenging "easy" parts are best left as an exercise for the reader anyway...)

Re: Functional programming jargon in plain English

#66
post #36

Pet peeve: The word "just" when used to gloss over something with the author don't know how to explain. Using "just" shift the burden from the author to the reader, since it signals it is the readers fault if they don't understand. > A homomorphism is just a structure preserving map. In fact, a functor is just a homomorphism between categories as it preserves the original category's structure under the mapping. How a…

The former means: all Hs are SMPs ; the latter may also mean: some Hs are SMPs.

The former is clearer. Adjust your understanding of `just`, it's definition 4a at https://www.britannica.com/dictionary/just

Re: Functional programming jargon in plain English

#68
post #36

Pet peeve: The word "just" when used to gloss over something with the author don't know how to explain. Using "just" shift the burden from the author to the reader, since it signals it is the readers fault if they don't understand. > A homomorphism is just a structure preserving map. In fact, a functor is just a homomorphism between categories as it preserves the original category's structure under the mapping. How a…

Mathematicians use "just" with a specific meaning: it is not used to gloss over something that the author doesn't know how to explain. It has a purpose, useful for mathematically trained readers. For suc a reader, "a homomorphism is just a structure preserving map" makes it clear that "homomorphism" and "structure-preserving map" can be used interchangably, and that by understanding one of the concepts, you'll immedi…

>Mathematicians use "just" with a specific meaning: it is not used to gloss over something that the author doesn't know how to explain. It has a purpose, useful for mathematically trained readers.

Based on the author's public profile, I'm not convinced the author is a mathematician writing "... is just ..." as rigorous formalizations for a math-trained audience.

Instead, the "is just" phrases are innocently slipping into explanations as a subconscious verbal tic caused by the The Curse of Knowledge. My previous comment on that phenomenon: https://news.ycombinator.com/item?id=28256522

(Also, as a sidebar followup to your comment, Wikipedia's page about homomorphism (https://en.wikipedia.org/wiki/Homomorphism) has this as the first sentence: "In algebra, a homomorphism is a structure-preserving map ..."

I'm guessing that a hypothetical edit to "a homomorphism is _just_ a structure-preserving map" -- in an attempt to add more refinement and precision to the definition... would be rejected and reverted back by other mathematicians.)

Re: Functional programming jargon in plain English

#69
post #5
post #3

This is great. Finally understand monads a little better. Definitely saving this for later.

Why do monads come up so often when people talk about FP? Is it a meme or are they really an important and difficult to understand concept?

I think it is because monads can be used for handling side effects, even though side effects do not exist in FP. :)

Re: Functional programming jargon in plain English

#70
post #67

It looks like the Partial Application section is missing the most widespread form of partial application, known as "creating an instance". class A: def foo(self, x): # do something a = A() foo(1) # self is already "applied".

That's a very good point. People think of functional programming languages and OOP languages as entirely separate worlds that, like oil and water, do not mix. In reality they're equivalent, they just have different ergonomics.

For example, lambdas can be translated to anonymous inner classes.

Post reply on HN