diff options
Diffstat (limited to 'Handler/Common.hs')
-rw-r--r-- | Handler/Common.hs | 3 |
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 | |||
265 | type Sort a = a -> a | 265 | type Sort a = a -> a |
266 | 266 | ||
267 | stockSort :: Sort [WithType (Entity Item)] | 267 | stockSort :: Sort [WithType (Entity Item)] |
268 | stockSort = concat . map (sortOn $ entityVal . typedVal) . sortGroups . group | 268 | stockSort = 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 | ||
273 | referenceSort :: Sort [WithType (Entity Reference)] | 274 | referenceSort :: Sort [WithType (Entity Reference)] |
274 | referenceSort = sortBy referenceOrdering | 275 | referenceSort = sortBy referenceOrdering |