View Source Bitcoinex.Bech32.DecodeResult (bitcoinex v0.1.8)

Link to this section Summary

Functions

This naming is taken from Haskell. we will treat DecodeResult a bit like an Monad And bind function will take a function that take DecodeResult that's only without error and return DecodeResult And we can skip handling same error case for all function

Link to this section Types

@type t() :: %Bitcoinex.Bech32.DecodeResult{
  data: String.t() | nil,
  encoded_str: String.t(),
  encoding_type: Bitcoinex.Bech32.encoding_type() | nil,
  error: atom() | nil,
  hrp: String.t() | nil
}

Link to this section Functions

Link to this function

add_error(decode_result, error)

View Source
@spec add_error(t(), atom()) :: t()
Link to this function

bind(decode_result, fun)

View Source
@spec bind(t(), (t() -> t())) :: t()

This naming is taken from Haskell. we will treat DecodeResult a bit like an Monad And bind function will take a function that take DecodeResult that's only without error and return DecodeResult And we can skip handling same error case for all function