Data dodania Pytanie
2017-05-23 22:05 Where is the applicative in my Javascript traverse implementation? »
I've tried to understand Haskell's traverse function and to implement it in Javascript, but I'm stuck. When I look at its type (Functor t, Foldable t,...
(0) odpowiedzi
2017-05-23 12:05 Ramda JS best way to get the tightest geographic bound »
I am attempting to use the Google Places API in order to get the place name of a location I am in. The returned data structure has the following type...
(2) odpowiedzi
2017-05-23 11:05 Filtering an array of Maybe (nullable) types in Flow to remove null values »
I have an array of Maybe (nullable) type, I want to filter those null's to have an array containing only non-null values: @flow type Foo = { foo: ...
(1) odpowiedzi
2017-05-22 15:05 How do i pass the browser from test to test with Arquillian Drone and Graphene »
I'm trying out Arquillian Drone and Graphene and I have the following 2 tests what i want to do is have the second test use the browser from the first...
(1) odpowiedzi
2017-05-22 11:05 Pure functions when working with DOM manipulation »
I am trying to wrap my head around pure functions, but I am not sure that I really understand it. I know that pure functions shouldn't mutate external...
(3) odpowiedzi
2017-05-22 07:05 Is there any way to make a function's return accessible via a property? »
I'm a JS dev, experimenting with functional programming ideas, and I'm wondering if there's anyway to use chains for synchronous functions in the way ...
(4) odpowiedzi
2017-05-21 19:05 How to curry a function that takes an options object as argument rather than several distinct arguments? »
I have been looking into partial application and currying over the last few days. I'm wondering how could I use these concepts with a function that o...
(3) odpowiedzi
2017-05-21 17:05 "Stacking" effectful functions in functional language - DrRacket »
DrRacket is a functional programming language built in lisp. I created an effectful function called run-ins which take in an instruction and make som...
(1) odpowiedzi
2017-05-21 04:05 Functional Programming for UI test Automation in protractor with Javascript »
As I read about functional programming, it is considered as more concise, testable and with less side effects.I am wondering if using it, will be good...
(0) odpowiedzi
2017-05-20 19:05 Cannot guess decreasing argument of fix for nested match in Coq »
I have the following definition for terms : Inductive term : Type := | Var : variable -> term | Func : function_symbol -> list term -> t...
(2) odpowiedzi
2017-05-20 12:05 SML use abstype with signatures »
I'm writing a library to handle simple images in Standard ML. It should support different types used as colour for each pixel, e.g. bool, Word8.word, ...
(1) odpowiedzi
2017-05-19 14:05 Define the notion of "pairs" using higher-order logic »
Revising for a course on automated reasoning and I don't quite understand how to answer this question: Show how the notion of pairs (x, y) can be def...
(3) odpowiedzi
2017-05-19 13:05 Traverse a type generated by Azure Storage type provider in F# »
I am trying to get my head around type providers in F# and what they can be used for. I have the following problem: I have a series of JSON objects i...
(1) odpowiedzi
2017-05-19 10:05 Removing inverted duplicates from list of tuples »
So basically I have a list of tuples [(a,b)], from which i have to do some filtering. One job is to remove inverted duplicates such that if (a,b) and ...
(3) odpowiedzi
2017-05-18 21:05 Stateful computations in Scala using monads »
I've been trying to learn functional programming in Scala, and I finally managed to understand how to use the for comprehension to work with state: #...
(1) odpowiedzi
2017-05-18 19:05 Collecting values from events »
I have an event. The event is fired from time to time and it calls an Event Handler that is an Action<int>. Now I want to "collect" these integ...
(2) odpowiedzi
2017-05-18 17:05 Clojure, unquote slicing outside of syntax quote »
In clojure, we can use unquote slicing ~@ to spread the list. For example (macroexpand `(+ ~@'(1 2 3))) expands to (clojure.core/+ 1 2 3) This ...
(1) odpowiedzi
2017-05-17 21:05 How to use Ramda/JS correctly for composing functions »
I am trying to use a functional approach to solve a particular issue as part of an exercise in learning Ramda.js. So I have this test: it.only("map ...
(1) odpowiedzi
2017-05-17 12:05 function composition with rest operator, reducer and mapper »
I'm following an article about Transducers in JavaScript, and in particular I have defined the following functions const reducer = (acc, val) => a...
(3) odpowiedzi
2017-05-17 02:05 x = (a) => b(a) is not the same thing as `x = b` »
const x = (a) => b(a) is the same thing as const x = b const a = () => { console.log('hi'); } let x1 = a; let x2 = () => a(); x1();...
(1) odpowiedzi
2017-05-16 14:05 How to make this fibonacci function faster? »
This function to find the nth fibonacci works. a = 1 b = 2 fibonacci :: Int -> Int fibonacci 1 = a fibonacci 2 = b fibonacci n = (fibonacci (n-1)...
(4) odpowiedzi
2017-05-16 00:05 Is a Java lambdas equivalent to a JavaScript closures? »
I started learning about functional programming and I'm a bit confusing about it. My question is: is Java lambdas equivalent to JavaScript closures?...
(2) odpowiedzi
2017-05-16 00:05 What does it mean when an OCaml variable starts with `#`? (hash sign/pound sign)? »
I cam across this in a pattern match | {call_name = #bundle_source; _ } source Earlier in the code, bundle_source is defined as a type (type bundle...
(2) odpowiedzi
2017-05-15 18:05 Update a function to include tail recursion »
I have the following function that determines the maximum element of a given list. maxList :: Ord a => [a] -> a maxList l = let iMaxList :...
(3) odpowiedzi
2017-05-15 09:05 Clojure, can macros do something that couldn't be done with a function »
I'm learning Clojure macros, and wonder why we can't use just functions for metaprogramming. As far as I know the difference between macro and functi...
(1) odpowiedzi
2017-05-15 05:05 Haskell function composition -- putStrLn . show »
So I've got two functions that based on their types, I feel like I should be able to combine with function composition. ghci> :t show show :: ...
(0) odpowiedzi
2017-05-14 13:05 How can F# "remove a lot of subtle bug" from OCaml "+"? »
From Why is OCaml's (+) not polymorphic?, Keith said: The + versus +. thing removes a lot of subtle bugs which can crop up in converting different...
(0) odpowiedzi
2017-05-14 08:05 Record pattern matching »
According to this accepted answer, in F# and OCaml I need to use underscore for discarding the rest of the record. However, why does the handle' funct...
(1) odpowiedzi
2017-05-14 00:05 If it is impossible to have O(1) pred on CoC, then why does this work? »
I always assumed it had been proven that pred wasn't expressible in constant time on the Calculus of Constructions for any encoding of datatypes. Now,...
(1) odpowiedzi
2017-05-13 22:05 How to extract the second element of Sigma on the Calculus of Constructions? »
I'm attempting to do that as follows: λ (A : *) -> λ (B : (A -> *)) -> λ (t : (∀ (r : *) -> (∀ (x : a) -> (B x) -> r)) ->...
(0) odpowiedzi
2017-05-12 11:05 Unable to generate random number F# »
I am working on a small project and am trying to learn F# the functional way ,for some strange reason I am unable to generate a random number and as s...
(2) odpowiedzi
2017-05-12 04:05 How can I dynamic set a value into a property? »
How to set a property to value that should be resolve.. like this one.. const getDataFromServer = (id) => ({id: * 2}) R.set(payloadProp, getDataFr...
(1) odpowiedzi
2017-05-12 00:05 creating function to subset the data frame and then take mean of particular column in r »
Hoping to get some help on this I have a data frame : df<- data.frame(gem = c(Ruby, Opal, Topaz, Ruby, Ruby,Opal), cut = c(2,3,4,5...
(4) odpowiedzi
2017-05-11 19:05 Imperative vs Functional - understanding the von Neumann bottleneck »
In the Coursera course - Functional Programming in Scala - Martin Odersky talks about how Imperative Programming is constrained by the von Neumann bot...
(0) odpowiedzi
2017-05-11 12:05 How to write own List.map function in F# »
I have to write my own List.map function using 'for elem in list' and tail/non-tail recursive. I have been looking all around Google for some tips, bu...
(2) odpowiedzi