Skip to content

Optimization to better support IORef (Maybe a) #25

@MathiasBartl

Description

@MathiasBartl

Hi, I do think that having an IORef (Maybe a) is a pattern that one could make a little module of.
Data.Maybe.IORef
More generaly you have a Type with some unparmeterised constructors, and one constructor with one parameter. (At the moment I don't want to generalise it any further.)
I think Greg posted an link to an concurrent datastructure that removes the indirection and replaces
IORef (a b) with a simple IORef, and represents any parameterless constructor with an constant IORef value. Witch only requires some unsafe coercion.
Now I'd really like to do this, at MULTIPLE points in my Hashtable, and I want to seperate this very technical code for optimisation, from the other technical code for functionality. I also think it would be nice to have it reusable, if there is not already a similar module out there, or GHC does or could do a equivalent optimisation, witch I think is absolutly somethin a compiler could do in principal.
.. to be continued

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions