@@ -352,33 +352,36 @@ deriving instance NFData Static
352352!-}
353353
354354-- Mark bindings with their explicitness, and laziness
355−data Plicity = Imp { plazy :: Bool,
355+data Plicity = Imp { pargopts :: [ArgOpt],
356356 pstatic :: Static,
357357 pdocstr :: String,
358358 pparam :: Bool }
359− | Exp { plazy :: Bool,
359+ | Exp { pargopts :: [ArgOpt],
360360 pstatic :: Static,
361361 pdocstr :: String,
362362 pparam :: Bool }
363− | Constraint { plazy :: Bool,
363+ | Constraint { pargopts :: [ArgOpt],
364364 pstatic :: Static,
365365 pdocstr :: String }
366− | TacImp { plazy :: Bool,
366+ | TacImp { pargopts :: [ArgOpt],
367367 pstatic :: Static,
368368 pscript :: PTerm,
369369 pdocstr :: String }
370370 deriving (Show, Eq)
371371
372+plazy :: Plicity -> Bool
373+plazy tm = Lazy `elem` pargopts tm
374+
372375{-!
373376deriving instance Binary Plicity
374377deriving instance NFData Plicity
375378!-}
376379
377−impl = Imp False Dynamic "" False
378−expl = Exp False Dynamic "" False
379−expl_param = Exp False Dynamic "" True
380−constraint = Constraint False Dynamic ""
381−tacimpl t = TacImp False Dynamic t ""
380+impl = Imp [Lazy] Dynamic "" False
381+expl = Exp [] Dynamic "" False
382+expl_param = Exp [] Dynamic "" True
383+constraint = Constraint [] Dynamic ""
384+tacimpl t = TacImp [] Dynamic t ""
382385
383386data FnOpt = Inlinable -- always evaluate when simplifying
384387 | TotalFn | PartialFn
@@ -724,21 +727,31 @@ type PDo = PDo' PTerm
724727
725728data PArg' t = PImp { priority :: Int,
726729 machine_inf :: Bool, -- true if the machine inferred it
727− lazyarg :: Bool, pname :: Name, getTm :: t,
730+ argopts :: [ArgOpt],
731+ pname :: Name, getTm :: t,
728732 pargdoc :: String }
729733 | PExp { priority :: Int,
730− lazyarg :: Bool, getTm :: t,
734+ argopts :: [ArgOpt],
735+ getTm :: t,
731736 pargdoc :: String }
732737 | PConstraint { priority :: Int,
733− lazyarg :: Bool, getTm :: t,
738+ argopts :: [ArgOpt],
739+ getTm :: t,
734740 pargdoc :: String }
735741 | PTacImplicit { priority :: Int,
736− lazyarg :: Bool, pname :: Name,
742+ argopts :: [ArgOpt],
743+ pname :: Name,
737744 getScript :: t,
738745 getTm :: t,
739746 pargdoc :: String }
740747 deriving (Show, Eq, Functor)
741748
749+data ArgOpt = Lazy | HideDisplay
750+ deriving (Show, Eq)
751+
752+lazyarg :: PArg' t -> Bool
753+lazyarg tm = Lazy `elem` argopts tm
754+
742755instance Sized a => Sized (PArg' a) where
743756 size (PImp p _ l nm trm _) = 1 + size nm + size trm
744757 size (PExp p l trm _) = 1 + size trm
@@ -750,10 +763,10 @@ deriving instance Binary PArg'
750763deriving instance NFData PArg'
751764!-}
752765
753−pimp n t mach = PImp 1 mach True n t ""
754−pexp t = PExp 1 False t ""
755−pconst t = PConstraint 1 False t ""
756−ptacimp n s t = PTacImplicit 2 True n s t ""
766+pimp n t mach = PImp 1 mach [Lazy] n t ""
767+pexp t = PExp 1 [] t ""
768+pconst t = PConstraint 1 [] t ""
769+ptacimp n s t = PTacImplicit 2 [Lazy] n s t ""
757770
758771type PArg = PArg' PTerm
759772
@@ -1003,7 +1016,7 @@ prettyImp impl = prettySe 10
10031016 prettySe 10 sc
10041017 prettySe p (PPi (Exp l s _ _) n ty sc)
10051018 | n `elem` allNamesIn sc || impl =
1006− let open = if l then text "|" <> lparen else lparen in
1019+ let open = if Lazy `elem` l then text "|" <> lparen else lparen in
10071020 bracket p 2 $
10081021 if size sc > breakingSize then
10091022 open <> pretty n <+> colon <+> prettySe 10 ty <> rparen <+>
@@ -1024,7 +1037,7 @@ prettyImp impl = prettySe 10
10241037 _ -> empty
10251038 prettySe p (PPi (Imp l s _ _) n ty sc)
10261039 | impl =
1027− let open = if l then text "|" <> lbrace else lbrace in
1040+ let open = if Lazy `elem` l then text "|" <> lbrace else lbrace in
10281041 bracket p 2 $
10291042 if size sc > breakingSize then
10301043 open <> pretty n <+> colon <+> prettySe 10 ty <> rbrace <+>
@@ -1217,7 +1230,7 @@ showImp ist impl colour tm = se 10 [] tm where
12171230 se p bnd (PPi (Exp l s _ param) n ty sc)
12181231 | n `elem` allNamesIn sc || impl
12191232 = bracket p 2 $
1220− (if l then "|(" else "(") ++
1233+ (if Lazy `elem` l then "|(" else "(") ++
12211234 perhapsColourise colouriseBound (show n) ++ " : " ++ se 10 bnd ty ++
12221235 ") " ++
12231236 (if (impl && param) then "P" else "") ++
@@ -1228,7 +1241,7 @@ showImp ist impl colour tm = se 10 [] tm where
12281241 Static -> "[static] "
12291242 _ -> ""
12301243 se p bnd (PPi (Imp l s _ _) n ty sc)
1231− | impl = bracket p 2 $ (if l then "|{" else "{") ++
1244+ | impl = bracket p 2 $ (if Lazy `elem` l then "|{" else "{") ++
12321245 perhapsColourise colouriseBound (show n) ++ " : " ++ se 10 bnd ty ++
12331246 "} " ++ st ++ "-> " ++ se 10 ((n, True):bnd) sc
12341247 | otherwise = se 10 ((n, True):bnd) sc