Skip to content

Instantly share code, notes, and snippets.

@yasar11732
Created December 15, 2019 23:47
Show Gist options
  • Save yasar11732/da6e7462fc584377b5fbd44ccf1ec0ad to your computer and use it in GitHub Desktop.
Save yasar11732/da6e7462fc584377b5fbd44ccf1ec0ad to your computer and use it in GitHub Desktop.
Real World Haskell CH04 exercises (2)
myGroup :: (Eq a) => [a] -> [[a]]
myGroup = foldr myMatchMaker []
where myMatchMaker x' ((x:xs):xss) = if x' == x then (x':x:xs):xss else [x']:(x:xs):xss
myMatchMaker x' [] = [[x']]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment