module Update.Payment ( PaymentAction(..) , updatePayment ) where import Model.View.PaymentView exposing (..) import Model.Payment exposing (..) type PaymentAction = UpdateName String | UpdateCost String | UpdatePayments Payments updatePayment : PaymentAction -> PaymentView -> PaymentView updatePayment action paymentView = case action of UpdateName name -> { paymentView | name <- name } UpdateCost cost -> { paymentView | cost <- cost } UpdatePayments payments -> { paymentView | payments <- payments }