type Trigram a = (a,a,a) allTrigrams :: [a] -> [Trigram a] ...
Haskell On Frequencies of trigrams in ...
by sargon,
November 17, 2010 14:20
Haskell On compressing an array of int...
by sargon,
April 16, 2009 06:08
_geil_
Took a moment befor...
compress :: [Int] -> [(Int,Int)] compress (l:ls) = reverse $ foldl (\ o@((c,i):cs) x -> if x == c + i then (c,i+1):cs else (x,1):o) [(l,1)] ls compress [] = []
Haskell On compressing an array of int...
by sargon,
April 15, 2009 17:48
"look and say sequence" has...
Ruby On compressing an array of int...
by sargon,
April 15, 2009 16:57
Interesting. I have just re...
compress :: [Int] -> [[Int]]
compress (x:xs) = let (y,ys) = walk x xs
in [x,y]:compress ys
...
Haskell compressing an array of int...
I took the idea from "Alec ...
First, avoid using (!!) ins...