Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cartazio opened this issue Sep 6, 2014 · 0 comments
Open

Comments

@cartazio
Copy link
Member

cartazio commented Sep 6, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant