Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Helper Function isHex
  2. isHex :: Char -> Bool
  3. isHex x | ((y >= '0') && (y <= '9')) || ((y >= 'a') && (y <= 'f')) = True
  4.         | otherwise = False
  5.             where y = toLower x
  6.  
  7. g :: String -> Int
  8. g xs    | length [ f x | x <- xs, isHex x ] > 0 = maximum [ f x | x <- xs, isHex x ]
  9.         | otherwise = -1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement