Data dodania Pytanie
2017-09-17 00:09 Trying to replicate the elements in a list n times in OCaml »
I'm trying to write a function that would take an input like : repeat 3 [1;2] ;; and display something like: [1;2;1;2;1;2] Now the code I...
(2) odpowiedzi
2017-09-16 13:09 How do you compose functions in PureScript? »
Tried to use (.) for function composition, but it doesn't work. import Data.String (length, trim) trimmedLength :: String -> Int trimmedLength = ...
(1) odpowiedzi
2017-09-16 08:09 haskell syntax confusion -- function type declaration »
I am trying to learn haskell by going through the learn you a haskell book. I came across a function which confuses me a bit and would like to look fo...
(1) odpowiedzi
2017-09-15 21:09 Invoke Instance Method Reference On Instance Argument »
In Java is it possible to, given a non-static method reference, and an instance of the class, somehow communicate that you would like that class insta...
(1) odpowiedzi
2017-09-15 16:09 Parsing JSON haskell »
I am trying to access the inner Object in my request. This is my code: {-# LANGUAGE OverloadedStrings #-} import Network.Wreq import Control.Lens i...
(1) odpowiedzi
2017-09-15 15:09 Pass arguments based on pattern matchin to function in R »
I do have an arbitrary number of R objects I would like to pass as arguments to a function. The naming convention for the objects is "input_\d+", i.e....
(2) odpowiedzi
2017-09-14 18:09 How does Foldable.foldl work on Num a => a »
In LYAH, there is a piece of code that looks like this. data Tree a = Empty | Node a (Tree a) (Tree a) deriving (Show, Read, Eq) instance F.Foldab...
(1) odpowiedzi
2017-09-14 14:09 Clarification about RxJS way of handling errors: "The observable data type disallows the exception from leaking from the stream's context" »
I am in reference to the RxJS in action book by Manning publisher which gives the following sample code to demonstrate the RxJS way of handling errors...
(2) odpowiedzi
2017-09-14 00:09 Converting List To Maps in Java 8 »
I am loading a log file as input stream and need to do aggregate processing on the matching values on each line, also I need to store duplicates while...
(1) odpowiedzi
2017-09-13 18:09 Using Reflex Platform to compile a stack project with local packages »
I would like to use the work-on script in reflex-platform to compile a project that has been managed using stack until now as explained here. In the ...
(1) odpowiedzi
2017-09-13 03:09 Elixir - Handling binaries, strings, and charlists (project euler 8) »
I was trying to solve some project Euler problems with Elixir but I stumbled upon a hard one I can't solve, and I think it's largely due to the fact t...
(2) odpowiedzi
2017-09-13 00:09 Sum of list elements and length of list in lambda calculus »
I am trying to make function for computing sum of list elements and length of list in lambda calculus. Example of a list: a := [1, 2, 3] = λcn.c 1 (c...
(1) odpowiedzi
2017-09-12 23:09 Scala: Function0 vs by-name parameters »
Can anyone give a definitive answer on how by-name parameters => T and Function0 parameters () => T are transformed into one another by the Scal...
(1) odpowiedzi
2017-09-12 14:09 Computing the "closure" of the attributes of an object given functions that change the attributes »
I have an object obj and a number of functions def func1(obj): #... def func2(obj): #... def func3(obj): #... that each ...
(2) odpowiedzi
2017-09-12 09:09 Using Ramda map helper in pointfree way »
How can I change this code: map(user => assoc('isAdult', isAdult(user), user) to function pointfree (using Ramda). I was thinking how to do it ...
(2) odpowiedzi
2017-09-11 17:09 Using transduce in JavaScript for optimisation - Transducers and Ramda »
Any ideas how can I use transduce from Ramda.js to make it work without intermediate transformations on data ((2x filtering, 1x sorting)) for optimisa...
(1) odpowiedzi
2017-09-11 11:09 What is Applicative Builder »
I am scala and functional newbie and trying to learn applicatives. val o1 = Some(1) val o2 = Some(2) val o3 = Some(3) val result = (o1 |@| o2 |@| o3)...
(1) odpowiedzi
2017-09-11 01:09 function overloading with std::function and generic lambdas: std::string preferred over int »
When trying to compiling this, suprisingly, it gives an error because the auto parameter of the lambda function has been resolved to std::string, and ...
(2) odpowiedzi
2017-09-10 22:09 With a Scala Either, how do you stop at the first error, but gets the already computed values »
For example, let say I have a function def foo(): Either[String, Int] = ??? I want to call this function 3 times. If all the values are Right, I wa...
(3) odpowiedzi
2017-09-10 20:09 sort an array based on an array of another/different type in haskell or purescript »
i have 2 Arrays of different types , 1) say moduleinfo array which has each element of type {name :: String, pack :: String } and 2) String Array....
(1) odpowiedzi
2017-09-10 01:09 Default parameter value undefined; is this a JavaScript Bug? »
Below is a syntactically valid javascript program – only, it doesn't behave quite the way we're expecting. The title of the question should help you...
(1) odpowiedzi
2017-09-09 19:09 Why does this racket function need an argument? And how does it work? »
I am a beginner in Racket and the following code is from University of Washington's Racket Programming course- (define s "hello") (define (pow1 x y) ...
(1) odpowiedzi
2017-09-09 11:09 Haskell irrefutable pattern matching »
In order to get a head start into the path of Haskell, I chose the book by one of its creators Hudak. So, I am going through the gentle introduction t...
(3) odpowiedzi
2017-09-09 11:09 Accessing object methods without `this` »
Can I write something like the following without using this? I want map to return another object with the same method names and method foo changed. Ho...
(2) odpowiedzi
2017-09-08 19:09 Generating all permutations in a functional language »
As an academic exercise I'm trying to generate all possible permutations of a list using the OCaml language, and can't use a for-loop. I can use vari...
(1) odpowiedzi
2017-09-08 14:09 Functional programming construct for composing identity and side effect »
Does functional programming have a standard construct for this logic? const passAround = (f) => (x) => { f(x); return x; }; This enables...
(3) odpowiedzi
2017-09-08 13:09 Sort Java Stream like switch conditional »
I'm trying to sort a stream by an specific order by one of its fields. Now I'm achieving this by converting streams to list and using a switch and th...
(2) odpowiedzi
2017-09-07 16:09 Selenium's driver.get() does not work under function composition »
Calling driver.get(url) causes errors when I try to compose it with other functions. Here are my small functional methods: const webdriver = require(...
(1) odpowiedzi
2017-09-07 15:09 How to Elaborate Rows in Pandas »
I would like to transform the below pandas dataframe: dd = pd.DataFrame({ "zz":[1,3], "y": ["a","b"], "x": [[1,2],[1]]}) x y z 0 [1, 2...
(3) odpowiedzi
2017-09-07 12:09 Time complexity of multiple string concatenation (join) in functional programming languages »
Am I right that the only algorithm that can be implemented in functional programming languages like Haskell to concatenate multiple strings (i.e. impl...
(1) odpowiedzi
2017-09-06 23:09 How to automatically generate a function to match a sealed case class family with implicit instances? »
I have a sealed case class family that specify some rules, which are deserialized from an external source. I also have a typeclass with a few instance...
(1) odpowiedzi
2017-09-04 22:09 OCaml - Why doesn't the the function change its output? »
My professor showed us this code today but I can't seem to understand the result of it: # let a = 2;; val a : int = 2 # let f = fun x -> fun y -&g...
(1) odpowiedzi
2017-09-04 17:09 Scala : File reading to Build an external Merge Sort »
I want to implement an external Merge Sort in Scala. It is used to sort huge files which can not fit in the main memory in their entirety. Details ca...
(1) odpowiedzi
2017-09-03 12:09 Auto Uploader what knowledge i need? »
I am thinking of develolping a tool Which basically do the following. Check in folder whether a new file has created (downloaded) Check in a list of...
(0) odpowiedzi
2017-09-03 07:09 How do I filter out the first occurrence from a list in Racket using plai-typed? »
In Racket using plai-typed, I am trying to find an element in a list and remove the first one it finds. It will then return the list with the first el...
(2) odpowiedzi