429
votes
15answers
45k views
Getting started with Haskell [closed]
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, ...
276
votes
11answers
28k views
How can a time function exist in functional programming?
I've to admit that I don't know much about functional programming. I read about it from here and there, and so came to know that in functional programming, a function returns the same output, for same ...
209
votes
6answers
16k views
Large-scale design in Haskell?
What is a good way to design/structure large functional programs, especially in Haskell?
I've been through a bunch of the tutorials (Write Yourself a Scheme being my favorite, with Real World Haskell ...
156
votes
10answers
17k views
Is functional GUI programming possible?
I've recently caught the FP bug (trying to learn Haskell), and I've been really impressed with what I've seen so far (first-class functions, lazy evaluation, and all the other goodies). I'm no expert ...
128
votes
4answers
4k views
“What part of Milner-Hindley do you not understand?”
I can't find it now, but I swear there used to be a T-shirt for sale featuring the immortal words:
What part of
do you not understand?
In my case, the answer would be... all of it!
In ...
100
votes
1answer
6k views
What's the status of multicore programming in Haskell?
What's the status of multicore programming in Haskell? What projects, tools, and libraries are available now? What experience reports have there been?
98
votes
5answers
3k views
Abusing the algebra of algebraic data types - why does this work?
The 'algebraic' expression for algebraic data types looks very suggestive to someone with a background in mathematics. Let me try to explain what I mean.
Having defined the basic types
Product •
...
80
votes
2answers
6k views
Real-world applications of zygohistomorphic prepromorphisms
Yes, these ones:
{-#LANGUAGE TypeOperators, RankNTypes #-}
import Control.Morphism.Zygo
import Control.Morphism.Prepro
import Control.Morphism.Histo
import Control.Functor.Algebra
import ...
79
votes
0answers
10k views
Can anyone explain Monads? [duplicate]
Possible Duplicate:
What is a monad?
I think I understand what 'Maybe Monads' are, but I'm not sure about the other types.
77
votes
7answers
14k views
What are the primary differences between Haskell and F#?
I've searched on the Internet for comparisons between F# and Haskell but haven't found anything really definitive. What are the primary differences and why would I want to choose one over the other?
73
votes
7answers
4k views
Why are side-effects modeled as monads in Haskell?
Could anyone give some pointers on why the unpure computations in Haskell are modeled as monads?
I mean monad is just an interface with 4 operations, so what was the reasoning to modeling ...
71
votes
16answers
9k views
Beginners Guide to Haskell? [closed]
I've been looking for a decent guide to Haskell for some time, but haven't been able to find one that seems interesting enough to read through and/or makes sense.
I've had prior exposure to Haskell a ...
70
votes
20answers
15k views
Learning Scala or Haskell
I'm considering dipping my toe in the functional programming world, and wondering if it would be better to start with Scala or Haskell. I'm coming at this primarily as a Python programmer. My only ...
68
votes
9answers
4k views
How do functional programming languages work?
I was just reading this excellent post, and got some better understanding of what exactly object oriented programming is, how Java implements it in one extreme manner, and how functional programming ...
64
votes
5answers
3k views
Functional design patterns
There are a lot of functional idioms: monads, applicatives, arrows, etc. They are documented in different articles but unfortunately I don't know any book or article where they're summarized in one ...
64
votes
2answers
2k views
What is the combinatory logic equivalent of intuitionistic type theory?
I recently completed a university course which featured Haskell and Agda (a dependent typed functional programming language), and was wondering if it was possible to replace lambda calculus in these ...
62
votes
6answers
10k views
How can I use functional programming in the real world?
Functional languages are good because they avoid bugs by eliminating state, but also because they can be easily parallelized automatically for you, without you having to worry about the thread count.
...
57
votes
14answers
6k views
Write a Haskell interpreter in Haskell
A classic programming exercise is to write a Lisp/Scheme interpreter in Lisp/Scheme. The power of the full language can be leveraged to produce an interpreter for a subset of the language.
Is there a ...
56
votes
3answers
2k views
Ordering of parameters to make use of currying
I have twice recently refactored code in order to change the order of parameters because there was too much code where hacks like flip or \x -> foo bar x 42 were happening.
When designing a ...
50
votes
17answers
6k views
A Gentler Introduction to Functional Programming [closed]
I am trying to learn Haskell, and I really like it, but I can't wrap my head around most of it. Would Lisp, OCaml, etc. be a gentler introduction to functional programming?
50
votes
7answers
3k views
Why is writing a compiler in a functional language easier?
I've been thinking of this question very long, but really couldn't find the answer on Google as well a similar question on Stackoverflow. If there is a duplicate, I'm sorry for that.
A lot of people ...
50
votes
3answers
4k views
Haskell function application and currying
I am always interested in learning new languages, a fact that keeps me on my toes and makes me (I believe) a better programmer. My attempts at conquering Haskell come and go - twice so far - and I ...
49
votes
1answer
1k views
Impredicative types vs. plain old subtyping
A friend of mine posed a seemingly innocuous Scala language question last week that I didn't have a good answer to: whether there's an easy way to declare a collection of things belonging to some ...
48
votes
9answers
2k views
In pure functional languages, is there an algorithm to get the inverse function?
In pure functional languages like Haskell, is there an algorithm to get the inverse of a function, (edit) when it is bijective? And is there a specific way to program your function so it is?
47
votes
2answers
1k views
Recursion schemes for dummies?
I'm looking for some really simple, easy-to-grasp explanations of recursion schemes and corecursion schemes (catamorphisms, anamorphisms, hylomorphisms etc.) which do not require following lots of ...
46
votes
9answers
6k views
Implications of foldr vs. foldl (or foldl')
Firstly, Real World Haskell, which I am reading, says to never use foldl instead of foldl'. So I trust it.
But I'm hazy on when to use foldr vs. foldl'. Though I can see the structure of how they ...
46
votes
1answer
1k views
What are paramorphisms?
Reading through this classic paper, I'm stuck on paramorphisms. Unfortunately the section is quite thin, and the Wikipedia page doesn't say anything.
My Haskell translation is:
para :: (a -> [a] ...
45
votes
10answers
8k views
Yet another Haskell vs. Scala question [closed]
I've been using Haskell for several months, and I love it—it's gradually become my tool of choice for everything from one-off file renaming scripts to larger XML processing programs. I'm definitely ...
44
votes
6answers
3k views
Is there a nice way to make function signatures more informative in Haskell?
I realize that this could potentially be considered a subjective or maybe an off-topic question, so I hope that rather than have it closed it would get migrated, maybe to Programmers.
I'm starting to ...
44
votes
4answers
4k views
Mathematica: what is symbolic programming?
I am a big fan of Stephen Wolfram, but he is definitely one not shy of tooting his own horn. In many references he extols mathematica as a different symbolic programming paradigm. I am not a ...