Questions tagged [haskell]
A functional programming language
260 questions
0 votes
0 answers
715 views
Haskell where clause: is it more than just a matter of taste?
The traditional (Scheme, Pascal) way to structure code is this: declare outer function declare inner function body of inner function body of outer function The where clause in Haskell moves ...
1 vote
1 answer
346 views
In what sense are functions like fst and snd determined uniquely by their type signature in Haskell?
I have recently given Haskell another go, mostly because I heard about the book Haskell from first principles and so far I'm having a blast. My background is that of a mathematician mostly working in ...
31 votes
3 answers
6k views
Definition of "functor"; Haskell vs. C++
I'm trying to understand whether the Haskell and C++ communities mean different things by the word "functor", or if there's some underlying concept that unifies the two meanings. My ...
0 votes
1 answer
171 views
Imperative parallels to Haskell's Monad operations
Would it be (mostly) correct to say that the following are the parallels to the Haskell Monad operations in the imperative world? Monad's >> ~ C/C++/JavaScript/etc. , operator do expressions ~ C/...
0 votes
1 answer
242 views
How do Haskell Lists Desugar?
So, I was wondering about how Haskell's lists are implemented. I looked it up, and found this: data [] a = [] | a : [a] So I get that you can write lists like this if you want to: a:b:c:[] -- ...
-3 votes
2 answers
157 views
How can we handle inserts/delete cases using Map like data structures in FP?
Let's say, that we keep track of students entering the auditorium using their IDs(Key) and their check-in time(Value) in a Map. We delete the entries once they move out of the auditorium. I want to ...
2 votes
1 answer
328 views
Placing Haskell typeclass instances
I'd like to hear some pros and cons about where it's best to put Haskell typeclass instances. I identify 2 possible cases and can not decide for myself which one is best: Put the instances together ...
1 vote
4 answers
498 views
In Haskell, is it a "violation" of functional programming to interact with something that was not a function parameter?
I'm sure this must have been asked before, but I can't find anywhere that actually answers my question, so apologies if I have simply overlooked this. I am currently learning Haskell, and loving the ...