Move towards displaying tree links in inventory

This commit is contained in:
2024-09-13 12:02:28 +01:00
parent c81fd5490d
commit bd681a577c
8 changed files with 85 additions and 45 deletions
+3
View File
@@ -10,6 +10,7 @@ module FoldableHelp
, ssfold
, minOn
, module Data.Foldable
, minAndMax
)
where
import Data.Foldable
@@ -105,3 +106,5 @@ ssfold :: Foldable t => (a -> Bool) -> (a -> b -> a) -> a -> t b -> a
{-# INLINABLE ssfold #-}
ssfold p f a0 xs = foldr (\x g a -> if p a then a else g (f a x)) id xs a0
minAndMax :: (Foldable t,Ord a) => t a -> (Maybe a,Maybe a)
minAndMax = L.fold ((,) <$> L.minimum <*> L.maximum)