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
1answer
103 views
Is there a better way to walk a directory tree?
I just started to learn Haskell, and i wrote a function that walks the directory tree recursively and pass the content of each directory to a callback function:
The content of the directory is a ...
2
votes
1answer
75 views
Which of these two paren-matching functions is better?
I am currently trying to learn Haskell (after taking a Scala course on Coursera); but while I can write functions that do what I want, I worry that I am not learning to write idomatic/clean/performant ...
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 ...
3
votes
2answers
150 views
Haskell recursions, level zero
As a learning process I created 'reverse' function in a few different ways. Tinkering with 'reverse' made currying, folds and other stuff easier to understand. Almost natural!
I know these are ...