Add Washington DC Location

main
Hammy 4 years ago
parent e677c12cdd
commit be4bafd1d3

@ -5,22 +5,25 @@ sfOffice name = if surname < "L"
where surname = snd name where surname = snd name
nameText = fst name ++ " " ++ surname nameText = fst name ++ " " ++ surname
nyOffice :: ([Char], [Char]) -> [Char] nyOffice :: ([Char], [Char]) -> [Char]
nyOffice name = nameText ++ ": PO Box 789 - New York, NY, 10013" nyOffice name = nameText ++ ": PO Box 789 - New York, NY, 10013"
where nameText = fst name ++ " " ++ snd name where nameText = fst name ++ " " ++ snd name
renoOffice :: (a, [Char]) -> [Char] renoOffice :: (a, [Char]) -> [Char]
renoOffice name = nameText ++ " - PO Box 456 - Reno, NV 89523" renoOffice name = nameText ++ " - PO Box 456 - Reno, NV 89523"
where nameText = snd name where nameText = snd name
wdcOFfice :: ([Char], [Char]) -> [Char]
wdcOFfice name = nameText ++ " - PO BOX 831 - Washington, DC, 12130"
where nameText = fst name ++ " " ++ snd name ++ ", Esq."
getLocation :: [Char] -> ([Char], [Char]) -> [Char] getLocation :: [Char] -> ([Char], [Char]) -> [Char]
getLocation location = case location of getLocation location = case location of
"ny" -> nyOffice "ny" -> nyOffice
"sf" -> sfOffice "sf" -> sfOffice
"reno" -> renoOffice "reno" -> renoOffice
"wdc" -> wdcOFfice
_ -> (\name -> fst name ++ " " ++ snd name) _ -> (\name -> fst name ++ " " ++ snd name)

Loading…
Cancel
Save