functional-programming
Polynomial in Haskell
I have an exam on thursday about Functional programming and I’m pretty sure that I will have to do a TAD with Polynomials. I’m adding polynomials for the moment like this:[详细]
2023-03-31 07:23 分类:问答How can I write f(g(h(x))) in Scala with fewer parentheses?
Expressions like ls map (_ + 1) sum are lovely because they are left-to-right and not nested. But if the functions in question are defined outside the class, it is less pretty.[详细]
2023-03-31 04:42 分类:问答Is it possible to declare a type at function scope in F#?
Let\'s say I have a function which does something pretty complicated and it is implemented with the help of subfunctions. To make things easier, instead of tuples I would like to use some intermediate[详细]
2023-03-30 22:21 分类:问答Can currying be used with lambda functions?
This piece o开发者_如何学Pythonf code fails to compile and I don\'t know if it is because it can not be done, lambdas do not inherit from binary_function, or it is just that I\'m getting the syntax wr[详细]
2023-03-30 16:32 分类:问答Function Application Operator ($) in F#?
Let\'s say I have this code let identifier = spaces_surrounded (many1Satisfy isLetter) I was wondering if it there was any native F# function that allowed me to refactor it to[详细]
2023-03-30 07:00 分类:问答Choosing whether to use Discriminated Unions or Record Types for a small AST in F#
Let\'s say I am implementing a very simple toy language parser. I am deciding whether to use DUs or record types (maybe a mix of both?). The structure of the language would be:[详细]
2023-03-30 06:55 分类:问答Higher verbosity when using Record types in F# in comparison with Discriminated Unions
let Method = { Name:string } //oversimplification let method_parser = spaces >>. many1Satisfy isLetter .>> spaces[详细]
2023-03-30 06:40 分类:问答What is the name of this monad-like functional programming pattern?
I have occasionally encountered a pattern in code which resembles a monad but does not keep a consistent type across >>=.[详细]
2023-03-29 19:18 分类:问答Is it worthwhile learning erlang? [closed]
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a[详细]
2023-03-29 03:02 分类:问答When to use Partially Applied Functions [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing th[详细]
2023-03-29 02:58 分类:问答