The characteristics I look for in Functional Programming
• first-class functions
• higher-order functions
• code as data
• immutable data
• pure functions (aka referential transparency)
• recursive (specifically: tail recursion)
• manipulation of lists
• lazy evaluation
• pattern matching
• monads (along with currying and partial application)
• separation of behavior from data
For the "What's a monad?" nigh inevitable question: a monad is a function that takes exactly one parameter and returns one result. Using a tuple for the parameter is usually considered cheating. Is is common for a monad that takes one parameter returns another monad, or a monad that returns a result.
A JavaScript example of a monad that returns a monad that returns a monad that returns a result of all the parameters multiplied together: const cf = (a) => (b) => (c) => (d) => { return a * b * c * d; }
The power of monads is partial application and function composition.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The characteristics I look for in Functional Programming
• first-class functions
• higher-order functions
• code as data
• immutable data
• pure functions (aka referential transparency)
• recursive (specifically: tail recursion)
• manipulation of lists
• lazy evaluation
• pattern matching
• monads (along with currying and partial application)
• separation of behavior from data
For the "What's a monad?" nigh inevitable question: a monad is a function that takes exactly one parameter and returns one result. Using a tuple for the parameter is usually considered cheating. Is is common for a monad that takes one parameter returns another monad, or a monad that returns a result.
A JavaScript example of a monad that returns a monad that returns a monad that returns a result of all the parameters multiplied together:
const cf = (a) => (b) => (c) => (d) => { return a * b * c * d; }
The power of monads is partial application and function composition.