Hi all,<div><br></div><div>I would like to experiment with writing some modules (e.g. low-level modules that do a lot of bit twiddling) in a strict subset of Haskell. The idea is to remove boilerplate bangs (!) and instead declare the whole module strict. I believe this would both make code that needs to be strict more declarative (you say what you want once, instead of putting bangs everywhere), less noisy, and more predictable (no need to reason about laziness in places where you know you don&#39;t want it). The idea is to introduce a new language pragma</div>

<div><br></div><div>{-# LANGUAGE Strict #-}</div><div><br></div><div>that has the above described effect.</div><div><br></div><div>The tricky part is to define the semantics of this pragma in terms of Haskell, instead of in terms of Core. While we also need the latter, we cannot describe the feature to users in terms of Core. The hard part is to precisely define the semantics, especially in the presence of separate compilation (i.e. we might import lazy functions).</div>

<div><br></div><div>I&#39;d like to get the Haskell communities input on this. Here&#39;s a strawman:</div><div><br></div><div> * Every function application f _|_ = _|_, if f is defined in this module [1]. This also applies to data type constructors (i.e. the code acts if all fields are preceded by a bang).</div>

<div><br></div><div> * lets and where clauses act like (strict) case statements.</div><div><br></div><div> * It&#39;s still possible to define strict arguments, using &quot;~&quot;. In essence the Haskell lazy-by-default with opt-out via &quot;!&quot; is replaced with strict-by-default with opt-out via &quot;~&quot;.</div>

<div><br></div><div>Thoughts?</div><div><br></div><div>Cheers,</div><div>  Johan</div><div><br></div><div>1. I could see the very opposite choice be made: function applications to functions defined in other modules are also strict. We should try to think about the implications of either policy.</div>

<div><br></div>