shithub: MicroHs

Download patch

ref: 6ce8da5b4d9ce80140c512a4eb7a9711b2cb4e7f
parent: 00fc2af73ae6c879aeb839a077ab772ed7e23c30
author: Lennart Augustsson <lennart.augustsson@epicgames.com>
date: Sun Aug 18 15:45:00 EDT 2024

Add missing fromJust

--- a/lib/Data/Maybe.hs
+++ b/lib/Data/Maybe.hs
@@ -4,6 +4,7 @@
 import Prelude()              -- do not import Prelude
 import Primitives
 import Control.Applicative
+import Control.Error
 import Control.Monad
 import Control.Monad.Fail
 import Data.Bool
@@ -76,6 +77,10 @@
 fromMaybe :: forall a . a -> Maybe a -> a
 fromMaybe a Nothing = a
 fromMaybe _ (Just a) = a
+
+fromJust :: forall a . Maybe a -> a
+fromJust Nothing = error "fromJust: Nothing"
+fromJust (Just a) = a
 
 catMaybes :: forall a . [Maybe a] -> [a]
 catMaybes mxs = [ x | Just x <- mxs ]
--