commit 702418b9e19326d0d24ba8794f262305aa674860
parent 23c93a4dc3e321d47f1f16be8f252d9acbe9cb49
Author: Robert Russell <robert@rr3.xyz>
Date: Fri, 9 Oct 2026 12:06:21 -0700
Maybe: reexport some stuff and add default operator
Diffstat:
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/Lude/Maybe.hs b/src/Lude/Maybe.hs
@@ -1,9 +1,12 @@
module Lude.Maybe (
Maybe (..),
+ isJust,
+ isNothing,
unsafe_fromJust,
+ (??),
) where
-import Data.Maybe (Maybe (..))
+import Data.Maybe (Maybe (..), isJust, isNothing)
import Data.Maybe qualified as Base
import Lude.Haskell
@@ -16,3 +19,8 @@ import Lude.Haskell
unsafe_fromJust :: forall (a :: Type). Maybe a -> a
unsafe_fromJust = Base.fromJust
+
+(??) :: forall (a :: Type). Maybe a -> a -> a
+Just x ?? _ = x
+Nothing ?? x = x
+infix 1 ??