0 | module Libraries.Data.IMaybe
5 | data IMaybe : Bool -> Type -> Type where
6 | Nothing : IMaybe False a
7 | Just : a -> IMaybe True a
10 | Functor (IMaybe b) where
11 | map f Nothing = Nothing
12 | map f (Just x) = Just (f x)
15 | fromJust : IMaybe True a -> a
16 | fromJust (Just x) = x
19 | toList : IMaybe b a -> List a
21 | toList (Just x) = [x]