Data dodania Pytanie
2017-12-07 21:12 Understanding the example from Reactive Programming In Node by Doglio Fernando »
Currently I'm reading very 'Reactive Programming With Node' by Doglio Fernando. I'm stuck at the beginning of it. Here is an example I do not understa...
(0) odpowiedzi
2017-12-07 13:12 Cannot access props in Higher Order Component React »
I have a simple class as follows that for the sake of this example just renders out the length of a list loaded from Firebase. class Companies extend...
(0) odpowiedzi
2017-12-07 05:12 How to functionally convert a nested hash to a list of records? »
Let's say I have a nested hash describing money quantities: my %money = (coins => {'50c' => 4}, notes => {'10' => 1, '20' => 5}); My...
(1) odpowiedzi
2017-12-06 17:12 Infinite list in Haskell »
I'm trying to define a function that creates infinite list of all possible words in my simple grammar. But ghci freezes when I enter head (generate []...
(2) odpowiedzi
2017-12-05 21:12 Tail recursion: comparing two cases »
Why is this tail recursion: def navigate(myList : List[Int]) : (Int, List[Int]) = { def navigate(step: Int, offset: Int, myList: List[Int]): (I...
(1) odpowiedzi
2017-12-05 14:12 Functional Programming: Embedding functions in AST? »
I'm currently attempting to use F# to model linking functions together as part of an AST (though at the moment it's more of a chain). Each link is a f...
(1) odpowiedzi
2017-12-05 07:12 How to Setup a Scheme environment to use with Simply Scheme book? »
I am working through the book simply scheme (Harvey, Wright). I want to setup an environment that works well with the code in the book and is easy goi...
(2) odpowiedzi
2017-12-04 17:12 Can this be refactored to use generic functional principles? »
A comparator function ascending accepts two arguments - a and b. It must return an integer comparing the two. I have a list that I want to sort by na...
(2) odpowiedzi
2017-12-04 14:12 Swift, use function UIView.removeFromSuperview as an argument in forEach function over array of views »
I would like to change following code let views: [UIView] = [] views.forEach { $0.removeFromSuperview() } to some other way, i...
(1) odpowiedzi
2017-12-04 09:12 Scheme (DrRacket) lambda expresion »
I do not understand the following program code. Can anyone explain it to me? (define myFunction (lambda (f x y z) (f x y z))) How can I simpl...
(2) odpowiedzi
2017-12-03 20:12 How can I handle nested case statements without an indentation tree? »
I occasionally run into a minor issue where I've got a set of nested case statements, which becomes cumbersome to handle. Is there any technique / pat...
(3) odpowiedzi
2017-12-02 18:12 High-Order Function »
In the course of funcional programming with Scala, I saw two form of declaration of a def. But I don't know the diferences between them, and the name ...
(1) odpowiedzi
2017-12-02 11:12 composing setState in react with Ramda »
I'm building a react app using Ramda. When the page loads I want to load some data and put it in my state so it looks like this: { "datasets": [f...
(1) odpowiedzi
2017-12-02 02:12 Cats EitherT.collectRight can't find Alternative[Future] »
I'm trying to find an example for Cats EitherT.collectRight. I've a EitherT[Future, String, Event] and when I do collectRight, I get Error:(79, 18) ...
(2) odpowiedzi
2017-12-01 10:12 Identity element of modulus operator to be used in fold »
In fold function in functional paradigm, we pass and accumulator value which is generally initialized as the identity element of the operator the func...
(1) odpowiedzi
2017-12-01 10:12 summing nested iterables with map-reduce/itertools »
I've been stuck with this data structure for a while now: iter([iter([1,0]),iter([1,1]),iter([0,0])]) I want to get to sum of the inner-most elemen...
(1) odpowiedzi
2017-12-01 05:12 Why does this fail when I don't use the ToList method in a for loop? »
I am wondering why if I change the line "sub = sub.SelectMany(x => x.Next(i)).ToList();" to "sub = sub.SelectMany(x => x.Next(i));" I...
(1) odpowiedzi
2017-11-30 12:11 Map an arbitrary n-ary Tree with fold »
I want to have some general purpose tools for dealing with trees. I'm using JavaScript, so there's little I can impose, and I'm using existing data st...
(2) odpowiedzi
2017-11-30 12:11 Composing Functions In Ramda With Each Function Receiving The Same Value »
If I want to compose a series of functions I can use compose, which will allow me to define a series of functions, with one or more arguments passed i...
(3) odpowiedzi
2017-11-30 11:11 how to use Special(reserved) characters in haskell? »
I am newbie to haskell.am trying to implement encryption for a given plain text to cipher.here below is my sample code encryptChar :: Int -> Char ...
(2) odpowiedzi
2017-11-29 19:11 isLeft works but fromLeft is not working in haskell »
I am new to Haskell .I am trying to run the Data.Either.fromLeft Command in a program. *NumericTypeCast Data.Char Data.List Data.Either> isLeft (...
(1) odpowiedzi
2017-11-29 07:11 Purely functional languages? »
what is purely functional language? And what is purely functional data structure? I'm kind of know what is the functional language, but I don's know w...
(2) odpowiedzi
2017-11-29 01:11 Create a stream of consecutive values that pass a filter »
Say I have a stream of numbers ---1-----1----1----0----0----1----1----0---> And i want to get a new stream of arrays containing consecutive 1's like...
(2) odpowiedzi
2017-11-28 22:11 Functional programming idiom for applying a series of void functions to a single value »
Given a value foo and a Stream of Consumer<Foo> void functions, what's the most concise way to apply each function to the value? Right now I hav...
(2) odpowiedzi
2017-11-28 17:11 Active pattern - Check list for consecutive elements »
So as a school assignment, I have to write a partial active pattern which recognizes a poker hand, for example: let (|FullHouse|_|) (x: (string * str...
(1) odpowiedzi
2017-11-28 16:11 Map application in scheme »
I am trying to understand procedure application and computation order in scheme. I have the following code: (map map (list map) (list (list list)) '(...
(1) odpowiedzi
2017-11-27 18:11 andmap in Haskell? »
In Racket, there is a really useful built in function andmap that lets see if a function evaluates to true on every element of a given list, as follow...
(2) odpowiedzi
2017-11-27 14:11 Why does my function composition implemented by reduce returns a closure? »
I want to derive a composition function for n-functions from reduce/fold, but it doesn't work as expected: $id = function ($x) { return $x; }; $co...
(2) odpowiedzi
2017-11-27 09:11 Convert array of objects to one Object using ramda.js »
I have an array: var a = [ {id: 1, val: 'a'}, {id: 2, val: 'b'}, {id: 3, val: 'c'}, {id: 4, val: 'd'}, ] And I want to get transfor...
(6) odpowiedzi
2017-11-26 23:11 Using `.of` Constructor on Sanctuary Maybe »
I'm working through a tutorial on functional programming that shows the following code example using the sanctuary.js library: var S = require('sanct...
(2) odpowiedzi
2017-11-26 16:11 Higher Order Function invocation strange behavior »
I have been playing with the code above and still don't know why is it behaving like this: function myforEach(arr, func){ for(var i=0; i<arr.le...
(2) odpowiedzi
2017-11-26 11:11 Search in the list of integers, one of the longest ordered subsets (not necessarily consecutive) ordered by growth »
Function, which finds in the list of integers one of the longest ordered increments of subscripts (not necessarily consecutive) numbers. Example: •...
(3) odpowiedzi
2017-11-25 21:11 How to Split string in f# without taking out the caracter used to split »
I'm trying to take a string like "hello world : bye world" and get ["hello world"; ":" ;"bye world"]. ...
(1) odpowiedzi
2017-11-25 17:11 functional parallelism and laziness in Scala »
Background I have been reading the book Functional Programming in Scala, and have some questions regarding the content in Chapter 7: Purely functiona...
(1) odpowiedzi
2017-11-25 08:11 Does the WHNF reduction in Haskell happen at Compile time? »
AFAIU the object file generated by Haskell compiler should be machine code. So does that object file have a representation of the original AST and red...
(1) odpowiedzi