All Questions

49
votes
1answers
2700 views

What is the monomorphism restriction?

I'm puzzled by how the haskell compiler sometimes infers types that are less polymorphic than what I'd expect, for example when using point-free definitions. It seems like the issue is the "monomorph...
580
votes
11answers
111061 views

Haskell: difference between . (dot) and $ (dollar sign)

What is the difference between the dot (.) and the dollar sign ($)?. As I understand it, they are both syntactic sugar for not needing to use parentheses.
15
votes
1answers
1197 views

Why shouldn't I mix tabs and spaces?

I often read that I shouldn't mix tabs and spaces in Haskell, or that I shouldn't use tabs at all. Why?
1159
votes
41answers
193123 views

What is a monad?

Having briefly looked at Haskell recently, what would be a brief, succinct, practical explanation as to what a monad essentially is? I have found most explanations I've come across to be fairly inacc...
231
votes
6answers
20913 views

Haskell: What is Weak Head Normal Form?

What does Weak Head Normal Form (WHNF) mean? What does Head Normal form (HNF) and Normal Form (NF) mean? Real World Haskell states: The familiar seq function evaluates an expression to what we ca...
23
votes
3answers
23234 views

Deploying Yesod to Heroku, can't build statically

I'm very new to Yesod and I'm having trouble building Yesod statically so I can deploy to Heroku. I have changed the default .cabal file to reflect static compilation if flag(production) cpp-opti...
66
votes
4answers
13669 views

Does Haskell have tail-recursive optimization?

I discovered the "time" command in unix today and thought I'd use it to check the difference in runtimes between tail-recursive and normal recursive functions in Haskell. I wrote the following functi...
761
votes
15answers
213216 views

Getting started with Haskell

For a few days I've tried to wrap my head around the functional programming paradigm in Haskell. I've done this by reading tutorials and watching screencasts, but nothing really seems to stick. Now, i...
113
votes
2answers
5970 views

Memory footprint of Haskell data types

How can I find the actual amount of memory required to store a value of some data type in Haskell (mostly with GHC)? Is it possible to evaluate it at runtime (e.g. in GHCi) or is it possible to estima...
36
votes
9answers
2215 views

How do I define Lisp’s apply in Haskell?

Shouldn’t this definition be allowed in a lazy language like Haskell in which functions are curried? apply f [] = f apply f (x:xs) = apply (f x) xs It’s basically a function that applies the gi...

Previous Next