All Questions
18 questions
2
votes
1
answer
91
views
Meta Collatz Sequence
Context
Chapter 6 of Learn You A Haskell contains a function called chain, which outputs the Collatz sequence of a given input.
(In short, it takes a natural number....
5
votes
1
answer
337
views
Validate Finnish IBANs
I am currently studying an online course in Haskell and there are no "model examples" of the assignments after finishing them. I'm slowly getting the hang of this, but I'd like some feedback ...
3
votes
2
answers
66
views
5
votes
1
answer
308
views
Two player random number guessing game
I've created a two-player number guessing game in Haskell. My main objective was to practice dealing with "state" in a purely functional language (such as player scores, whose turn it is, ...
2
votes
1
answer
2k
views
Simple Haskell Parser
I'm very new to haskell (I never used Monads, Functors and other things) and FP in general. I decided to write the simplest parser I possibly can with some expansion possibilities. (I have a general ...
1
vote
1
answer
741
views
Poker Hand Evaluator in Haskell
The idea is to represent a hand as a list of cards and create a frequency mapping, which can then be used to identify what rank of hand you have and arrange your hand in a way that allows the Ord type ...
5
votes
2
answers
218
views
Removing OO style coding from Haskell
Having coded in Objected-Oriented style my entire programming career, it's hard to adapt to functional style fully.
I implemented a simple Hangman game:
...
1
vote
1
answer
132
views
Basic tic-tac-toe matrix in Haskell
Beginner functional programmer... (but not beginner programmer)
Currently, I have the following code:
...
5
votes
2
answers
266
views
Porting functional programming code to Linq
I am very new to C# programming, so for practice I thought I would try to port a simple haskell function over to Linq. From learn you a haskell, there is the following implementation of powerset:
<...
10
votes
1
answer
798
views
Printing patterns in Haskell
Write a function Int -> Char -> Char -> [String] that will create the appropriate pattern.
For example: ...
4
votes
3
answers
253
views
Prime factorization of an integer
I have just started learning functional programming (Haskell) for fun after using imperative languages my whole life. I am looking for quick and simple tips from pros on how the particular code I just ...
8
votes
4
answers
8k
views
Print "n" number of "hello world"
I had come up with the following code:
...
11
votes
4
answers
2k
views
Am I thinking functionally in these simple Haskell functions?
I'm learning Haskell using the University of Pennsylvania's online materials. I'm a few lessons in and was looking for some feedback about whether I'm thinking functionally enough or porting over my ...
4
votes
2
answers
2k
views
Simple Haskell calculator, using Maybe for error handling
I'm reading through Write Yourself a Scheme after finishing going through Learn You a Haskell. I attempted one of the early exercises: writing a program to get an operator and two numbers and do a ...
4
votes
1
answer
117
views
Counting items in categories
I'm an experienced programmer that also has a little experience with functional programming, although mostly theoretical (as in hobby-level reading and very minor projects).
I recently decided to ...