A functional programming language

learn more… | top users | synonyms

57
votes
15answers
18k views

Is Haskell worth learning? [closed]

I am looking at this question primarily from a career point of view, so I hope you answer it accordingly. I am fairly proficient with Python, can write C++ and I am a final year student of computer ...
53
votes
0answers
5k views

How do you design programs in Haskell or other functional programming languages? [closed]

I have some experience in object oriented programming languages like c# or ruby. I know how to design a program in object oriented style, how to create classes and objects, and how to define relations ...
43
votes
5answers
5k views

What can Haskell's type system do that Java's can't and vice versa?

I was talking to a friend about the differences between the type systems of Haskell and Java. He asked me what Haskell's could do that Java's couldn't, and I realized that I didn't know. After ...
41
votes
5answers
3k views

what is the purpose of arrows?

I am learning functionnal programming with Haskell, and I try to grab concepts by first understanding why do I need them. I would like to know the goal of arrows in functional programming languages. ...
37
votes
5answers
3k views

Critique of the IO monad being viewed as a state monad operating on the world

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 ...
30
votes
4answers
1k views

“A proof is a program; the formula it proves is a type for the program”

This might be a philosophical kind of question, but I believe that there is an objective answer to it. If you read the wikipedia article about Haskell, you can find the following: The language is ...
29
votes
6answers
11k views

Haskell AND Lisp vs. Haskell OR Lisp

I currently code with C, C++, and Python. I'm wanting to pick up a functional programming language, and right now I'm leaning toward Haskell. I do NOT want to start a "Haskell vs Lisp" war here; what ...
29
votes
2answers
2k views

Misconceptions about purely functional languages?

I often encounter the following statements / arguments: Pure functional programming languages do not allow side effects (and are therefore of little use in practice because any useful program does ...
28
votes
12answers
3k views

Is Haskell's type system an obstacle to understanding functional programming?

I'm studying Haskell for the purpose of understanding functional programming, with the expectation that I'll apply the insight that I gain in other languages (Groovy, Python, JavaScript mainly.) I ...
26
votes
4answers
5k views

Are there any downsides or problems with Haskell?

I'm looking at diving into Haskell for my next (relatively trivial) personal project. The reasons that I'm tackling Haskell are: Get my head into a purely functional language Speed. While I'm sure ...
26
votes
2answers
2k views

Why did the Haskell committee choose monads to represent IO?

The Clean language uses uniqueness types to handle IO in a purely functional setting. Why did the Haskell committee go with monads instead? Were there other proposals for handling state that the ...
24
votes
11answers
7k views

Scheme vs Haskell for an Introduction to Functional Programming?

I am comfortable with programming in C and C#, and will explore C++ in the future. I may be interested in exploring functional programming as a different programming paradigm. I am doing this for fun, ...
24
votes
2answers
1k views

Applying Denotational Semantics to design of Programs

I've read a bit on denotational semantics (DS) and I'm very intrigued about the process of designing computer programs where types and functions have strong and clear mappings to mathematics. Are ...
23
votes
6answers
2k views

How do you encode Algebraic Data Types in a C#- or Java-like language?

There are some problems which are easily solved by Algebraic Data Types, for example a List type can be very succinctly expressed as: data ConsList a = Empty | ConsCell a (ConsList a) consmap f ...
22
votes
3answers
1k views

Why do some functional languages need software transactional memory?

Functional languages, by definition, should not maintain state variables. Why, then, do Haskell, Clojure, and others provide software transactional memory (STM) implementations? Is there a conflict ...
22
votes
0answers
1k views

Why (or why not) are existential types considered bad practice in functional programming?

What are some techniques I might use to consistently refactor code removing the reliance on existential types? Typically these are used to disqualify undesired constructions of your type as well as to ...
20
votes
3answers
1k views

Different ways to see a monad

While learning Haskell I have faced a lot of tutorials trying to explain what are monads and why monads are important in Haskell. Each of them used analogies so it would be easier to catch the ...
20
votes
4answers
3k views

Is Haskell good at teaching fundamentals of mathematics?

I'm involved in teaching mathematics to classes with requirements such as AS and A level Mathematics specification. Class books normally provide examples of computer software applied to mathematics ...
19
votes
3answers
8k views

Haskell vs Erlang for web services

I am looking to start an experimental project using a functional language and am trying to decide beween Erlang and Haskell, and both have some points that I really like. I like Haskell's strong ...
19
votes
2answers
1k views

Haskell web frameworks survey

There are several web frameworks for Haskell like Happstack, Snap, and Yesod, and probably a few more. In what aspects do they differ from each other? For example: features (e.g. server only, or ...
18
votes
2answers
899 views

How to improve efficiency with functional programming?

I've recently been going through the Learn You a Haskell for Great Good guide and as practice I wanted to solve Project Euler Problem 5 with it, which specifies: What is the smallest positive ...
18
votes
2answers
692 views

Type checking and recursive types (Writing the Y combinator in Haskell/Ocaml)

When explaining the Y combinator in the context of Haskell, it's usually noted that the straight-forward implementation won't type-check in Haskell because of its recursive type. For example, from ...
17
votes
3answers
1k views

Is return-type-(only)-polymorphism in Haskell a good thing?

One thing that I've never quite come to terms with in Haskell is how you can have polymorphic constants and functions whose return type cannot be determined by their input type, like class Foo a ...
16
votes
8answers
3k views

Why is the concept of lazy evaluation useful?

It seems lazy evaluation of expressions can cause a programmer to lose control over the order in which their code is executed. I am having trouble understanding why this would be acceptable or desired ...
15
votes
4answers
575 views

Why is it good not to rely on changing state?

This question arises out of the question Is Haskell worth learning? Generally a few often repeated statements are made, about how Haskell improves your coding skills in other languages, and ...
15
votes
2answers
1k views

What's the difference in content between Chris Okasaki's 1996 thesis and 1999 book, Purely Functional Data Structures?

I want to read Purely Functional Data Structures. I've easily found the thesis (which is freely available as a PDF), but see that there's a book available also. So I'd like to know what the ...
15
votes
2answers
361 views

Side effect-free interface on top of a stateful library

In an interview with John Hughes where he talks about Erlang and Haskell, he has the following to say about using stateful libraries in Erlang: If I want to use a stateful library, I usually build ...
15
votes
1answer
622 views

How often is seq used in Haskell production code?

I have some experience writing small tools in Haskell and I find it very intuitive to use, especially for writing filters (using interact) that process their standard input and pipe it to standard ...
14
votes
6answers
595 views

Introducing functional programming into your development environment [closed]

This is a long story but I will try to summarize it as best I can. We are a .NET shop that writes software for a variety of different types of funds. For example, we write health claims management ...
14
votes
5answers
2k views

What is the most compatible, widely used production language to export knowledge and skills gained from Haskell?

I like Haskell, plain and simple. While Haskell is used in production software, it's not especially widely deployed from what I've seen. What is the most similar and still widely used language in ...
14
votes
4answers
1k views

How does persistence fit into a purely functional language?

How does the pattern of using command handlers to deal with persistence fit into a purely functional language, where we want to make IO-related code as thin as possible? When implementing ...
14
votes
1answer
741 views

What's the progress on Haskell records?

Recently I stumbled once again on the issues of Haskells records, in particular the uniqueness of field names (it's a pain ...) I already read A proposal for records in Haskell from SPJ and Greg ...
13
votes
11answers
1k views

What should I understand before I try to understand functional programming?

I've been Learning Me A Haskell For Great Good because I thought it looked interesting. Of course, I'm completely sold on the idea that functional programming will end world hunger, bring about world ...
13
votes
5answers
510 views

How should someone used to FP thinking read imperative code?

I graduated from university about five months ago, and have been working in a local startup for past four months. While at university, I studied Haskell, F# etc on my own. We were taught Java at the ...
13
votes
2answers
1k views

Why does Haskell have built-in “if/then/else” instead of defining it as a simple library function?

Why does Haskell have a built-in if/then/else, which is dependent on the Bool type, instead of having a simple library function? Such as if :: Bool -> a -> a -> a if True x _ = x if False _ ...
13
votes
2answers
439 views

How to handle technological “Dogmatism”

I left a job (to relocate to another country) where I programmed in Javascript and Haskell (some python) most of the time. I really liked it because people were objective, positive, mathematical, and ...
13
votes
4answers
855 views

Unit testing statically typed functional code

I wanted to ask you people, in which cases it makes sense to unit test statically typed functional code, as written in haskell, scala, ocaml, nemerle, f# or haXe (the last is what I am really ...
13
votes
2answers
1k views

Suggestions for a GUI library in Haskell [closed]

As the Haskell Wiki itself states: There is a large number of GUI libraries for Haskell. Unfortunately there is no standard one and all are more or less incomplete. In general, low-level veneers ...
13
votes
1answer
507 views

Why doesn't Haskell have type-level lambda abstractions?

Are there some theoretical reasons for that (like that the type checking or type inference would become undecidable), or practical reasons (too difficult to implement properly)? Currently, we can ...
12
votes
3answers
3k views

What are the advantages of using LISP and Haskell? Will they make me a better programmer? [closed]

I know Lisp and Haskell are functional and logic programming languages respectively, but what exactly does this mean? How do they differ from other languages? I've heard that learning these will make ...
12
votes
3answers
1k views

How important are Haskell's advanced concepts like Monads and Applicative Functors for most routine programming tasks?

I've read the Learn You a Haskell book up to the point where they introduce Monads and stuff like Just a. These are so counterintuitive for me that I just feel like giving up trying to learn it. But ...
11
votes
8answers
1k views

Why isn't functional language syntax more close to human language?

I'm interested in functional programming and decided to get head to head with Haskell. My head hurts... but I'll eventually get it... I have one curiosity though, why is the syntax so cryptic (in lack ...
11
votes
5answers
1k views

In what programming language did “let” first appear?

I was wondering about the origins of the "let" used in Lisp, Clojure, and Haskell. Does anyone know which language it appeared in first?
11
votes
3answers
2k views

Ur/Web new purely functional language for web programming?

I came across the Ur/Web project during my search for web frameworks for Haskell-like languages. It looks like a very interesting project done by one person. Basically, it is a domain-specific purely ...
11
votes
2answers
781 views

does haskell have dependent types?

The questions all the title. Just to clarify, Haskell already has the ability to parametise a type over another type (this is just like template programming in c++), but can it parametise a type over ...
11
votes
2answers
520 views

Functional programming and stateful algorithms

I'm learning functional programming with Haskell. In the meantime I'm studying Automata theory and as the two seem to fit well together I'm writing a small library to play with automata. Here's the ...
11
votes
2answers
339 views

FP for simulation and modelling

I'm about to start a simulation/modelling project. I already know that OOP is used for this kind of projects. However, studying Haskell made me consider using the FP paradigm for modelling a system of ...
11
votes
2answers
638 views

Functional reactive programming — is Fay expressive enough?

So I'm doing a fairly involved javascript/html client with lots of ajax calls and other involvements of callback-ism. I'm entertaining the thought of using Fay for this purpose. I'm aware of Elm. ...
10
votes
4answers
7k views

The Future of Golang. Multiple Language Support? [closed]

Golang seems promising. I've been following this lang since its first release. It might take time to be a very good competitor to other programming languages. One brilliant aspect of Java and .NET I ...
10
votes
5answers
819 views

Would it be ok if I decide to write all my Ruby as if it were Haskell?

Given that Ruby has good list operation capabilities in-built - reduce, map, select, collect etc. It has Procs, Blocks and Lambdas, and has nice iteration support (the each family), would it be a bad ...