summaryrefslogtreecommitdiff
path: root/src/Obs/Logging.idr
diff options
context:
space:
mode:
authorGreg Brown <greg.brown01@ed.ac.uk>2023-01-03 13:46:38 +0000
committerGreg Brown <greg.brown01@ed.ac.uk>2023-01-03 13:46:38 +0000
commit3950a84c00f54ab39f2a209c368cc02460eeebd7 (patch)
treed44712a47db174b42ff545fec1b8c24530f76ce0 /src/Obs/Logging.idr
parentc4bbe4ab5fa5953d468ac1509b37e03aace3085e (diff)
Add more program structure to abstract terms.
Add more program structure to type inference and checking.
Diffstat (limited to 'src/Obs/Logging.idr')
-rw-r--r--src/Obs/Logging.idr7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Obs/Logging.idr b/src/Obs/Logging.idr
index ef0bae6..5666001 100644
--- a/src/Obs/Logging.idr
+++ b/src/Obs/Logging.idr
@@ -126,8 +126,11 @@ inScope : (tag : String) -> Logging ann a -> Logging ann a
inScope tag = mapMsg {tags $= (tag ::)}
export
-inBounds : Bounds -> Logging ann a -> Logging ann a
-inBounds bounds = mapMsg {bounds $= maybe (Just bounds) Just}
+inBounds : WithBounds (Logging ann a) -> Logging ann a
+inBounds msg =
+ let map : Logging ann a -> Logging ann a
+ map = if msg.isIrrelevant then id else mapMsg {bounds $= maybe (Just msg.bounds) Just}
+ in map msg.val
public export
interface Loggable (0 ann, ty : Type) where