diff options
author | Xander <xander@biltopia.org> | 2023-08-19 19:47:17 +0200 |
---|---|---|
committer | Xander <xander@biltopia.org> | 2023-08-19 19:47:17 +0200 |
commit | a76c89dc3932f0b5e60ff871b08f4bc745727ae4 (patch) | |
tree | 9b374611b349b922f2cc9f6194cb9d426f6aa7c2 /lib/DATS/valid.dats | |
parent | fcf755d4f03f6fba974d11307659e2e96f9696e7 (diff) | |
download | ats-os-a76c89dc3932f0b5e60ff871b08f4bc745727ae4.tar.xz ats-os-a76c89dc3932f0b5e60ff871b08f4bc745727ae4.zip |
made valid type a viewtype
Diffstat (limited to 'lib/DATS/valid.dats')
-rw-r--r-- | lib/DATS/valid.dats | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/DATS/valid.dats b/lib/DATS/valid.dats index f4ea0aa..c13386e 100644 --- a/lib/DATS/valid.dats +++ b/lib/DATS/valid.dats @@ -1,9 +1,9 @@ #define ATS_DYNLOADFLAG 0 staload "lib/SATS/valid.sats" -assume valid(a:t@ype,b:bool) = (a,bool b) +assume valid(a:viewt@ype,b:bool) = (a,bool b) -implement{a} create_valid(value : a) = (value,true) +implement{a} create_valid(value) = (value,true) // Create unvalid value by casting null pointer to type. implement{a} create_unvalid() = let @@ -13,3 +13,5 @@ in end implement{a} unwrap_valid(v) = v.0 + +implement{a} is_valid(v) = v.1 |