A functional programming language
8
votes
2answers
382 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. ...
5
votes
2answers
165 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 ...
50
votes
15answers
9k 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 ...
7
votes
2answers
494 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
97 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, ...
-1
votes
1answer
66 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 ...
5
votes
1answer
173 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 ...
12
votes
2answers
537 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
379 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 ...
8
votes
9answers
560 views
Resources for improving your comprehension of recursion? [closed]
I know what recursion is (when a patten reoccurs within itself, typically a function that calls itself on one of its lines, after a breakout conditional... right?), and I can understand recursive ...
9
votes
4answers
996 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?
14
votes
1answer
617 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 ...
7
votes
2answers
122 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 ...
3
votes
1answer
208 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 ...
5
votes
3answers
900 views
How is CoffeeScript influenced by Haskell?
I've been using CoffeeScript for a while now. On Wikipedia, it is said that CoffeeScript is influenced by Haskell. But after I check out the syntax of Haskell, I have found little resemblance from ...
8
votes
0answers
439 views
Why (or why not) are existential types considered bad practice in functional programming? [closed]
I've sometimes heard that using existential data types is sort of a bad practice in functional programming and that there are ways how to avoid it. I'd like to know, if it is really true, what are the ...
8
votes
2answers
814 views
Inspirational software for end-users written in Haskell? [closed]
I think great technology is invisible.
Besides the usual suspects (GHC, Xmonad, proprietary trading software) what great examples are there of end-user software written in Haskell?
I think good ...
2
votes
1answer
131 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
117 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 ...
4
votes
2answers
186 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 ...
5
votes
2answers
333 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 ...
5
votes
6answers
2k views
Which self balancing binary tree would you recommend?
I'm learning Haskell and as an exercise I'm making binary trees. Having made a regular binary tree, I want to adapt it to be self balancing. So:
Which is most efficient?
Which is easiest to ...
12
votes
1answer
384 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 ...
9
votes
2answers
357 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 ...
18
votes
2answers
725 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 ...
7
votes
1answer
169 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 | ...
24
votes
3answers
580 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 ...
7
votes
3answers
192 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 ...
4
votes
1answer
196 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 ...
2
votes
1answer
405 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 ...
5
votes
1answer
188 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 ...
2
votes
1answer
172 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 ...
26
votes
2answers
1k 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 ...
18
votes
4answers
962 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 ...
6
votes
3answers
1k 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 ...
15
votes
8answers
2k 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 ...
3
votes
2answers
268 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 ...
26
votes
12answers
2k 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 ...
3
votes
2answers
401 views
Lazy Processing of Streams
I have the following problem scenario:
I have a text file and I have to read it and split it into lines.
Some lines might need to be dropped (according to criteria that are not fixed).
The lines ...
34
votes
5answers
2k 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 ...
18
votes
5answers
1k 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 ...
29
votes
4answers
2k 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 ...
1
vote
0answers
196 views
Boost Phoenix or Haskell GHC generating C [closed]
I am working on an iOS app that does some number crunching in a variety of areas that would greatly benefit from a functional programming approach, though much of the rest of the application is ...
2
votes
2answers
591 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 ...
2
votes
1answer
140 views
How do I organize a GUI application for passing around events and for setting up reads from a shared resource
My tools involved here are GTK and Haskell. My questions are probably pretty trivial for anyone who has done significant GUI work, but I've been off in the equivalent of CGI applications for my whole ...
13
votes
1answer
387 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 ...
8
votes
5answers
388 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
92 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 { ...
13
votes
4answers
594 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 ...
32
votes
5answers
2k 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. ...