C#:
public static B Bracket<A, B>(Func<A> before, Action<A> after, Func<A, B> during);
Scala:
def bracket[A, B](before: => A, after: A => Unit)(during: A => B): B
Kotlin:
fun bracket<A, B>(before: () -> A, after: (A) -> Unit, during: (A) -> B): B
Ceylon:
shared B bracket<A, B>(A before(), void after(A))(B during(A));
Haskell:
bracket :: IO a -> (a -> IO ()) -> (a -> IO b) -> IO b
Agda:
bracket : ∀{i j} → {A : Set i} → {B : A → Set j} → IO A → (A → IO ⊤) → ((x : A) → IO (B x)) → IO (Σ[ x ∈ A ] B x)
Spellcode:
bracket :: forall i A B where (i :: Level) & (A :: Type i) & (B :: A -@ Total @> Type i) in A -@ Total @> (A -@ IO @> Top) -@ Total @> ((x : A) -@ IO @> B x) -@ IO @> (exists x where x :: A in B x)