A functional programming language

learn more… | top users | synonyms

11
votes
2answers
681 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 ...
5
votes
1answer
583 views

Maths needed to understand theory behind Haskell's type system?

Recently, I've become deeply interested in Haskell. While attempting to learn new concepts (e.g. the forall keyword and ST monad) and Haskell's type system in general, I continually run into ...
5
votes
1answer
283 views

Why isn't `length` generic by default?

Haskell often provides two versions of a given function f, i.e: f :: Int ... genericF :: Integral i => i ... There exist many standard library functions with those two versions: length, take, ...
16
votes
3answers
5k 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 ...
-1
votes
2answers
701 views

Why don't we have a non-turing complete general purpose language yet? [duplicate]

Non-turing complete languages can solve every practical problem that a turing-complete language can. Also, they are much more analyzable than turing complete languages. The compiler can comprehend the ...
7
votes
1answer
776 views

Why is the Scala Option type not called Maybe, just as in Haskell?

Why is the Scala Option type not called Maybe, just as in Haskell? Maybe makes a lot more "semantic sense" to me, but maybe Option has different behaviour I am not aware of. Is there any particular ...
10
votes
2answers
1k views

Haskell memory efficiency - which is the better approach?

We are implementing a matrix compression library based on a modified two dimensional grammar syntax. Now we have two approaches for our data types -which one will be better in case of memory usage? ...
1
vote
1answer
205 views

Why does this article state that graduate education liberate one from concerns like the efficiency of hardware-based integers?

Quoting The Evolution of Haskell Programmer, graduate education tends to liberate one from petty concerns about, e.g., the efficiency of hardware-based integers What exactly does this ...
9
votes
2answers
573 views

In-memory datastore in Haskell

I want to implement an in-memory datastore for a web service in Haskell. I want to run transactions in the STM monad. When I google hash table steam Haskell I only get this: Data. BTree. HashTable. ...
8
votes
2answers
376 views

Choosing the language to build an app in based on hiring market vs performance and maintainability [closed]

I'm facing a choice of whether to start building Haskell components for a certain production app that is all done in Ruby. I'm leaning toward Haskell for several reasons, primarily speed (compiled ...
8
votes
3answers
514 views

When is it a good time to reason about performance in Haskell?

Simon Peyton Jones himself recognizes that reasoning about performance in Haskell is hard due to the non strict semantics. I have yet to write a significant project in haskell so I wonder: can I ...
6
votes
2answers
294 views

Is Haskell function composition an instance of pipe & filter architectural pattern

The pipe & filter architectural pattern is defined as a chain of processing elements, arranged so that the output of each element is the input of the next. Every example seems to consider ...
2
votes
5answers
501 views

The rationale behind Falsy values [closed]

I'm wondering what the arguments for/against Falsy values are. On what principles would you decide to add or exclude them from a language? Are there any problems you could see them causing off-hand? ...
11
votes
5answers
501 views

What is the name of λx.λf.fx (like reverse apply) in lambda calculus? Does the corresponding function have a standard name in programming?

What is the name of λx.λf.fx in lambda calculus? Does the corresponding function have a standard name in functional programming languages, like Haskell? In object oriented programming, is there a ...
1
vote
1answer
605 views

Modern REPL for Haskell - is anybody working on it? [closed]

It's time Haskell had a modern REPL like Mathematica's (or better). Make each calculation run in a separate thread, so user has control over each computation box's resources (ability to pause, play, ...
7
votes
2answers
1k views

Could we build a functional computer?

As mush as FP has done, in the end, all our programs are structured. That is, it doesn't matter how pure or functional we make a them - they are always translated to assembly, so what actually runs ...
-1
votes
1answer
109 views

Exclude the zero in the given data in Haskell [closed]

I have a list of integers. Also, I have a function which returns True when the element is non-zero, and returns False when the element is zero (let's call it FUNCTION1). So, how to define another ...
8
votes
1answer
380 views

Necessity to learn haskell language extension for production

Haskell core language is really simple. Coming from an OO background, the main difficulty is to adapt to the pure functional paradigm. While learning "basic" Haskell, I have always considered ...
15
votes
2answers
2k 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 _ ...
6
votes
2answers
1k views

Is Haskell/Clojure actually unsuited for dynamic systems such as particle simulation?

I've been told in previous questions that functional programming languages are unsuited for dynamic systems such as a physics engine, mainly because it's costly to mutate objects. How realistic is ...
12
votes
5answers
2k 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?
7
votes
2answers
221 views

Why have a wrapper constructor when storing a function in a data type?

I can never do too many Haskell tutorials. There is always something to refine and learn. So, I am working through chapter 10 of Real World Haskell, and everything makes sense. but Why do newtype ...
5
votes
1answer
370 views

Types in Lisp and Scheme

I see now that Racket has types. At first glance it seems to be almost identical to Haskell typing. But is Lisp's CLOS covering some of the space Haskell types cover? Creating a very strict Haskell ...
2
votes
1answer
260 views

Erlang/Haskell web service to server files [closed]

I have across a thread mentioning that Erlang would not be suited for a web application serving files. I was curious whether anyone had any experience building such webservice with erlang? Would ...
2
votes
1answer
203 views

Good serialization solution for communication between Python AND Haskell programs? [closed]

I found this: http://msgpack.org/ But.. I've never used it, so I don't know what whether it is much good. Anybody has proposals? Basic requirements: serialize as many data structures used ...
11
votes
2answers
775 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. ...
7
votes
2answers
280 views

Who first coined the term Higher Order Function and/or First Class Citizen?

I've come to understand that long before Haskell, O'Caml or LISP, higher order functions were an academic research subject and in mathematics, Schönfinkel (in 1967) and Haskell Curry (in 1968) already ...
7
votes
2answers
430 views

What's a good math textbook to have on my desk while studying Haskell? [closed]

I just started learning Haskell and it seems like you can't get too far in the language without being comfortable ( or at least exposed ) to certain branches of mathematics. Unfortunately I have major ...
17
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 ...
8
votes
1answer
351 views

Better to use error monad with validation in your monadic functions, or implement your own monad with validation directly in your bind?

I'm wondering what's better design wise for usability/maintainability, and what's better as far as fitting with the community. Given the data model: type Name = String data Amount = Out | Some | ...
18
votes
2answers
999 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 ...
28
votes
0answers
2k 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 ...
7
votes
3answers
405 views

Devising test of Haskell's value/reference semantics

In imperative languages, it is trivial to devise a programming test of language's use of "value semantics" or "reference semantics". One could do the following and check the value of a (where Vertex ...
7
votes
1answer
347 views

What monad is the opposite of the error monad in haskell

In the error monad, the first failure halts any execution further just carrying the fault through any following binds. What monad halts on success only carrying forward successes, and basically ...
25
votes
2answers
2k 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 ...
13
votes
2answers
964 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 ...
4
votes
1answer
432 views

Why would I use Control.Exception in Haskell?

I'm trying to really master Haskell error handling, and I've gotten to the point where I don't understand why I would use Control.Exception instead of Control.Monad.Error. The way I can see it, I can ...
2
votes
1answer
1k views

Fastest Haskell library sort implementation

I am implementing an application in Haskell and, for sorting, I use the library function Data.List.sort. However, I was wondering whether this is the fastest sort implementation in the Haskell ...
30
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 ...
9
votes
3answers
4k views

Fastest Functional Language

I've recently been delving into functional programming especially Haskell and F#, the prior more so. After some googling around I could not find a benchmark comparison of the more prominent functional ...
13
votes
1answer
698 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 ...
3
votes
2answers
335 views

What's the benefit of the Nothing constructor in Haskell?

I'm new to Haskell and I'm not really sold on the Nothing constructor. It sounds like just another silent fail that's going to create headaches down the line. It seems much more useful to throw an ...
1
vote
3answers
2k views

Using foldr to append two lists together (Haskell)

I have been given the following question as part of a college assignment. Due to the module being very short, we are using only a subset of Haskell, without any of the syntactic sugar or idiomatic ...
9
votes
5answers
625 views

What's the proper term for a function inverse to a constructor - to unwrap a value from a data type?

Edit: I'm rephrasing the question a bit. Apparently I caused some confusion because I didn't realize that the term destructor is used in OOP for something quite different - it's a function invoked ...
4
votes
1answer
134 views

Naming conventions for newtype deconstructors (destructors?)

Looking into Haskell's standard library we can see: newtype StateT s m a = StateT { runStateT :: s -> m (a, s) } newtype WrappedMonad m a = WrapMonad { unwrapMonad :: m a } newtype Sum a = Sum { ...
49
votes
5answers
6k 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 ...
18
votes
1answer
841 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 ...
11
votes
8answers
2k 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
2answers
374 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 ...
8
votes
9answers
2k views

OS choice for functional developing

I'm mainly a .NET developer so I normaly use Windows/VisualStudio (that means: I'm spoiled) but I'm enjoying Haskell and other (mostly functional) languagues in my spare time. Now for Haskell the ...