Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 4495

Haskell is a purely functional programming language, featuring static typing, lazy evaluation, and monadic effects. The primary implementation is GHC, a high-performance compiler with a runtime supporting many forms of parallelism and concurrency.

7 votes

Each element is the sum of itself with the next element of a List: now do this point-free in...

Pointfree, eh? Let's ask lambdabot. <DanBurton> @pl map (\(y, z) -> y + z) (zip x (tail x)) <lambdabot> zipWith (+) x (tail x) Assuming that x is simply the input to this "function" <DanBurton> @p …
Dan Burton's user avatar
3 votes

Can I use mapWriterT instead of mapM/mapM_ (Haskell)?

mapWriterT is for transforming one WriterT into another. Its type is painfully generic, but allows you to transform pretty much everything about a WriterT. mapWriterT :: (m (a, w) -> n (b, w')) -> Wr …
Dan Burton's user avatar
10 votes

Simple chat server in Haskell

Haskell's threads are lightweight, so you can write your code using blocking calls and multiple threads, and rest assured that behind the scenes Haskell is using epoll. … [Haskell] so hard to reason about, especially when exceptions come into the picture. Exceptions are best avoided in Haskell, but you seem to have been able to reason about them fairly well. …
Dan Burton's user avatar
3 votes

Printing a factorial from an integer

Reifying a few of sepp2k's suggestions: module Main where import Data.Char factorial :: Integer -> Integer factorial n = product [1..n] isNat :: String -> Bool isNat [] = False isNat st = all isDig …
Dan Burton's user avatar
10 votes
Accepted

Periodically comparing the play count of two Last.FM users

I don't see why you say <- "decreases readability", but you could line them up if you think that helps (this style is typical of Haskell programmers) main = forever $ do diff <- user1 `subtractCounts …
Dan Burton's user avatar
7 votes
Accepted

How to shorten this terrible HTTP header parser?

You can use hGetContents to read lazily from a handle, and the split package (which will hopefully be bundled into the next Haskell Platform release) provides some nice ways of dealing with lists. … Keep an eye on conduit & friends; I get the feeling that within the next year or so the Haskell community will start to agree on the "best" implementation of this sort of abstraction, and then some good …
Dan Burton's user avatar