### What is a good network graph library for language X?

I have noticed that a recurring question is: âWhat is a good network graph library for language Xâ. I have played with quite a few of the libraries and I can share my experiences with...

I have noticed that a recurring question is: âWhat is a good network graph library for language Xâ. I have played with quite a few of the libraries and I can share my experiences with...

I'm Having problems understanding functors, specifically what a concrete type is in LYAH. I believe this is because I don't understand what [] really is. fmap :: (a -> b) -> f a -> f b Is [],...

I don't understand what "lifting" is. Should I first understand monads before understanding what a "lift" is? (I'm completely ignorant about monads, too :) Or can someone explain it to me with...

fibs :: [Int] fibs = 0 : 1 : [ a + b | (a, b) <- zip fibs (tail fibs)] This generates the Fibonacci sequence. I understand the behaviour of the guards, of :, zip and tail, but I don't understand...

I've tried this: main = do hSetBuffering stdin NoBuffering c <- getChar but it waits until the enter is pressed, which is not what I want. I want to read the character immediately after user...

With this code: main :: FilePath -> FilePath -> IO () main wrPath rdPath = do x <- readFile rdPath writeFile wrPath x I got the following error: Couldn't match expected...

How do you increment a variable in a functional programming language? For example, I want to do: main :: IO () main = do let i = 0 i = i + 1 print i Expected output: 1

I'm currently using the Crypto.Random and Crypto.Random.DRBG Haskell libraries for generating random numbers. However, I find myself needing to store their states in some form of file (e.g. a .txt...

I've written a few packages containing some extra functions for dealing with common types that reflect the way I like to use them (for instance, I prefer to treat Bson documents as maps, rather...

I'm currently writing a Haskell package. I want it to behave differently on Windows and Unix. What is the most "correct" way to detect what OS my code is being compiled on? I did try using CPP and...

As part of a programming challenge, I need to read, from stdin, a sequence of space-separated integers (on a single line), and print the sum of those integers to stdout. The sequence in question...

I am using the Leksah IDE 0.15.0.1 and I get a warning when compiling the example package: "name ... found in source file but was not in scope". What is the meaning of this Warning ? I googled for...

I am writing a script that has a very logically complicated loop: main = do inFH <- openFile "..." ReadMode outFH <- openFile "..." WriteMode forM myList $ \ item -> ... ...

I've had the luxury of learning a bit of Idris lately and one thing I've found extremely convenient is the !-notation, which let's me shorten monadic code inside a do block such as a' <- a b' <-...

I am reading learn you a haskell for great good but i faced an error of Not in scope: `catch' when I read the exception section in input & output chapter here is my code: import System.Environment...

I am searching for Kotlin alternative to: (cons 1 '(2 3)) in lisp or 1 : [2, 3] in haskell or 1 :: List(2, 3) in scala, (which all result in sth like [1, 2, 3]) so I can prepend an...

I'm currently working on understanding the lens library in detail by following the explanation in https://en.wikibooks.org/wiki/Haskell/Lenses_and_functional_references#The_scenic_route_to_lenses,...

I'd like to convert a list of tuples (a,a) into just a list of as. This is what i have so far map (\(x,y) -> [x,y]) [(1,4),(2,5)] > [[1,4],[2,5]] but what i want is > [1,4,2,5]

I was solving a recursive problem in haskell, although I could get the solution I would like to cache outputs of sub problems since has over lapping sub-problem property. The question is, given a...

I have implemented a Set datatype in Haskell using Binary search tree. I have not used any of the in-built functions nor imported any module. My set datatype is as follows: data Set a = Empty |...

https://hackage.haskell.org/package/transformers-0.6.0.2/docs/src/Control.Monad.Trans.Reader.html#ReaderT I found that Reader is implemented based on ReaderT using Identity. Why don't make Reader...

I'd like to have a type class that tells me how big various types are. data Cardinality = Finite Natural | Infinite class Sized a where cardinality :: Cardinality It's pretty straightforward to...

Q) Write two different functions maximum1 and maximum2 that compute the maximum of three numbers. The built in max functions can't be used I have the following code, would this be considered...

Currently I need an immutable data structure (indexed by Int) that has fast read and update (basically, effectively O(1)), but somewhat slower cons (such as O(logn)) is acceptable. Other...

std::transform from the <algorithm> header applies to ranges, and it is what "enables" us to use ranges as the functors they are (*in the sense of category theory*(Â¹)). std::transform is...

I have implement the Set datatype using Binary search tree. My implementation is as follows:- data Set a = Empty | Node a (Set a) (Set a) I have also written some other functions such as...

Source: Hutton, Graham. "Programming in Haskell" (p. 267) Show how the Maybe type can be made foldable and traversable, by giving explicit definitions for fold, foldMap, foldr, foldl and...

I want to sum Doubles with the Data.Map.map function. So i want to have a function like this: sumTheDoubles :: Mapping.Map Char [(Char, Double)] -> Mapping.Map Char [(Char, Double)] I want to...

I really hope I haven't gone down a dead-end here. I have a Behaviour that gives the currently selected Color, and the current mouse coordinates, then carries out a task when the mouse is clicked....

I'm fetching a user from a database with a key I'm fetching from an api (uid). The uid is a Maybe ByteString, and so I can either case check whether it's a Maybe and then run the Redis monad, or...