
18 Jun
2008
18 Jun
'08
11:33 p.m.
Hi guys, This is my second attempt to learn Haskell :) Any way here's the code: module Dot where import Prelude hiding ( (.) ) (.) :: a -> (a -> b) -> b a . f = f a infixl 9 . So for example, 99 questions: Problem 10 (*) Run-length encoding of a list. comparing: encode xs = map (\x -> (length x,head x)) (group xs) to encode xs = xs.group.map token where token x = (x.length, x.head) I found starting with data and working my way to a solution seems to be easier to think with, or maybe it's just me ... What is your thought? Jinjing