Tagged Questions
1
vote
1answer
41 views
Recursive Determinant
The following code I devised to compute a determinant:
module MatrixOps where
determinant :: (Num a, Fractional a) => [[a]] -> a
determinant [[x]] = x
determinant mat =
sum [s*x*(determinant ...
5
votes
4answers
531 views
Improving my solution to Project Euler problem #1?
I'm trying to compare my own implementation with another solution of ProjectEuler problem #1, which uses a list comprehension:
module Progression1 (sumProgressions) where
import Prelude
...
2
votes
2answers
240 views
Haskell markov text generator
I'm new to Haskell, and here is my first not-totally-trivial program. It's the first program I tend to write in any language -- a Markov text generator. I'm wondering what I can change to make it more ...
3
votes
2answers
118 views
Palindrome test in Haskell
I am new to Haskell and, coming from a OO/procedural programming background, I want to make sure my code follows the functional way of doing things. I built this short module to test if a given string ...
3
votes
1answer
92 views
Haskell tips/why doesnt this scale linearly?
My friend wrote a program which compares random arrangements of die faces to find the one with the most evenly distributed faces - especially when the faces are not a mere sequence.
I translated his ...
4
votes
1answer
134 views
Hangman: Is this small Haskell game clean and idiomatic Haskell code?
I hope this question isn't too general. I've been learning Haskell, and a while ago I created this Hangman game. I've been working on using a library for terminal output, so no more hardcoded escape ...
4
votes
1answer
198 views
Is this idiomatic Haskell?
I've been studying hard and asking a lot of questions - I finally came a cross an exercise in LYAH that looked like it was easy enough but a perfect candidate for practicing.
The below program has a ...