mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-25 10:48:54 -06:00
Maybe.gf: add isJust function (synonym for exists)
This commit is contained in:
@@ -26,6 +26,7 @@ resource Maybe = open Prelude, Predef in {
|
|||||||
|
|
||||||
-- Functions
|
-- Functions
|
||||||
exists : (T : Type) -> Maybe T -> Bool = \_,m -> m.exists ;
|
exists : (T : Type) -> Maybe T -> Bool = \_,m -> m.exists ;
|
||||||
|
isJust : (T : Type) -> Maybe T -> Bool = \_,m -> m.exists ;
|
||||||
fromJust : (T : Type) -> Maybe T -> T = \_,m -> case m.exists of {
|
fromJust : (T : Type) -> Maybe T -> T = \_,m -> case m.exists of {
|
||||||
True => m.inner ;
|
True => m.inner ;
|
||||||
False => Predef.error "Called fromJust with Nothing"
|
False => Predef.error "Called fromJust with Nothing"
|
||||||
|
|||||||
Reference in New Issue
Block a user