Data dodania Pytanie
2017-01-23 11:01 More pythonic way of filtering out stable values in a list »
I wrote a function that allows me to run through a list, compare the values with the predecessors, and assert at which point the list becomes "stable"...
(3) odpowiedzi
2017-01-22 20:01 how to get a sorted list of strings in haskell? »
I'm new in Haskell and I'm trying to write a function such that given a list of strings, it will re-order the strings in such a way that first there a...
(0) odpowiedzi
2017-01-22 17:01 Basics of argument passing in R's functions »
How R interpret line : arg.list <- list(x, y) in below definition of function, does it copy x and y into arg.list object when execution happen or t...
(2) odpowiedzi
2017-01-22 04:01 How to iterate through a key mapping and compare to another key mapping using functional programming »
I have 2 key maps, that I would like to iterate over. If the key is the same, then I want to use _.assign() to override the values. For example: var ...
(1) odpowiedzi
2017-01-21 14:01 Deduce the std::function result type and use it as a parameter »
This is how my simple class looks like. template <class T> class A { T first; T second; public: A(T f, T s) : first(f), second(s) {}; templat...
(2) odpowiedzi
2017-01-21 05:01 Why does Lean enforce recursive type arguments to appear after non-recursive ones? »
The following definition is rejected by Lean: inductive natlist | nil : natlist | cons: natlist → ℕ → natlist with the error message "arg #2 ...
(1) odpowiedzi
2017-01-21 00:01 Recursive javascript array length »
I'm trying to wrap my head around recursive functional programming concepts. Consider the following scenario (yes, I could just use .length to get th...
(4) odpowiedzi
2017-01-20 19:01 Adding elements to a newly defined list in Racket »
I am new to Racket and functional languages in general. For now I am just trying to prepend items to a list. The concepts are a bit confusing and not ...
(2) odpowiedzi
2017-01-20 00:01 How do I rewrite this code without the `var`? »
I have the following code to return a different object depending on the value of the array element at index 1 const myArray = Array(1,2,3) const...
(4) odpowiedzi
2017-01-20 00:01 FP: Trees - map, fold, each. How? »
I have a working OOP code that recursively renders a composition of graphical elements to a canvas. There's quite a bit to dislike about it and I'm tr...
(1) odpowiedzi
2017-01-19 22:01 Functional programming syntax in Swift »
I know there's a "better" way to get this item that I want, but I'm not as adept yet at Swift's functional programming syntax. I have a collection of...
(1) odpowiedzi
2017-01-19 12:01 Advanced example of RxJS5 combination with delayed observable »
Hy, i faced a problem with RxJS Combination operators... here is example object: const userData = { dbKeyPath: 'www.example.com/getDbKey', ...
(1) odpowiedzi
2017-01-19 10:01 attempting a code challenge in js, getting unexpected results -- »
The goal is to create a function called destroyer that filters all arguments after an initial array argument out of the array. I'm not very good at...
(4) odpowiedzi
2017-01-18 20:01 Why doesn't my network server on Racket receive data more than once? »
I'm trying to create a network server on Racket that receives data and does something with the data it receives. The issue that I'm having is that t...
(1) odpowiedzi
2017-01-18 16:01 Applicative instances for Reader, Writer and State »
I understand applicative vs monad style of programming, but most articles discuss this distinction with "simple" monads like Maybe. But what about m...
(1) odpowiedzi
2017-01-18 10:01 Lua flexible function argument unpacking in local function »
I am working on command handler that needs to work in two environments. Below is a a small part of the function I am working on, which I think capture...
(1) odpowiedzi
2017-01-17 19:01 Use flatMap on List[Either] in Scala »
Either is right-biased ince Scala 2.12 which allows it to be used in for/yield blocks without projection just like Option. But apparently this isn't e...
(2) odpowiedzi
2017-01-17 08:01 Why Doesn't Clojure provide standard library after creating new namespace? »
I came across this problem after creating a new namespace. Here is the code: (create-ns 'my-new-ns) => #object[clojure.lang.Namespace 0x7c7c8359 ...
(4) odpowiedzi
2017-01-17 05:01 Haskell, Case inside of Where »
I'm wondering if there is an idiom to handle the following example. It has to be pretty common, and I don't think you can use where clauses to handle ...
(1) odpowiedzi
2017-01-16 18:01 Futures never resolve and deliver to promise »
I am reading a book to teach myself Clojure called Clojure for the Brave and True. Chapter 9 covers basic concurrent programming including delays, fu...
(1) odpowiedzi
2017-01-16 13:01 immutability of data structures and variables in functional programming »
It's usually said that in functional programming data structures are immutable. I know that immutable data structure is a data structure that cannot b...
(2) odpowiedzi
2017-01-16 10:01 Force Java compiler to assume that all variables are final »
Is it possible -- via a compiler switch or a commonly used tool (which I do not know) -- to break a compilation if a variable is reassigned when not m...
(2) odpowiedzi
2017-01-15 10:01 If I code in the functional paradigm on CoffeeScript, will I get JavaScript compiled code to be containing functional programs too? »
CoffeeScript compiles into JavaScript, and it states that it is a functional language. So if I write code in the functional manner on CoffeeScript, wi...
(1) odpowiedzi
2017-01-15 07:01 Is slab allocator used to allocate memory for thunks in GHC? »
Is any slab allocator or something similar used to allocate memory for thunk structures in GHC? Or, does it use something naive like malloc in C? I g...
(2) odpowiedzi
2017-01-15 06:01 How we can filters an Observable by only allowing 2 distinct items through distinctuntilChange »
Currently, I'm observing the type and value ( int Int instead of Float ) of my slider and putting them in the tuple durationSlider.rx_controlEvent(UI...
(1) odpowiedzi
2017-01-14 12:01 Implement states in functional programming »
I'm currently writing an Android music player application using Scala. I chose Scala for its functional programming capabilities and I want to make th...
(0) odpowiedzi
2017-01-14 08:01 Thinking Functionally. Building a New Array in Haskell / Purescript »
I'm new to functional programming, and I've decided to build an app in Purescript. I've hit my first hurdle, and I'm not sure how to think about this ...
(1) odpowiedzi
2017-01-13 23:01 Understanding Currying in Scala »
I'm getting problems to understand the currying concept, or at least the SCALA currying notation. wikipedia says that currying is the technique of tr...
(3) odpowiedzi
2017-01-13 15:01 Calculating the `length` of `permutations xs` »
In Haskell's GHCi, type in length$ permutations [1..8] and it's instant. With length$ permutations [1..16] you're looking at .. minutes, hours perhaps...
(1) odpowiedzi
2017-01-13 12:01 How to design for extension using records »
I'd like to know how people from the Haskell community approach the following design. Assume a workflow-like system where you are piping some data (st...
(1) odpowiedzi
2017-01-12 21:01 How to count number of lines and perform operations in functional way in D? »
I have the following piece of code: import std.algorithm; import std.array; import std.csv; import std.stdio; import std.typecons; import std.getopt;...
(2) odpowiedzi
2017-01-12 08:01 F# either monad (ROP) to to compose function with two parameters »
I am using the chessie library of helper functions to do ROP (either monad) https://github.com/fsprojects/Chessie/blob/master/src/Chessie/ErrorHandlin...
(1) odpowiedzi
2017-01-12 05:01 How would I take the sum of different paths in a graph with Haskell »
Problem relatedQuestions calculates the question with the shortest reading time. Given the number of questions, an array of each questions ...
(0) odpowiedzi
2017-01-12 04:01 Is there anyone who has completed all the exercises in the "Common Lisp - An Interactive Approach" book? »
Here’s the link to the book. I’m stuck in the exercises of the “Recursion on Trees” chapter (Pg 148, Prob 18.25). It involves redefining two...
(0) odpowiedzi
2017-01-11 23:01 takeWhile, dropWhile laziness java9 »
In scala those methods works fine but in java9 dropWhile works differently I think. Here is example for takeWhile Stream.of("a", "b", "c", "de", "f"...
(4) odpowiedzi