summaryrefslogtreecommitdiff
path: root/Handler/Common.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Handler/Common.hs')
-rw-r--r--Handler/Common.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Handler/Common.hs b/Handler/Common.hs
index f40375a..90e373a 100644
--- a/Handler/Common.hs
+++ b/Handler/Common.hs
@@ -265,10 +265,11 @@ kinds = do
265type Sort a = a -> a 265type Sort a = a -> a
266 266
267stockSort :: Sort [WithType (Entity Item)] 267stockSort :: Sort [WithType (Entity Item)]
268stockSort = concat . map (sortOn $ entityVal . typedVal) . sortGroups . group 268stockSort = concat . map sortInGroup . sortGroups . group
269 where 269 where
270 group = groupBy ((==) `on` valType) . sortOn valType 270 group = groupBy ((==) `on` valType) . sortOn valType
271 sortGroups = sortOn (fmap minimum . fromNullable . map (entityVal . typedVal)) 271 sortGroups = sortOn (fmap minimum . fromNullable . map (entityVal . typedVal))
272 sortInGroup = concat . map (sortOn $ entityVal . typedVal) . sortOn (fmap minimum . fromNullable . map (entityVal . typedVal)) . groupBy ((==) `on` (itemNormKind . entityVal . typedVal)) . sortOn (itemNormKind . entityVal . typedVal)
272 273
273referenceSort :: Sort [WithType (Entity Reference)] 274referenceSort :: Sort [WithType (Entity Reference)]
274referenceSort = sortBy referenceOrdering 275referenceSort = sortBy referenceOrdering