///|
pub suberror Cancelled {
  Cancelled
}

///|
pub async fn[T] capture_cancellation(
  effect : async () -> T,
) -> T raise Cancelled {
  effect() catch {
    _ => raise Cancelled
  }
}