I need to obtain the type inferred for a field, can anyone suggest a way to do this? I'm using them to construct types related to the optics returned by field, position, etc. At the moment I'm just constructing a FIeldType type family manually:
data FieldHop = Newtype | FieldPos Nat | FieldName Symbol | ConstrName Symbol
type instance Codomain ('FieldPos 1) Loc = String
type instance Codomain ('FieldPos 2) Loc = String
type instance Codomain ('FieldPos 3) Loc = String
type instance Codomain ('FieldPos 4) Loc = CharPos
type instance Codomain ('FieldPos 5) Loc = CharPos
I envision associated types in the HasFIeld, HasPosition, AsConstructor classes, but I don't see how to implement them.
I need to obtain the type inferred for a field, can anyone suggest a way to do this? I'm using them to construct types related to the optics returned by field, position, etc. At the moment I'm just constructing a FIeldType type family manually:
I envision associated types in the HasFIeld, HasPosition, AsConstructor classes, but I don't see how to implement them.