Fix pattern matching in UE4 A.3
This commit is contained in:
parent
0a6be116ac
commit
d305136638
@ -188,9 +188,6 @@ Helper functions:
|
|||||||
> K_Gutschrift _ _ -> True
|
> K_Gutschrift _ _ -> True
|
||||||
> _ -> False
|
> _ -> False
|
||||||
|
|
||||||
> ppartner_to_partner :: P_Geschaeftspartner -> Geschaeftspartner
|
|
||||||
> ppartner_to_partner p = p
|
|
||||||
|
|
||||||
> kkb_to_tuples :: KonsolidiertesKassabuch -> [(P_Geschaeftspartner, K_Geschaeftsvorfall)]
|
> kkb_to_tuples :: KonsolidiertesKassabuch -> [(P_Geschaeftspartner, K_Geschaeftsvorfall)]
|
||||||
> kkb_to_tuples (KKB x) = x
|
> kkb_to_tuples (KKB x) = x
|
||||||
|
|
||||||
@ -368,6 +365,7 @@ Aufgabe A.3
|
|||||||
> (g, v) = x
|
> (g, v) = x
|
||||||
|
|
||||||
> calculate_partner_payments :: KonsolidiertesKassabuch -> EuroCent -> EuroCent
|
> calculate_partner_payments :: KonsolidiertesKassabuch -> EuroCent -> EuroCent
|
||||||
|
> calculate_partner_payments (KKB []) _ = (EC 0 0)
|
||||||
> calculate_partner_payments (KKB(x:xs)) res
|
> calculate_partner_payments (KKB(x:xs)) res
|
||||||
> | length x /= 0 && null xs =
|
> | length x /= 0 && null xs =
|
||||||
> if is_k_credit v then res
|
> if is_k_credit v then res
|
||||||
@ -378,7 +376,9 @@ Aufgabe A.3
|
|||||||
> (g,v) = x
|
> (g,v) = x
|
||||||
|
|
||||||
> calculate_partner_credit :: KonsolidiertesKassabuch -> EuroCent -> EuroCent
|
> calculate_partner_credit :: KonsolidiertesKassabuch -> EuroCent -> EuroCent
|
||||||
|
> calculate_partner_credit (KKB []) _ = (EC 0 0)
|
||||||
> calculate_partner_credit (KKB(x:xs)) res
|
> calculate_partner_credit (KKB(x:xs)) res
|
||||||
|
> | null (x:xs) = res
|
||||||
> | length x /= 0 && null xs =
|
> | length x /= 0 && null xs =
|
||||||
> if is_k_credit v then res + (ec_gutschrift v)
|
> if is_k_credit v then res + (ec_gutschrift v)
|
||||||
> else res
|
> else res
|
||||||
|
Reference in New Issue
Block a user