Created
June 27, 2010 19:37
-
-
Save billdozr/455122 to your computer and use it in GitHub Desktop.
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
data TodoEntry = TodoEntry { milestone :: (Maybe String) | |
, action :: String | |
, users :: (Maybe [String]) | |
, priority :: (Maybe Char) | |
, timeSpent :: (Maybe Double) | |
} deriving (Eq, Ord) | |
instance Show TodoEntry where | |
show entry = todoTagStr ++ (uStr $ users entry) ++ ": " | |
++ (mStr $ milestone entry) | |
++ (action entry) | |
++ (attStr (priority entry, timeSpent entry)) | |
where mStr Nothing = "" | |
mStr (Just s) = s ++ " :: " | |
uStr Nothing = "" | |
uStr (Just ul) = "(" ++ (intercalate ", " ul) ++ ")" | |
attStr (Nothing, Nothing) = "" | |
attStr (Just p, Just t) = " :: " ++ [p] ++ ", " ++ (show t) | |
attStr (Just p, Nothing) = " :: " ++ [p] | |
attStr (Nothing, Just t) = " :: " ++ (show t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment