@@ -16,13 +16,19 @@ import Agda.Syntax.Common
1616 Cohesion (.. ),
1717 QωOrigin (.. ),
1818 LensCohesion (getCohesion ),
19- NameId (.. ) )
19+ NameId (.. ),
20+ Erased (.. ), asQuantity , Lock (.. ), LockOrigin (.. ),
21+ #if MIN_VERSION_Agda(2,7,0)
22+ OverlapMode (.. ),
23+ #endif
24+ )
2025import qualified Agda.Utils.Null as Agda
2126import Agda.Utils.List1 (toList )
2227import Agda.Utils.Functor ((<&>) )
2328
2429import Render.Class
2530import Render.RichText
31+ import qualified Agda.Utils.List1 as List1
2632
2733--------------------------------------------------------------------------------
2834
@@ -72,6 +78,19 @@ instance Render Cohesion where
7278
7379--------------------------------------------------------------------------------
7480
81+ #if MIN_VERSION_Agda(2,7,0)
82+ instance Render OverlapMode where
83+ render = \ case
84+ Overlappable -> " OVERLAPPABLE"
85+ Overlapping -> " OVERLAPPING"
86+ Incoherent -> " INCOHERENT"
87+ Overlaps -> " OVERLAPS"
88+ FieldOverlap -> " overlap"
89+ DefaultOverlap -> mempty
90+ #endif
91+
92+ --------------------------------------------------------------------------------
93+
7594-- | From 'prettyHiding'
7695-- @renderHiding info visible text@ puts the correct braces
7796-- around @text@ according to info @info@ and returns
@@ -91,6 +110,17 @@ renderQuantity :: LensQuantity a => a -> Inlines -> Inlines
91110renderQuantity a d =
92111 if show d == " _" then d else render (getQuantity a) <+> d
93112
113+ instance Render Lock where
114+ render = \ case
115+ IsLock LockOLock -> " @lock"
116+ IsLock LockOTick -> " @tick"
117+ IsNotLock -> mempty
118+
119+ #if MIN_VERSION_Agda(2,7,0)
120+ renderErased :: Erased -> Inlines -> Inlines
121+ renderErased = renderQuantity . asQuantity
122+ #endif
123+
94124renderCohesion :: LensCohesion a => a -> Inlines -> Inlines
95125renderCohesion a d =
96126 if show d == " _" then d else render (getCohesion a) <+> d
@@ -102,6 +132,9 @@ instance (Render p, Render e) => Render (RewriteEqn' qn nm p e) where
102132 render = \ case
103133 Rewrite es -> prefixedThings (text " rewrite" ) (render . snd <$> toList es)
104134 Invert _ pes -> prefixedThings (text " invert" ) (toList pes <&> (\ (p, e) -> render p <+> " <-" <+> render e) . namedThing)
135+ #if MIN_VERSION_Agda(2,7,0)
136+ LeftLet pes -> prefixedThings (text " using" ) [render p <+> " <-" <+> render e | (p, e) <- List1. toList pes]
137+ #endif
105138
106139prefixedThings :: Inlines -> [Inlines ] -> Inlines
107140prefixedThings kw = \ case
0 commit comments