Move towards displaying tree links in inventory
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user