Dicebot on leaving D: It is anarchy driven development in all its glory.

Nick Sabalausky (Abscissa) SeeWebsiteToContactMe at semitwist.com
Thu Aug 30 18:52:42 UTC 2018


On 08/29/2018 04:01 PM, Walter Bright wrote:
> On 8/29/2018 10:50 AM, Timon Gehr wrote:
>> D const/immutable is stronger than immutability in Haskell (which is 
>> usually _lazy_).
> 
> I know Haskell is lazy, but don't see the connection with a weaker 
> immutability guarantee. In any case, isn't immutability a precept of FP?

I think the point is that it disallows less, and permits more, all 
without breaking immutability.

Ie, lazy immutable *can* be changed, albiet once and only once in a very 
specific circumstance: When transitioning from uninitialized to 
initialized. AIUI, D only has this "the immutable is in-scope, but can 
still be initialized" state within constructors, whereas (it sounds 
like) Haskell allows it anywhere.

It's like strong-pure vs weak-pure: Both enforce the same purity 
guarantees, but weak-pure is less restrictive and more expressive.


More information about the Digitalmars-d mailing list