"Programming with Functions" is a 'technically correct' definition of what functional programming is. But functions operate on data. That's all they do. So a more precise definition would be "programming with functions that operate on data". What is data?
-
-
are their any fruitful applications of this point of view? it’s interesting to be able to identify collections of structures with collections of functions, but I just don’t know that i’ve actually seen this taken advantage of.
-
Simplest example: singleton (a.k.a. unit). It's a type that has a unique function from any other type to it. In Haskell unit::a->(). No other type has this property (utui). Product type is defined by projections, sum type by injections, etc...
Kraj razgovora
Novi razgovor -
-
-
"... a set with additional structure." But what's it mean to have "additional structure." Literally, a bunch of named functions.
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
-
-
are they one and the same to you? Surely constants is what normally people view as data, i.e. typically functions with no inputs. But what about functions? Since they can be inputs to other functions, cannot we call them data too?
-
Every pure functional expression is constant.
Kraj razgovora
Novi razgovor -
-
-
opposite of data is control, but it can be encoded as data too, namely with some source codes
-
many devs consider FP as encoding of control into data, but this doesn’t make the code declarative, it’s still imperative but more cryptic
Kraj razgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.