Let's say I have a Future monad, so Future a represents an a that may or may not yet be available. Then sequenceA automatically gives me the semantics ...
Let's say I have a Future monad, so Future a represents an a that may or may not yet be available. Then sequenceA automatically gives me the semantics ...
I simulate lazy evaluation, i.e. evaluate only when needed and only once, in JS with Proxy and run into a problem with Traversable (mapA instead of tr ...
Say I have code where I want to do the following: Input: a list of strings [String] Operation (checkSat and checkResult) Obtains a boole ...
I've been on a bit of a "distilling everything to its fundamentals" kick lately, and I've been unable to find clear theoretical reasons for how the Tr ...
Trying to wrap my mind around traversals - or maybe something slightly different, in this case. I understand a traversal to be an operation that perf ...
Base provides ZipList, which is just a wrapper for [] where <*> is based on zip instead of cartesian-product. This isn't the default because it' ...
Data.Tree uses a list to represent the subtree rooted at a particular node. Is it possible to have two tree types, for example one which uses a list a ...
Consider these two functions in Haskell: replace_snd replaces the second element of a pair, or returns Nothing if there is no pair: inject_snd r ...
I can build a data structure that is a member of the Traversable typeclass (e.g. List or Map), by mapping (map, mapM) or folding (foldl, foldM) anothe ...
sequenceA is a well-known function: I wonder whether we can write down something similar for Arrows. Unfortunately, I did not manage to implement t ...
I have a Haskell exam in three days, so I thought I should practice a little and pulled up past exams, one of which features the following Tree dataty ...
I remember reading somewhere that a type like this one can't be Traversable: The bit of the explanation I remember is that for foldMap = foldMapDef ...
What should I use if I want to have something like basically I have a list of functions, all take in a value a and returns b. I want to apply all ...
I am trying to model the kdb/q "atoms and lists" through Haskell type system. In kdb/q all data is built from atoms. An atom is an irreducible value ...
The Naturality law states that: Now for the RHS of the law, if f has the type Applicative a => x -> a y, then t has to be of the type (Applic ...
How does Traversable use the fact that it subclasses both Foldable and Functor? t being a traversable type implies t is also a functor type and a f ...
I'm looking at Scala 2.12 Collection Library sources and noticed the following thing: What is the reason the Monad Ops are put into implicit class? ...
I have a Rose Tree structure and I wanted to write a Traversable instance for it. So I started with the following: data Tree a = Tree a [Tree a] deri ...
I have the following module which implements a directory walk: module Walk ( walk ) where import Control.Monad import Contro ...
Here I have a challenging php function that should return an instanceof Traversable (iterator) and also need to meet other assertions that test this f ...