Name: Anonymous 2009-10-28 21:29
Name one noteworthy program that was coded in LISP.
I'll wait.
I'll wait.
import List
import Control.Monad.Instances
computeGraph removalOrder = zip (init edgeStarts ++ [lastVertex]) (removalOrder ++ [last edgeStarts])
where
((lastVertex:_), edgeStarts) = mapAccumL accumStep [1..maximum removalOrder + 2] (tails removalOrder)
accumStep vertices order = ((,) =<< (vertices \\) . (:[])) $ head (vertices \\ order)