instance (Integral n, OffsetCalculator o, HexDirection d) => (IsoEvidence (Axial d n) (Offset d o n)) where
po :: Proxy o
po = Proxy
pd :: Proxy d
pd = Proxy
adj :: Vector2D n -> n
adj p = adjustment po $ p ^. otherAxis pd
convert :: (n -> n -> n) -> Vector2D n -> Vector2D n
convert f p = (offsetAxis pd) %~ (flip f (adj p)) $ p
convertFrom (Offset p) = Axial $ convert (P.-) p
convertTo (Axial p) = Offset $ convert (P.+) p
我将从以前的一些编译代码中转换过来,因此我相对相信这些代码在概念上是好的。我的问题是convertFrom和convertTo是ISOVidence类中唯一公开的方法。因此,其余部分不会编译。