Data dodania Pytanie
2018-02-13 15:02 Smallest number divisible by 10^n with digits totaling n -- Haskell »
I need to do this program: minor :: Integer -> Integer such that (minor n) is the smallest number divisible by 10^n whose digits add up to n. Fo...
(3) odpowiedzi
2018-02-13 14:02 What is the meaning or use of { _ => } and _ = somefunctionname() in scala »
As in the question, why do people write code in the most confusing manner in scala as in _ = function1(arg1, arg2) and anObject.method(ar...
(1) odpowiedzi
2018-02-13 14:02 Declaring a variable without assigning workaround »
i'm writing a small console application in F#. [<EntryPoint>] let main argv = high_lvl_funcs.print_opt let opt = Console.ReadLine(...
(1) odpowiedzi
2018-02-12 16:02 FS2 Stream exception handling not working »
I am having a problem with FS2 and exception handling. What I want is that, given a Stream[IO,A], when I map on it using an f: A => B that can thro...
(1) odpowiedzi
2018-02-12 10:02 What is the idiomatic "functional" way to take an Optional<String> and return a default string if null or empty, a modified string otherwise? »
What is the idiomatic, minimal (perhaps functional?) way to take an Optional<String> and say, return a default string, e.g. true if null or em...
(1) odpowiedzi
2018-02-12 02:02 What is functor bias? »
Following up from C++ Functors - and their uses, I have come across 'right biased functor' and 'left biased functor'. I have tried to do some research...
(1) odpowiedzi
2018-02-11 22:02 How to remove duplicate items in nested list? »
I have a Haskel function called flatten that works as such: flatten :: [[a]] -> [a] flatten [] = [] flatten ([]:vs) = flatten vs...
(1) odpowiedzi
2018-02-11 20:02 Confusion in understanding Substitution / `ap` type signature and different implementations (functional programming) »
I am a student of functional programming, sorry if my question sounds weird--I am trying to wrap my mind around the given type signatures for function...
(2) odpowiedzi
2018-02-11 05:02 Java 8 groupingby with returning multiple field »
In Java 8 group by how to groupby on a single field which returns more than one field. In the below code by I am passing name and the field to be sum...
(2) odpowiedzi
2018-02-10 16:02 What is the meaning of the cons "::" operator right after the "new" key word in this code snippet? »
I'm studying Scala and see in a tutorial the following definition. There are 3 "::". My understanding is that the first "::" is a method in class List...
(1) odpowiedzi
2018-02-10 08:02 remove first occurance of an element from a tuple using only functional programming in python »
I want to remove only the first occurrence of the element from a tuple in python using only functional programming concepts like map, reduce, filter e...
(2) odpowiedzi
2018-02-10 00:02 How to tidy data with a nested data frame? »
I am looking to tidy a nested data frame and I'm having some difficulties. I can reshape the data fine using one case, but I am looking to iterate ove...
(2) odpowiedzi
2018-02-09 14:02 Why is my transducer function slower than using ->> operator? »
While solving problem from Hackkerank (https://www.hackerrank.com/challenges/string-compression/problem) I've written 2 implementations with and witho...
(1) odpowiedzi
2018-02-09 11:02 Is what I wrote an actual monad? »
I have been trying to understand monads and since I recently understood what zippers are I thought I might try to combine both ideas. (>>=) does what ...
(1) odpowiedzi
2018-02-09 05:02 Does List in Scala is not homogeneous collection? »
I have this following function which set the head of list with new value def setHead[A](ls: List[A], ele: A):List[A] = { ls match { case Ni...
(2) odpowiedzi
2018-02-08 23:02 Scala Play json : functionnal operation error »
When I compile the following code : import $ivy.{ `com.typesafe.play::play-json:2.6.8` } // for ammonite users import play.api.libs.json.{JsPath, Wr...
(2) odpowiedzi
2018-02-08 17:02 Highest number of continuous zeros in Haskell »
In Haskell, I have this: import Numeric import Data.Char import Data.List toBin :: Integer -> Integer toBin n = read (showIntAtBase 2 intTo...
(1) odpowiedzi
2018-02-08 05:02 implicit function that compares two closed classes in Scala »
I am working with a Location object from another closed API and it already has a toString() method that returns a String. I just want an implicit func...
(2) odpowiedzi
2018-02-07 23:02 Does functional programming reduce the Von Neumann bottleneck? »
I believe (from doing some reading) that reading/writing data across the bus from CPU caches to main memory places a considerable constraint on how fa...
(1) odpowiedzi
2018-02-07 16:02 Closure Syntax Error F# »
I'm trying to implement the following C# code from the repository: https://github.com/alexsorokoletov/Xamarin.iOS.DatePickerDialog in F#: dialog.Sh...
(1) odpowiedzi
2018-02-07 01:02 Why does foldright work for infinite lists? »
I was under the impression that foldright starts from the end of a list and works backwards (this is how I imagined what right-associative means). So ...
(3) odpowiedzi
2018-02-06 20:02 Objects in functional programming - Immutability »
Recently I have been learning to program in Erlang as a long time C and C# developer. I am fairly new to functional programming. Now, I am trying to u...
(3) odpowiedzi
2018-02-06 10:02 Finding primes up to a certain number in Racket »
I'm learning Racket (with the HtDP course) and it's my first shot at a program in a functional language. I've tried to design a function that finds a...
(2) odpowiedzi
2018-02-06 05:02 Performing side-effects in Vavr »
I'm going through Vavr Usage Guide's section about performing side-effects with Match and other "syntactic sugar" as they call it. Here is the exampl...
(1) odpowiedzi
2018-02-05 22:02 Stream generator method in vavr »
There's a following example in Vavr documentation: // 1000 random numbers for (double random : Stream.gen(Math::random).take(1000)) { ... } How...
(1) odpowiedzi
2018-02-05 19:02 Vavr property testing »
Property checking feature is advertised in the latest Vavr documentation along with the following example of its usage: Arbitrary<Integer> ints...
(1) odpowiedzi
2018-02-05 09:02 Ways to (refine? is it?) type variables to concrete types in Idris? For a dependently typed HOAS Zipper »
I have the following: data Expr : Type -> Type where Lift : a -> Expr a Add : Num a => Expr a -> Expr a -> Expr a And : Expr ...
(1) odpowiedzi
2018-02-04 22:02 I'm trying to create a function in scheme which sums numbers from 1 to n but I keep getting error messages »
I recently started learning Scheme and I'm trying to create this recursive function which finds the number from 0 to the given parameter. Below is my...
(1) odpowiedzi
2018-02-04 07:02 SMLNJ powerset function »
I am trying to print the size of a list created from below power set function fun add x ys = x :: ys; fun powerset ([]) = [[]] | powerset (x::...
(1) odpowiedzi
2018-02-03 18:02 Clip up numbers bigger than maximum »
I have this function: fun min x y = if x >= y then y else x and I need to use this function (as a partial application) and make function clipup...
(3) odpowiedzi
2018-02-03 12:02 Catching a generic exception »
Problem I am writing a Result type in Java, and I have found a need for it to have a method that performs an operation which may fail, and then encap...
(3) odpowiedzi
2018-02-03 06:02 How do I determine the tests contributing to overall functional coverage in DVE »
In a regression run generating a merged coverage report, I am interested in determining the individual test(s) that contribute to each of the bins bei...
(0) odpowiedzi
2018-02-02 20:02 Weird case where map function is not called with a BehaviorSubject »
I'm front of a weid case in my Angular App about a map's RxJS not called. Please, take a look to this sample of code : const userSource = new Rx.Beh...
(2) odpowiedzi
2018-02-02 03:02 Ramda - partially applied function depends on full application »
I have a situation where the value that I want to add depends on a future value i.e. let metadata = {videoId: 123, likes: 400}; let addSubtitles = R....
(1) odpowiedzi
2018-02-02 01:02 Higher order function in F# »
Hi everyone I want to express the function call to test1 without firstly defining the function higher let higher = fun a b -> a>b let rec test1...
(2) odpowiedzi