diff options
Diffstat (limited to 'src/Data/Maybe/Decidable.idr')
-rw-r--r-- | src/Data/Maybe/Decidable.idr | 6 |
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 |