Skip to content

Instantly share code, notes, and snippets.

@mwotton
Created September 24, 2014 10:55
Show Gist options
  • Save mwotton/e1ef2e94cea8a28694c7 to your computer and use it in GitHub Desktop.
Save mwotton/e1ef2e94cea8a28694c7 to your computer and use it in GitHub Desktop.
domChar x = a ! x
where
a :: UArray Char Bool
a = array (minBound, maxBound) $ map (\x -> (x,f x)) [minBound..maxBound]
f = (\x -> isAlphaNum x || x `elem` ".-")
componentChar x = a ! x
where
a :: UArray Char Bool
a = array (minBound, maxBound) $ map (\x -> (x,f x)) [minBound..maxBound]
f = (\x -> isAlphaNum x || x `elem` "-")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment