blob: a29875ff6ae329c9d10690c0e17f21283a3e5954 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
//// A module containing some unusual functions and types.
/// A type where the value can never be constructed.
/// Can you work out why?
pub type Never {
Never(Never)
}
/// Call a function twice with an initial value.
///
pub fn twice(argument: value, my_function: fn(value) -> value) -> value {
my_function(my_function(argument))
}
/// Call a function three times with an initial value.
///
pub fn thrice(argument: value, my_function: fn(value) -> value) -> value {
my_function(my_function(my_function(argument)))
}
|