Data dodania  Pytanie  

20170108 16:01 
Strange behaviour of list comprehensions
» I'm learning basics of Haskell and trying to solve project Euler's simple tasks: find largest palindrome of 3 digit numbers (100.999). I wrote this co... ^{(1) odpowiedzi} 

20170104 22:01 
React: Is it possible to call a higherorder component within a container component?
» In my codebase I have a higherorder component (HOC) I use to add all the input validation functionality to a given component. It works great when us... ^{(3) odpowiedzi} 

20161219 23:12 
How does lazyevaluation allow for greater modularization?
» In his article "Why Functional Programming Matters," John Hughes argues that "Lazy evaluation is perhaps the most powerful tool for modularization in ... ^{(1) odpowiedzi} 

20161217 16:12 
Scala: Higher order function to return the union of sets
» I am working on the following scala higher order function: def after(M: Set[Expression], n: String): Set[Set[Expression]] = { M.map((expr: Expression... ^{(1) odpowiedzi} 

20161212 16:12 
Abstract over repeated flatMap
» I am trying to generalize repeated, nested flatMap but not sure if one exists. The following code will produce all combinations of n choose 3, : d... ^{(1) odpowiedzi} 

20161209 00:12 
Markov processes with higher order functions in R
» I'm looking for a clean way to run simulations where each iteration depends on the result of the preceding iteration in a "functional style." For exam... ^{(0) odpowiedzi} 

20161208 20:12 
Return the maximum number in each array using map
» function each(coll, f) { if (Array.isArray(coll)) { for (var i = 0; i < coll.length; i++) { f(coll[i], i); } } else { for (va... ^{(5) odpowiedzi} 

20161206 18:12 
Haskell Higher Order Functions
» I have a homework on higher order functions in Haskell and I'm having a little trouble getting started. If I could get some help and explanation on t... ^{(1) odpowiedzi} 

20161115 20:11 
How to refactor (if / elsif / elsif) chain in Scala?
» I have a chain of if / else if statement that are not self explanatory. I would like to extract each into its own function with a clear explanatory na... ^{(7) odpowiedzi} 

20161105 00:11 
Write the recursive function adjuster
» Write the recursive function adjuster. Given a list of type x, an int and an element of type x, either remove from the front of the list until it is t... ^{(2) odpowiedzi} 

20161014 21:10 
How to pass the initial state as props for my Higher Order Component?
» I have a Slider component that doesn't handle its own state, instead, it's wrapped in another component called SliderDrag that manages the state and p... ^{(1) odpowiedzi} 

20160902 13:09 
Functional way to get or update
» I have a cache and have two functions to get an item from the cache and put an item to the cache. When getting item(from the cache), if key not exist... ^{(3) odpowiedzi} 

20160820 01:08 
Why is it useful to have an anonymous function stored as a variable, and pass it to higher order functions?
» I am working on my understanding of functional programming and have a question. In this example* an anonymous function is assigned to the variable is... ^{(4) odpowiedzi} 

20160722 00:07 
Functional Programming: Are maps sequential? Implications for closures
» I will illustrate with Julia: Suppose I have a function counter() that is a closure. function mycl() ... ^{(3) odpowiedzi} 

20160703 04:07 
Is it possible to get an unbounded map function on a set?
» Represent a set by its characteristic function, for instance, the set of integers should be like type Set = Int => Boolean And given some ... ^{(0) odpowiedzi} 

20160527 19:05 
Compose functions into another function
» Is there a function for Haskell in the standard library which takes three functions and returns a function which applies the return values of the firs... ^{(2) odpowiedzi} 

20160525 01:05 
How can JavaScript functions expanded?
» How can JavaScript functions expanded? I need a function expand(fn), s.t. given the functions below: function f() { console.log('f'); } functio... ^{(0) odpowiedzi} 

20160520 01:05 
Angular.js  Why use a function to return a function?
» I'm wondering, why do I sometime see functions that returns a function? For example this answer from this question: AngularJS custom filter function... ^{(4) odpowiedzi} 

20160513 00:05 
What is a purpose of Zap Functor and zap function in Haskell?
» I came across this construction in Haskell. I couldn't find any examples or explanations of how can I use zap/zapWith and bizap/bizapWith in real code... ^{(2) odpowiedzi} 

20160509 18:05 
React.cloneElement: pass new children or copy props.children?
» I'm confused by the third "children" parameter of React.cloneElement and it's relation to this.props.children. I followed this guide on higher order ... ^{(0) odpowiedzi} 

20160314 10:03 
Optimization of consecutive map/filter/fold calls
» Let's say I have a big list on which I'd like to execute multiple map, filter and fold/reduce calls. For clarity and expressiveness this should be don... ^{(1) odpowiedzi} 

20160226 15:02 
How can a more flexible, more expressive function composition operator be implemented?
» Function composition is a wonderful tool for code reuse by combining small, extremely specialized functions to solve complex problems. However, it has... ^{(0) odpowiedzi} 

20160210 04:02 
Functional Programming in Swit to distribute array elements to correct "buckets"
» I'm new to functional programming. My problem is that I have a main array and a fixed number of "destination" arrays. I would like to distribute the e... ^{(1) odpowiedzi} 

20160127 03:01 
Why is Haskell (GHC) so darn fast?
» Haskell (with the GHC compiler) is a lot faster than you'd expect. Used correctly, it can get closeish to lowlevel languages. (A favorite thing for ... ^{(2) odpowiedzi} 

20160124 15:01 
How to implement a more general partial reduce to mimic early exit / short circuiting?
» reduce (aka foldL in FP) is the most general iterative higher order function in Javascript. You can implement, for instance, map or filter in terms of... ^{(1) odpowiedzi} 

20160114 14:01 
Modify element(s) in a list where a condition is true
» case class Person(name: String, age: Int, qualified: Boolean = false) val people: List[Person] = .... val updated: List[Person] = people.map(person ... ^{(2) odpowiedzi} 

20151218 17:12 
Returning Values in Javascript Functions
» I came across this answer while understanding closures by @Jacob Swartwood http://stackoverflow.com/a/6472397/3179569 and I could not understand how ... ^{(3) odpowiedzi} 

20151216 03:12 
Why doesn't my filter function work? (Javascript).
» What I am trying to accomplish, being able to use the filter function to filter out the people that have the age: 21 and the color: blue. Any sugges... ^{(4) odpowiedzi} 

20151208 02:12 
R: Using user input to pass functions and parameters as parameters to higherorder functions
» I am not sure if this is doable (at least the way I am trying to do this), but I really hope so. I have a fairly complex testing environment that I a... ^{(1) odpowiedzi} 

20151108 18:11 
Swift higher order function (Church pair aka cons) with generic parameter types not accepting input parameter types
» I was messing around with the functional programming in Swift 2.1, trying to implement the Church encoding pair/cons function (cons = λx λy λf f x... ^{(1) odpowiedzi} 

20151013 12:10 
K / Kestrel Combinator for monads?
» implicit class KComb[A](a: A) { def K(f: A => Any): A = { f(a); a } } Given this implementation of the K combinator, we can chain method calls ... ^{(0) odpowiedzi} 

20151005 04:10 
Is there evidence for a correlation between FP Higher Order Functions and operations on DNA?
» The following commentator writes: Nature programs in strands of DNA and executes by zip, unzip, take, drop, filter, fold, repeat, cycle, and ++ ... ^{(0) odpowiedzi} 

20150927 04:09 
How to create a function that encodes runlength using fold_right?
» I created a function and helper function that find the number of repeating elements in a list, and what those elements. let rec _encode l x = match... ^{(1) odpowiedzi} 

20150924 13:09 
Check if a tree is a BST using a provided higher order function in OCAML
» So let me start by saying this was part of a past homework I couldn't solve but as I am preparing for a test I would like to know how to do this. I ha... ^{(1) odpowiedzi} 

20150920 06:09 
In Java, what are the reasons for Higher Order Functions (via lambdaj) over for (x:y) loops?
» I'm working on a large team of programmers on a Java System. The library LamdbaJ is in the working library, but many of the developers are skeptical o... ^{(0) odpowiedzi} 