Data dodania Pytanie
2017-08-02 00:08 How to convert a string to a boolean[] array using Java 8 streams? »
The * character converts to true, everything else to false. This answer shows how to convert to Boolean[], but I seek to convert to an array of scala...
(2) odpowiedzi
2017-08-01 19:08 How to functionally compose Scala's Either »
If I have one or more Either values how can I compose them in a functional way so that I can log an error if there is a left value but continue in the...
(1) odpowiedzi
2017-08-01 12:08 Pipeline of functions scala »
Is it possible to create a pipeline of functions in scala?. I wanted to do something like the following syntax in F#, achieved through the |> operator...
(3) odpowiedzi
2017-08-01 08:08 Understanding Map and Reduce in Java 8/9 functional programming (lambda expression). How map() and reduce() increases performance? »
This one line of Functional Programming code does: 2*3 + 4*3 + 6*3 + 8*3 + 10*3 operation. int sum = IntStream.rangeClosed(1,10) /* closed range *...
(1) odpowiedzi
2017-07-31 23:07 declare variable scala as set of instructions »
Is it possible to declare a variable in scala as the result of a series of instructions?. I'm trying to do something equivalent to the following F# sn...
(2) odpowiedzi
2017-07-31 19:07 Functional programming dictionary character replace, keyboard layout fixer »
Let say we want to fix text that was written on a AZERTY(or Dvorak, or another language layout) keyboard, as if it was a regular QWERTY one. We want t...
(1) odpowiedzi
2017-07-31 00:07 Negating a function (functional) »
Does python have a built-in statement or function that negates another function? More specific: a function that takes another function fun (which retu...
(1) odpowiedzi
2017-07-30 22:07 React Stateful Components without classes »
In React, we can write components as pure functions. However, the problem with this is that you can't use it as stateful components because of the lac...
(1) odpowiedzi
2017-07-30 16:07 Scala - Difference between map and flatMap »
Can anyone teach me property use cases of map and flatMap? In Option case, I know these two methods have each signature, def map(A => B): Option[B...
(2) odpowiedzi
2017-07-30 11:07 Java 8 Function Style Programming what is the difference between currying and Functions Composition »
I am pretty new to the world of functional programming.Trying the new function style programming that ships with Java 8. recently I have come to know ...
(3) odpowiedzi
2017-07-28 22:07 Passing intermediate data between promises in JS without using Promise.all and Promise.resolve »
I'm kind of a JS noob, but so far I really like the ES6 / React / Immutable capability to do functional programming and FRP, and in particular, the pr...
(3) odpowiedzi
2017-07-28 11:07 Can a function which returns a new object be considered "pure"? »
Given the definition: A pure function is a function which given the same input, will always return the same output and produces no side effects. ...
(2) odpowiedzi
2017-07-28 00:07 What are some intuitions that support calling the Maybe constructor in Haskell "Just"? »
The intuition of an optional type like Maybe Int is that either there is no Int (thus, there's Nothing there) or that there is some Int; there is some...
(0) odpowiedzi
2017-07-27 20:07 @tailrec why does this method not compile with 'contains a recursive call not in tail position'? »
@tailrec private def loop[V](key: String): V = { key match { case _ => loop(key) } } This method doesn't compile and complain...
(1) odpowiedzi
2017-07-27 03:07 Convert some specific file format into Map concisely via functional paradigm in Java 8 »
I want to convert some file format into Java Map. My team uses some specific file format like below. <<<element1s_key1>>>value1 &l...
(1) odpowiedzi
2017-07-27 02:07 Transforming a string encoding a 3D array of booleans »
Suppose a 3D matrix is encoded in the form of a string as follows: src = "1 0 0 1 1 1 0 0 0 0 0 1" ...where three spaces separate layers, two s...
(2) odpowiedzi
2017-07-26 22:07 How to reference a generic parameter recursively? »
I have solved a Y-combinator problem. Just now I found that I cannot reference a generic parameter recursively. Y = λf.(λx.f (x x)) (λx.f (x x)) ...
(1) odpowiedzi
2017-07-26 14:07 Mix pure function with side effect in scala »
I have a simple api method: def addWishToBoard(wish: Wish, boardId: BoardId, userId: UserId): Option[Board] It adds wish to board, if boardId and u...
(3) odpowiedzi
2017-07-26 08:07 cabal -threaded options not working »
I am trying out Haskell and Cabal. I created a project with this config file. executable dictionary main-is: Main.hs -- other-modules...
(1) odpowiedzi
2017-07-25 15:07 Functions higher order with async and await »
Compiling the following lines with tsc import 'core-js/shim'; import { } from 'async'; The compiler quits with that error message: (...)/npm/no...
(0) odpowiedzi
2017-07-25 06:07 Uses “Recursion” concept to iterate Collection Data in Function Programming »
I read some papers and documents said that Function Programming uses “Recursion” concept to iterate Collection Data, while OOP uses “Loop” con...
(1) odpowiedzi
2017-07-25 05:07 functional update single value in q/kdb+ »
t:([] col1:`aa`bb`cc;col2:`aaa`bbb`ccc); field1:`col1; field2:`col2; v1:`aa; v2:`aaaa; I want same result by functional update as update ...
(3) odpowiedzi
2017-07-24 22:07 Extracting first defined value(if any) from sequence of suppliers of optional values »
Given a sequence of Supplier<Option<T>> -- e.g., a list of method references -- what's the idiomatic way to get the first defined result, ...
(2) odpowiedzi
2017-07-24 20:07 Is having a `(a -> b) -> b` equivalent to having an `a`? »
In a pure functional language, the only thing you can do with a value is apply a function to it. In other words, if you want to do anything interesti...
(3) odpowiedzi
2017-07-24 16:07 Count occurrences of each tag using functional programming »
I'm fairly new to functional programming and Kotlin and I've been trying to make a function that returns a Map<String, Int> with the key being a...
(3) odpowiedzi
2017-07-23 21:07 How can I reorganize this data using point free methods »
I'm trying to learn a bit about functional programming and Ramda and am using an old favorite data structure manipulation of mine to attempt some poin...
(3) odpowiedzi
2017-07-23 20:07 Solving dynamic programming problems using functional programming »
After you get a basic idea, coding dynamic programming (DP) problems in imperative style is pretty straightforward, at least for simpler DP problems. ...
(2) odpowiedzi
2017-07-23 15:07 Caching debounced functions in Javascript »
I'm trying to create a function wrapper that can be called with a DOM element as an argument and will return a unique debounced function tied to that ...
(1) odpowiedzi
2017-07-22 11:07 What is the difference between a Functor and a Monad? »
As stated in the title. There are similar questions here but they are attached to a particular programming language and I am looking for an answer on ...
(0) odpowiedzi
2017-07-22 00:07 Java 8 Stream run 1 function every index while another every n times »
Whats the best way to iterate over a Java 8 Stream such that I can perform one function for every element (forEach) while another for every 10 element...
(4) odpowiedzi
2017-07-21 21:07 Pattern to break up C# using blocks to enable functional programming »
Our server app has several methods, called in sequence that iterate through a 20M-row resultset and transform it. Each method in this pipeline stores ...
(1) odpowiedzi
2017-07-21 19:07 Why the variable can't be initialized correctly in inline function as in java? »
We know the lambda body is lazily well, because if we don't call the lambda the code in the lambda body is never be called. We also know in any funct...
(2) odpowiedzi
2017-07-21 12:07 Type cast not working using map function in Java 8 »
I am comparing two lists. List allUserGroups = UserBC.getAllGroupsForUser(userId, deptID); List<String> confUserGroups= Arrays.asList(configur...
(4) odpowiedzi
2017-07-20 23:07 How about a higher-order function called struggle? »
imagine your wife asks you to go buy some Campion flowers. as it’s a rare kind of flower you’re not sure if you can find it the flower shop next d...
(3) odpowiedzi
2017-07-20 13:07 Which terms is corresponding for Map, Filter, Foldable, Bind etc from Category Theory? »
I became interested and did not find in one place a list of corresponding terms: Map <-> Morphism Foldable <-> Catamorphism ... Who ca...
(0) odpowiedzi