hot snippets

Submitted by metaperl on Fri, 06/02/2006 - 3:26pm.

6/2/06 [14:23]

sequence [] = [];
sequence (x:xs) = do x' <- x;
xs' <- sequence xs;
return (x' : xs')

Submitted by metaperl on Fri, 06/02/2006 - 4:19pm.

6/2/06 [15:16]

> let isSublistOf x y = any (isPrefixOf x) (tails y) in "dog" `isSublistOf` "the lazy cat's cousin"

Comment viewing options

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