Skip to content

Instantly share code, notes, and snippets.

@AngusP
Created November 6, 2013 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AngusP/7339268 to your computer and use it in GitHub Desktop.
Save AngusP/7339268 to your computer and use it in GitHub Desktop.
Answer to q1 tut6
longestProductLen :: [(Barcode, Item)] -> Int
longestProductLen xs = hold xs 0
where
hold [] l = l
hold ((b,(name,i)):xs) longest
| length name > longest = hold xs (length name)
| otherwise = hold xs longest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment