[Haskell-cafe] How to implement nested loops with tail recursion?

Claude Heiland-Allen claude at mathr.co.uk
Wed Sep 19 20:13:42 CEST 2012


On 19/09/12 19:00, sdiyazg at sjtu.edu.cn wrote:
> So how do I force IO actions whose results are discarded (including IO ()) to be strict?

() <- foo :: IO () -- should work as it pattern matches, can wrap it in
a prettier combinator
!_ <- foo :: IO a -- could work with -XBangPatterns

I've not tested either (been away from Haskell for a while..), but see also:
(regarding modifyIORef and leaky issues)


More information about the Haskell-Cafe mailing list