Created
September 24, 2014 10:55
-
-
Save mwotton/e1ef2e94cea8a28694c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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