We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 00ce4ef commit 588e6ccCopy full SHA for 588e6cc
src/Constrained/TheKnot.hs
@@ -198,7 +198,16 @@ deriving instance Eq (ProdW as b)
198
199
deriving instance Show (ProdW as b)
200
201
-instance Syntax ProdW
+instance Syntax ProdW where
202
+ prettySymbol ProdW _ _ = Nothing
203
+ prettySymbol ProdFstW (t :> Nil) p = parensIf (p > 10) <$> prettySelect 0 t
204
+ prettySymbol ProdSndW (t :> Nil) p = parensIf (p > 10) <$> prettySelect 1 t
205
+
206
+prettySelect :: Int -> TermD deps t -> Maybe (Doc ann)
207
+prettySelect i (App f (t :> Nil))
208
+ | Just ProdSndW <- getWitness f = prettySelect (i + 1) t
209
+ | Just ToGenericW <- getWitness f = Just $ "sel @" <> pretty i <+> pretty t
210
+prettySelect _ _ = Nothing
211
212
instance Semantics ProdW where
213
semantics ProdW = Prod
0 commit comments