[Haskell-cafe] Announcing containers 0.5.8.1

David Feuer david.feuer at gmail.com
Wed Aug 31 13:04:10 UTC 2016


Wren and I made the decision to use bang patterns to make it easier for us
to read and write the code. We hope that rather modest extension will be in
the next Haskell Report. From my perspective, this decision is
non-negotiable. It's just too hard for my poor brain to work with all the
possible strictification functions we'd need for various numbers of
arguments and the awkwardness required to use them. This was previously
done with a combination of manual seq and CPP, and I found it nasty.

On Aug 31, 2016 5:10 AM, "Henning Thielemann" <lemming at henning-thielemann.de>
wrote:

>
> On Wed, 31 Aug 2016, David Feuer wrote:
>
> Use BangPatterns throughout to reduce noise. This extension is now
>> required to compile containers.
>>
>
> Btw. there is no strong need for BangPatterns. Instead of
>
> f !x !y = ...
>
> you can write
>
> f = strict2 $ \x y -> ...
>
> {-# INLINE strict2 #-}
> strict2 :: (a -> b -> x) -> a -> b -> x
> strict2 f a b = (f $! a) $! b
>
>
> Sometimes I hope that availability of portable libraries would help
> non-mainstream compilers to gain ground.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160831/0c791455/attachment.html>


More information about the Haskell-Cafe mailing list