diff --git a/users/Profpatsch/my-prelude/src/RevList.hs b/users/Profpatsch/my-prelude/src/RevList.hs index 0f002c07e..a79e1668f 100644 --- a/users/Profpatsch/my-prelude/src/RevList.hs +++ b/users/Profpatsch/my-prelude/src/RevList.hs @@ -11,18 +11,23 @@ newtype RevList a = RevList [a] deriving (Semigroup, Monoid) via (Semigroup.Dual [a]) empty :: RevList a +{-# INLINE empty #-} empty = RevList [] singleton :: a -> RevList a +{-# INLINE singleton #-} singleton a = RevList [a] -- | (@O(n)@) Turn the list into a reversed list (by reversing) revList :: [a] -> RevList a +{-# INLINE revList #-} revList xs = RevList $ reverse xs -- | (@O(n)@) Turn the reversed list into a list (by reversing) revListToList :: RevList a -> [a] +{-# INLINE revListToList #-} revListToList (RevList rev) = reverse rev instance (Show a) => Show (RevList a) where + {-# INLINE show #-} show (RevList rev) = rev & show