
24 May
2023
24 May
'23
11:32 a.m.
It seems to me that when you have an isomorphism between two types, a natural transformation from one to the other would usually be included in whichever of the two types are the newer (or maybe both). For example, Vector_2 would have e.g. fromTuple :: (a, b) -> Vector_2 a b fromTuple (a, b) = C a b toTuple :: Vactor_2 a b -> (a, b) toTuple (C a b) = (a, b) then in the interim, one could use these to interface between them. When types and natural transformation functions like these exist in scope, text editor plugins should be able to take advantage of these using parsers such as happy/alex/ghc's/hlint. I've used specifically hlint rules to rewrite, maybe that will help for now? Cheers