WellPointed for dual to PreArrow class

流过昼夜 提交于 2021-01-28 03:42:20

问题


In Control.Arrow.Constrained there is a class WellPointed:

Unlike with Morphism and PreArrow, a literal dual of WellPointed does not seem useful.

Which is true as the duality for the following methods seems a bit weird:

globalElement :: ObjectPoint a x => x -> a (UnitObject a) x

unit :: CatTagged a (UnitObject a)

const :: (Object a b, ObjectPoint a x) => x -> a b x

But why would not we like (for example) having const for "choice" arrows (like having some constant error information which could be then tagged)? Having unit in this hierarchy does not seem weird too as we have already started speaking of units in CoCartesian when working with 2 sum-types: Bool ≅ unit + unit and Maybe a ≅ unit + a.

So, how do we deal with this? Are we somehow guaranteed to be able to write down all the instances for WellPointed superclasses (and, if it is so, does it have something to do with Arrow being ArrowChoice's superclass)? Also, why do we define those methods in PreArrow's subclass? Why could not have we moved them "down" the hierarchy?


Edit: I found this post by leftaroundabout (who is the author of Control.Arrow.Constrained) where he writes WellPointed down as the direct Category's subclass. Why were things written down another way in Control.Arrow.Constrained?

来源:https://stackoverflow.com/questions/63060108/wellpointed-for-dual-to-prearrow-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!