type Trigram a = (a,a,a)

allTrigrams :: [a] -> [Trigram  a]
...

Haskell On Frequencies of trigrams in ...

by sargon, November 17, 2010 14:20

First, avoid using (!!) ins...

55ca8e1248605bf5e1819ce2c47c160f Talk

Haskell On radixSort algorithm

by sargon, November 16, 2009 23:44

joa.
But this is only a lan...

55ca8e1248605bf5e1819ce2c47c160f Talk

Haskell On radixSort algorithm

by sargon, November 10, 2009 09:37

why radixsort ?
Doesn't fi...

55ca8e1248605bf5e1819ce2c47c160f Talk

Haskell On compressing an array of int...

by sargon, April 16, 2009 06:08

_geil_

Took a moment befor...

55ca8e1248605bf5e1819ce2c47c160f Talk
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...

55ca8e1248605bf5e1819ce2c47c160f Talk

Ruby On compressing an array of int...

by sargon, April 15, 2009 16:57

Interesting. I have just re...

55ca8e1248605bf5e1819ce2c47c160f Talk
compress :: [Int] -> [[Int]]
compress (x:xs) = let (y,ys) = walk x xs
                  in [x,y]:compress ys
...

Haskell compressing an array of int...

by sargon, April 15, 2009 16:52, 6 refactorings, tagged with short

I took the idea from "Alec ...

55ca8e1248605bf5e1819ce2c47c160f Talk