-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Trying to learn Haskell. I am trying to write a simple function to remove a number from a list without using built-in function (delete...I think). For the sake of simplicity, let's assume that the input parameter is an Integer and the list is an Integer list. Here is the code I have, Please tell me…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I'm trying to use Haskells Data.Heap module, but I'm incapable of even using it with integers. The only heap I've been capable of using is "empty", which does not take any arguments.
Later on I'll figure out how to instance for my needs, but for now I'd be glad if I was even able to test it with…
>>> More
-
as seen on Programmers
- Search for 'Programmers'
There has been some intermingling of Scala and Haskell communities, and I have noticed now and then people commenting on stuff that's supposed to be easy in Haskell and hard and Scala. Less often (maybe because I read Scala questions, not Haskell ones), I see someone mentioning that something in Scala…
>>> More
-
as seen on Programmers
- Search for 'Programmers'
I have problems installing ghc-mod on my linux machine. cabal worries about "happy" not being available in versione = 1.17:
$ cabal install ghc-mod
Resolving dependencies...
[1 of 1] Compiling Main ( /tmp/haskell-src-exts-1.14.0-1357/haskell-src-exts-1.14.0/Setup.hs, /tmp/haskell-src-exts-1…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
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 <-. What is it doing here?
>>> More
-
as seen on Programmers
- Search for 'Programmers'
The IO monad in Haskell is often explained as a state monad where the state is the world. So a value of type IO a monad is viewed as something like worldState -> (a, worldState).
Some time ago I read an article (or a blog/mailing list post) that criticized this view and gave several reasons why…
>>> More
-
as seen on ASP.net Weblogs
- Search for 'ASP.net Weblogs'
For some time now, I had been noticing some interest for monads, mostly in the form of unintelligible (to me) blog posts and comments saying “oh, yeah, that’s a monad” about random stuff as if it were absolutely obvious and if I didn’t know what they were talking about, I was probably an uneducated…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hackage has several packages for monad transformers:
mtl: Monad transformer library
transformers: Concrete functor and monad transformers
monads-fd: Monad classes, using functional dependencies
monads-tf: Monad classes, using type families
monadLib: A collection of monad transformers.
mtl-tf: Monad…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hello,
I'm trying to create a monad transformer for a future project, but unfortunately, my implementation of the Monad typeclasse's (=) function doesn't work.
First of all, here is the underlying monad's implementation :
newtype Runtime a = R {
unR :: State EInfo a
} deriving (Monad)
Here…
>>> More
-
as seen on ASP.net Weblogs
- Search for 'ASP.net Weblogs'
For some time now, I had been noticing some interest for monads, mostly in the form of unintelligible (to me) blog posts and comments saying “oh, yeah, that’s a monad” about random stuff as if it were absolutely obvious and if I didn’t know what they Read More......(read more)
>>> More