From d920dd95be096dcaa2fa2314d729fdff52631fd6 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 4 Oct 2015 21:06:23 +0200 Subject: Factor incomeDefinedForAll utilization --- src/client/Model/Income.elm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/client/Model/Income.elm') diff --git a/src/client/Model/Income.elm b/src/client/Model/Income.elm index ce30772..97a5652 100644 --- a/src/client/Model/Income.elm +++ b/src/client/Model/Income.elm @@ -25,9 +25,9 @@ incomeDecoder = ("creation" := timeDecoder) ("amount" := Json.int) -incomeDefinedForAll : List (UserId, List Income) -> Maybe Time +incomeDefinedForAll : List (List Income) -> Maybe Time incomeDefinedForAll usersIncomes = - let firstIncomes = map (head << sortBy .creation << snd) usersIncomes + let firstIncomes = map (head << sortBy .creation) usersIncomes in if all isJust firstIncomes then head << reverse << List.sort << map .creation << catMaybes <| firstIncomes else Nothing -- cgit v1.2.3