Created
January 1, 2013 01:17
-
-
Save mxswd/4424505 to your computer and use it in GitHub Desktop.
Domain management at its simplest.
This file contains hidden or 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
| import Data.List | |
| data Domain = Domain { domain :: String, dns :: DNS } deriving (Show) | |
| data Service = Service { name :: String, servtype :: ServType, description :: String } deriving (Show) | |
| data ServType = Heroku | GitHubPages | Redirect deriving (Show, Eq) | |
| data DNS = DNS { dprovider :: String, dname :: String, services :: [Service] } deriving (Show) | |
| -- presentation | |
| listZoneOf q = nub $ map (dname . dns) $ filter (\x -> dprovider (dns x) == q) domains | |
| listType t = map description $ filter (\x -> servtype x == t) $ foldl (\x y -> x ++ (services . dns) y) [] domains | |
| domains = [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment