A functional programming language
4
votes
2answers
117 views
Better way to familiarize myself with Haskell
I'm a Haskell beginner. I started learning Haskell around 20-25 days back. With a programming day job I am doing this in my spare time because I wanted to learn about functional programming.
...
2
votes
2answers
299 views
Is there any particular reason for the use of lists over queues in functional programming languages?
Most functional programming languages such as Scheme and Haskell use lists as their main data structure. Queues are identical to lists, except for the fact appending to the end - not to the begin - ...
1
vote
1answer
99 views
Building proprietary software over haskell compiler [closed]
Is it perfectly legal to use GHC as base and build some commercial application over its top ? Are there such examples I can can interact with ?
2
votes
2answers
125 views
Can someone explain the concept behind Haskell's memoization?
(note I'm putting the question here because it's about the conceptual mechanics of it, rather than a coding problem)
I was working on a small program, that was using a sequence of fibonacci numbers ...
10
votes
2answers
309 views
Are types erased in Haskell?
Haskell has a notion of “generic functions” that has some apparent similarity with common lisp—having neither experience with Haskell nor with common lisp, I might be very approximative here. This ...
4
votes
1answer
281 views
Implement Haskell typeclass with C# interface
I'm trying to compare Haskell's type classes and C#'s interfaces. Suppose there is a Functor.
Haskell:
class Functor f where
fmap :: (a -> b) -> f a -> f b
How to implement this type ...
15
votes
2answers
335 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 ...
0
votes
1answer
102 views
Haskell: Best tools to validate textual input?
In Haskell, there are a few different options to "parsing text". I know of Alex & Happy, Parsec and Attoparsec. Probably some others.
I'd like to put together a library where the user can input ...
18
votes
2answers
511 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 ...
8
votes
1answer
307 views
Why isn't there a typeclass for functions?
In a learning problem I've been messing around with, I realised I needed a typeclass for functions with operations for applying, composing etc. Reasons...
It can be convenient to treat a ...
4
votes
3answers
916 views
Why C# is not statically typed but F# and Haskell are?
There was a talk given by Brian Hurt about advantages and disadvantages of static typing. Brian said that by static typing he don't mean C#, but F# and Haskell.
Is it because of dynamic keyword added ...
7
votes
2answers
565 views
Can *any* program task be expressed without state?
This is a theoretical question, but after many years of programming in what I now realize is "normal" imperative technique, using C++ mainly, I've discovered this other world of functional ...
11
votes
2answers
465 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
408 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
234 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, ...
10
votes
3answers
2k 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 ...
0
votes
2answers
503 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
465 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
797 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
197 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 ...
6
votes
0answers
299 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
348 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
442 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
224 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
376 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?
...
9
votes
3answers
341 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 ...
0
votes
1answer
334 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
722 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
90 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
298 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 ...
13
votes
2answers
938 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
900 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 ...
10
votes
4answers
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?
7
votes
2answers
165 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 ...
4
votes
1answer
267 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
216 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
173 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
582 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
239 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
396 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 ...
14
votes
2answers
950 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 ...
7
votes
1answer
251 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
848 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 ...
17
votes
0answers
914 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
281 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
279 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 ...
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 ...
11
votes
2answers
673 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 ...
3
votes
1answer
326 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
670 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 ...