Conversation

Anyone know of literature on preserving parametricity but also allowing static introspection like D? They seem in conflict.
2
2
You can have your cake and eat it if you have two different quantifiers. One that admits introspection, and one that doesn’t. Definitely interested in this for Pikelet, because static type dispatch is super important for systems programming.
1
Also, thinking about it now, you might want to ensure that introspected types are still thrown away at compile time, so maybe it’s still useful to maintain the distinction 🤔
1
Nice! I was thinking along the lines of a linear variable that get consumed when a type is introspected, so eg. id :: a -> a is still has only one possible implementation if a's associated linear variable (not pictured here) is intact.
1
1
Yeah, I was thinking you could have (using Idris' multiplicity notation): id : {0 a : Type} -> a -> a Which would mean that you could never introspect the `a`. I think Dependent Haskell uses the `forall` and `pi` types to distinguish between these.
2
This Tweet is from a suspended account. Learn more
This Tweet is from a suspended account. Learn more
Right, that seems to be the source of my misunderstanding. The fact the they result in the same outcome (erasure/static use), but they are arrived at from orthogonal means.
2
Show replies