Skip to content

if type checking gets too slow, try out moving away from fundeps #11

@cartazio

Description

@cartazio

currently, i do stuff like

class Array marr rank el | marr -> rank where 
   read :: Shape rank Int -> marr (PrimState m) el -> m el 
...

to pun naming, but fundeps have a less systematic theory/support in core ghc, and I'm told that compile (well type checking particularly) times can be dramatically improved by a moving to type families.

Should consider migrating to

class Array  marr el where
   type Ix marr :: Nat 
 -- might define Ix type family  out of band of the class 
-- so i can pun it between arrays and formats
   read :: (rnk ~ Ix marr) => Shape rank Int -> marr (PrimState m) el -> m el 

need to see how more complex algorithms wind up looking wrt types, and balancing usability/complexity

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions