diff --git a/code/Angabe2.hs b/code/Angabe2.hs index f06edfa..ee9a357 100644 --- a/code/Angabe2.hs +++ b/code/Angabe2.hs @@ -115,8 +115,18 @@ anzahl :: DreiG_Status -> Anzahl anzahl (Geimpft (_, a)) = a -- Dumb conversion functions +vorname_to_str :: Vorname -> String +vorname_to_str (Vorname v) = v + +nachname_to_str :: Nachname -> String +nachname_to_str (Nachname v) = v + person_to_string :: Person -> VorUndNachname -person_to_string p = (show (vorname p)) ++ " " ++ (show (nachname p)) +person_to_string p = + v ++ " " ++ n + where + v = vorname_to_str (vorname p) + n = nachname_to_str (nachname p) timeFormat = "%Y-%m-%d %0I:%0M:%S %p" @@ -317,6 +327,7 @@ einzulassende p r k = allowed_people p r k [] allowed_people :: Einlassbegehrende -> Regel -> Kontrollzeitpunkt -> [VorUndNachname] -> Einzulassende allowed_people (p:ps) r k res + | ps == [] = res | (einzulassen (p, r, k)) == Einlassen = allowed_people ps r k (res ++ [person_to_string p]) | otherwise = allowed_people ps r k res