Files
loop/src/StrictHelp.hs
T
2021-07-30 11:53:51 +02:00

13 lines
303 B
Haskell

module StrictHelp
where
{- | In order to force a list, apply with seq. -}
forceSpine :: Foldable t => t a -> ()
forceSpine = foldr (const id) ()
forceFoldable :: Foldable t => t a -> t a
forceFoldable f = forceSpine f `seq` f
forceElements :: Foldable t => t a -> ()
forceElements = foldr seq ()