summaryrefslogtreecommitdiff
path: root/tests/lean/External/FunsExternal.lean
blob: b6efc65f8c60aad2ca508c2c9eb519fbfd78c16d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- [external]: templates for the external functions.
import Base
import External.Types
open Primitives
open external

-- TODO: fill those bodies

/- [core::mem::swap] -/
def core.mem.swap
  (T : Type) : T  T  State  Result (State × (T × T)) :=
  fun x y s => .ok (s, (y, x))

/- [core::num::nonzero::NonZeroU32::{14}::new] -/
def core.num.nonzero.NonZeroU32.new :
  U32  State  Result (State × (Option core_num_nonzero_non_zero_u32_t)) :=
  fun _ _ => .fail .panic

/- [core::option::Option::{0}::unwrap] -/
def core.option.Option.unwrap
  (T : Type) : Option T  State  Result (State × T) :=
  fun _ _ => .fail .panic