Your stage of Haskell Evolution?

Submitted by shapr on Mon, 03/21/2005 - 9:08am.
Freshman
49% (150 votes)
Sophomore
5% (15 votes)
Junior
10% (31 votes)
Senior
3% (10 votes)
Memoizing
1% (4 votes)
Points-free
6% (20 votes)
Iterative
0% (0 votes)
Accumulating
4% (12 votes)
Continuation-passing
1% (3 votes)
Boy Scout
3% (10 votes)
Combinatory
3% (8 votes)
List-encoding
0% (1 vote)
Interpretive
1% (3 votes)
Static
1% (2 votes)
Beginning graduate
2% (6 votes)
Origamist
3% (8 votes)
Cartesianally-inclined
0% (1 vote)
Ph.D.
3% (10 votes)
Post-doc
1% (3 votes)
Tenured professor
4% (11 votes)
Total votes: 308
Submitted by Cale Gibbard on Fri, 03/25/2005 - 2:38am.

Why is this poll closed after one vote?
Moreover, why is the result posted on the front page?

Submitted by jgoerzen on Fri, 03/25/2005 - 7:01am.

I don't know, but I've re-opened it.

Submitted by shapr on Mon, 03/28/2005 - 5:45am.

It seems that there are spam trackbacks, is there something we can do about that?

Submitted by jgoerzen on Mon, 03/28/2005 - 8:36am.

I try to delete the spam when I see it. If I've missed some, please let me know.

Drupal's spam module is reasonably effective with comments, but not so much with trackbacks (it doesn't actually integrate with the trackback module yet). I could simply disable trackbacks; let me know what you think of that.

Submitted by Paul Johnson (not verified) on Fri, 07/22/2005 - 4:29pm.

I'm at the Monad stage.

Its not listed in the Evolution, so here is my little contribution. I'm afraid I can't get the formatting to come out, so you'll have to infer it.


module FactorialMonad (factorial, Factorial) where


import Control.Monad.State


-- Declare the Factorial monad as a State holding two integers.
-- The first is the counter, the second is the accumulator. With
-- each tick the accumulator is multiplied by the counter and the
-- counter is incremented.
type Factorial = State (Integer, Integer)


-- Declare the initial state and the state modifier

factorialZero :: (Integer, Integer)
factorialZero = (0,1)

-- A 'tick' is a state computation that moves to the next factorial
-- and returns it.
tick :: Factorial Integer
tick =
do
modify next
gets snd
where
next (c, a) = (c+1, a * (c+1))

-- 'value' is a state computation that returns the current factorial.
value :: Factorial Integer
value = gets snd


-- The computation for 'factorial n' is therefore a sequence of n ticks.
factorial :: Int -> Integer
factorial n = evalState factorial' factorialZero
where
computation = sequence_ $ replicate n tick
factorial' = do
computation
value

Submitted by dtlin on Wed, 09/07/2005 - 12:49pm.

It's points-free for me:
fac = product . enumFromTo 1

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.