I was having a look at the Arrow library found here. Why would ever want to use an Option type instead of Kotlin's built in nullables?
One advantage of pure functions is that their inputs fully determine their outputs, allowing the result to be cached for later use. However, I don't see how thi
I have an instance of Num for a type I created called Vec: instance Num Vec where (+) (Vec x) (Vec y) = Vec (zipWith (+) x y) And I am trying to write a test
I'm having some trouble with the test cases for Project Euler #1 on HackerRank and was hoping someone with some JS experience on HackerRank could help out. B
We have a microservice which enables consumers (indirectly) to query a database, where we have our own logic to limit what consumers can do with the queries. Wh
I came across a problem that required iterating over an array in pairs. What's the best way to do this? Or, as an alternative, what's the best way of transformi
I am trying to understand why my haskell function returns a nested tuple, and I cannot seem to wrap my head around the problem. I have this function that genera
I am working on an implementation of a state machine in scala. The original version is written in python, therefore I have a lot of if /else clauses in the co
I often hear that F# lacks support for OCaml row types, that makes the language more powerful than F#. What are they? Are they algebraic data types, such as su
Example given in JavaScript: Suppose we have two arrays [0,0,0] and [1,1,1]. What's the algorithm to produce all possible ways these two arrays can be combine.
Map and filter seem like they would be linear O(n) because they only have to traverse a list once, but is their complexity affected by the function being passed
I've learned that a pure function is a function that doesn't alter global state, period. If this is true, functions within functions can alter the state of the
I have the following array of objects: var memberships = [ { id: 1, type: 'guest' }, { id: 2, type: 'member' } ]; How can I verify if
val askNameFlatMap: ZIO[Console, IOException, Unit] = putStrLn("What is your Name? ") *> getStrLn.flatMap(name => putStrLn(s"Hello $name")) val askNa
I have 2D data that I want to apply multiple functions to. The actual code uses xlrd and an .xlsx file, but I'll provide the following boiler-plate so the outpu
I have a list of employees. They have isActive boolean field. I would like to divide employees into two lists: activeEmployees and formerEmployees. Is it possib
Is there a way of doing something like this: $test_array = array("first_key" => "first_value", "second_key" => "second_value"); var
Is it possible to define my own infix function/operator in CoffeeScript (or in pure JavaScript)? e.g. I want to call a foo b or a `foo` b instead of a.fo
Real World Haskell, chapter 4, page 98 of the print asks if words can be implemented using folds, and this is my question too: Is it possible? If not, why? If i
I am trying to reverse a list. Following is my code: reverseList :: [Int] -> [Int] reverseList [] = [] reverseList (x:xs) = x:reverseList xs What ends u