spotless/context
Types
Pass functions that don’t fail because we don’t want to decide a result type.
- fetch does fail as there is an enumerable type of failures and the failure is external. failure of hash would be closer to fetch failing due to missing network stack
pub type Context(t, key) {
Context(
export_jwk: fn(key) -> fn(fn(json.Json) -> t) -> t,
follow: fn(uri.Uri) -> fn(fn(Result(uri.Uri, String)) -> t) -> t,
fetch: fn(request.Request(BitArray)) -> fn(
fn(Result(response.Response(BitArray), effect.FetchError)) -> t,
) -> t,
hash: fn(effect.HashAlgorithm, BitArray) -> fn(
fn(BitArray) -> t,
) -> t,
sign: fn(effect.SignAlgorithm, key, BitArray) -> fn(
fn(Result(BitArray, String)) -> t,
) -> t,
strong_random: fn(Int) -> fn(fn(BitArray) -> t) -> t,
unix_now: fn() -> fn(fn(Int) -> t) -> t,
)
}
Constructors
-
Context( export_jwk: fn(key) -> fn(fn(json.Json) -> t) -> t, follow: fn(uri.Uri) -> fn(fn(Result(uri.Uri, String)) -> t) -> t, fetch: fn(request.Request(BitArray)) -> fn( fn(Result(response.Response(BitArray), effect.FetchError)) -> t, ) -> t, hash: fn(effect.HashAlgorithm, BitArray) -> fn( fn(BitArray) -> t, ) -> t, sign: fn(effect.SignAlgorithm, key, BitArray) -> fn( fn(Result(BitArray, String)) -> t, ) -> t, strong_random: fn(Int) -> fn(fn(BitArray) -> t) -> t, unix_now: fn() -> fn(fn(Int) -> t) -> t, )