summaryrefslogtreecommitdiff
path: root/src/Data/Maybe
diff options
context:
space:
mode:
Diffstat (limited to 'src/Data/Maybe')
-rw-r--r--src/Data/Maybe/Decidable.idr6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Data/Maybe/Decidable.idr b/src/Data/Maybe/Decidable.idr
new file mode 100644
index 0000000..e301ab1
--- /dev/null
+++ b/src/Data/Maybe/Decidable.idr
@@ -0,0 +1,6 @@
+module Data.Maybe.Decidable
+
+public export
+data OnlyWhen : (p : a -> Type) -> Maybe a -> Type where
+ RJust : forall x. (px : p x) -> p `OnlyWhen` Just x
+ RNothing : (false : (x : a) -> Not (p x)) -> p `OnlyWhen` Nothing