[Haskell-cafe] extending bang proposal Re: strict Haskell dialect

Robert Dockins robdockins at fastmail.fm
Mon Feb 6 12:40:11 EST 2006


On Feb 6, 2006, at 9:19 AM, Bulat Ziganshin wrote:

> Hello Ketil,
>
> Monday, February 06, 2006, 4:06:35 PM, you wrote:
>
>>> foo :: !Int -> !Int
>
> KM> (Is the second ! actually meaningful?)
>
> yes! it means that the function is strict in its result - i.e.  
> can't return
> undefined value when strict arguments are given. this sort of  
> knowledge
> should help a compiler to "propagate" strictness and figure out the
> parts of program that can be compiled as strict code. really, i think
> ghc is able to figure functions with strict result just like it is  
> able to
> figure strict function arguments
>
> KM> Personally, I think is much nicer than sprinkling seq's around,  
> and
> KM> generally sufficient.  However, there could perhaps be  
> disambiguities?
>
> btw, it's just implemented in the GHC HEAD
>

Actually, I think strict _patterns_ are implemented.  You are talking  
about strict _type annotations_, which is rather different.

As I understand it, strict patterns are just sugar for putting 'seq'  
in the right places.

There has been some work dealing with folding strictness and totality  
information into types systems; I find the resulting type systems  
pretty ugly, and I think they'd be pretty hard to bolt onto an HM base.


Robert Dockins

Speak softly and drive a Sherman tank.
Laugh hard; it's a long way to the bank.
           -- TMBG





More information about the Haskell-prime mailing list