rampion

Washington, DC

del.icio.us/rampion

Age: 34

Mathematician, programmer, and researcher; with interests in algorithmic design, software engineering theory, and massively parallel computing. I'm also a keyboard junkie and an aspiring language nerd.

1d
comment Write a recursive function that constructs a set
How is Set defined? Are you using the one from Data.Set (via import Data.Set) or is there a data Set a = ... somewhere in the code?
Sep
17
comment Prime Factor Function in Haskell
"You try to pass the p as a Parameter to primeFactors where it expects [Integer]". OP does pass p as a parameter to primeFactsWith, but in the first position. Where it expects an Integer, which p is.
Sep
17
answered Prime Factor Function in Haskell
Sep
17
comment Prime Factor Function in Haskell
"p is an Integer but n is an List of Integer". Nope, according to primeFactsWith :: Integer -> [Integer] -> [Integer], in primeFactsWith n (p:ps), n is an Integer, p is an Integer, and ps is [Integer]
Sep
17
comment How to alphabetize list using getchar
Paul Griffiths: NULL, 0, and '\0' are all equal (though of different type).
Sep
17
comment What does fixIO do?
It can also be more succinct: fix (1:) is shorter than let x=1:x in x.
Sep
16
comment What does fixIO do?
Tom Ellis: I'm on my phone but I believe the definition of fix is fix f = let a = f a in a, so you're right, it's not necessary. but it is equivalent.
Sep
16
revised What does fixIO do?
it's => its
Sep
16
answered What does fixIO do?
Sep
16
comment What does ~~ ("double tilde") do in Javascript?
also ~~undefined // 0
Sep
15
awarded Yearling
Sep
15
awarded Yearling
Sep
15
awarded Yearling
Sep
15
awarded Yearling
Sep
15
comment More Concise Pattern Matching on ADT with Multiple Data Types?
You could use record syntax: data Foo = Bar { getInt :: Int } | Baz { getInt :: Int } | Bippy and then p :: Foo -> Maybe Int; p Bippy = Nothing; p b = Just (getInt b). You could reuse it latter with ViewPatterns: f (p -> Just _) = True; f _ = False.
Sep
15
answered More Concise Pattern Matching on ADT with Multiple Data Types?
Sep
12
comment How to break|break|return in a Haskell list comprehension
minitech: sigh, suppose I'll add the boundary check.
Sep
12
comment How to break|break|return in a Haskell list comprehension
minitech: thanks, fixed.
Sep
12
revised How to break|break|return in a Haskell list comprehension
added 4 characters in body
Sep
12
answered How to break|break|return in a Haskell list comprehension
1 2 3 4 5