Questions tagged [functional-programming]

Functional programming is a paradigm which attempts to solve computational problems by the chained evaluation of functions whose output is determined by their inputs rather than the programme state. In this style of programming, side effects and mutable data are deprecated and usually strictly isolated.

12 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
0answers
420 views

FRP-style GUIs in Java

I recently built a small web application using riotjs, a library that facilitates creating UIs in the spirit of functional reactive programming, i.e. defining the UI as a pure function of the ...
3
votes
0answers
287 views

How to avoid passing configuration across functions?

I am writing module that other people can use in their code. It's a calendar. I want to allow users to set locale parameter so that they have month names and other data in language of their choice. ...
3
votes
0answers
91 views

What's the use of interfaces vs classes in typescript?

In the company in which I work, it is customary to model entities using Interfaces when developing with Typescript. To me, it seems much more effective to model entities with classes and then ...
3
votes
0answers
349 views

Clojure: Decomposing Logging, Metrics, and Business Logic from a Function

I was reading the post A Modern Architecture for FP that included a code snippet that the author wanted to decompose further. I don't know Haskell but I recognize enough to know that I've written many ...
2
votes
0answers
178 views

combine reader monad with choice

I have this two types open FSharpx open FSharpx.Reader type First = { Name: string Items: string list } type Second = { Name: string Numbers: int list } Using a Reader monad ...
1
vote
0answers
34 views

Applying Replace Conditional with Composition in functional programming

If I am writing in a functional style and want to use the Replace Conditional with Composition refactoring pattern on a switch or a long chain of if/else if/else if/..., how do I approach it? I ...
1
vote
0answers
55 views

Do MV* architectural patterns apply not only to OO languages but also functional languages?

I am learning about MV* architectural patterns, thanks to the help from several answers here. I learned that they are used for designing the architectures of user interactive applications. I also ...
1
vote
0answers
241 views

Understanding transducers, why this is not a transducer

I'm currently learning functional programming and trying to learn a new concept : transducers. I'm actually getting the point of theory, like it's an advanced map/reduce that aims to provide better ...
1
vote
0answers
328 views

How and where to make global function file in jsp sevlet web application

I am making a website in Servlet&JSP. I am looking for good way to make a specific function file from where I can call and declare my common functions. If I made a java file function. Java, so is ...
0
votes
0answers
36 views

Should I use “Map” or “Select” for new functor-like operators in C#?

I'm designing a type in C# that will be used as an algebraic type in a functional style, but is not a collection type and does not implement IEnumerable. If this type is a Functor, should I name its ...
0
votes
0answers
90 views

How to ensure this constraint at compile time?

I have an interesting constraint/invariant and I would love to hear people's input on how to maintain it. Big bonus if it can be ensured at compile time... I have the types below, and the following ...
-5
votes
1answer
40 views

Choosing 2 or 3 values out 3 values after calculating their closeness

I want to find a specific algorithm to choose either 2 or 3 out of 3 given values. Like if I have a set of values 10,11,12 all three are close enough so I will calculate the mean of the value and ...