Closed robrix closed 6 years ago
I think we should explore extracting Data.Union
as it exists herein for use in à la carte ASTs, and restoring recursively-defined membership constraints that should (hopefully) make it possible for ghc
to deduce the relationships between the indices of T
in ts
and U ': ts
.
Fixed by #39.
Because our redesign of
Member
to support fast(ish) compiled withUnion
s of hundreds of elements involved defining it using anElemIndex
type family where each branch is effectively a complete unrolling, there’s no relationship between different branches: you can’t inferMember t (U ': ts)
fromMember T ts
, or vice versa.While this is acceptable in cases where we aren’t dynamically extending the members (e.g. when used for à la carte ASTs), it’s counterproductive in its original use in
Eff
: you often end up having to carry around both theMember T ts
andMember T (U ': ts)
constraints, and this gets compounded every time you want to useT
at a different level of embedding.