Documentation

Lake.Toml.Decode

TOML Decoders #

This module contains definitions to assist in decoding TOML data values into concrete user types.

Instances For
    @[reducible, inline]
    abbrev Lake.Toml.DecodeM (α : Type) :

    Monad for decoders that do not abort.

    Instances For
      @[reducible, inline]

      Monad for decoders that may abort.

      Instances For
        class Lake.DecodeToml (α : Type) :
        Instances
          @[reducible, inline]
          Instances For
            @[inline]

            Run the decode action. If there were errors, throw. Otherwise, return the result.

            Instances For
              @[inline]
              def Lake.Toml.tryDecodeD {α : Type} (default : α) (x : EDecodeM α) :

              Run the decode action. If it fails, keep the errors but return default.

              Instances For
                @[inline]
                def Lake.Toml.tryDecode? {α : Type} (x : EDecodeM α) :

                Run the decode action. If it fails, keep the errors but return none.

                Instances For
                  @[inline]
                  def Lake.Toml.tryDecode {α : Type} [Inhabited α] (x : EDecodeM α) :

                  Run the decode action. If it fails, keep the errors but return Inhabited.default.

                  Instances For
                    @[inline]
                    def Lake.Toml.optDecodeD {β : Type} {α : Type u_1} (default : β) (a? : Option α) (f : αEDecodeM β) :

                    If the value is not none, run the decode action. If it fails, add the errors to the state and return default.

                    Instances For
                      @[inline]
                      def Lake.Toml.optDecode {β : Type} {α : Type u_1} [Inhabited β] (a? : Option α) (f : αEDecodeM β) :

                      If the value is not none, run the decode action. If it fails, add the errors to the state and return Inhabited.default.

                      Instances For
                        @[inline]
                        def Lake.Toml.optDecode? {α : Type u_1} {β : Type} (a? : Option α) (f : αEDecodeM β) :

                        If the value is not none, run the decode action. If it fails, add the errors to the state and return none. Otherwise, return the result in some.

                        Instances For
                          def Lake.Toml.mergeErrors {α β γ : Type} (x₁ : EDecodeM α) (x₂ : EDecodeM β) (f : αβγ) :

                          If either action errors, throw the concatenated errors. Otherwise, if no errors, combine the results with f.

                          Instances For
                            @[inline]
                            Instances For
                              def Lake.Toml.decodeArray {α : Type} [dec : DecodeToml α] (vs : Array Value) :

                              Decode an array of TOML values, merging any errors from the elements into a single array.

                              Instances For
                                @[inline]
                                Instances For
                                  @[implicit_reducible]
                                  @[inline]
                                  Instances For
                                    def Lake.Toml.decodeKeyval {α : Type} [dec : DecodeToml α] (k : Lean.Name) (v : Value) :
                                    Instances For
                                      @[inline]
                                      Instances For
                                        @[inline]
                                        def Lake.Toml.Table.decode? {α : Type} [dec : DecodeToml α] (t : Table) (k : Lean.Name) :
                                        Instances For
                                          Instances For
                                            @[implicit_reducible]
                                            @[inline]
                                            Instances For
                                              @[inline]
                                              def Lake.Toml.Table.tryDecode? {α : Type} [dec : DecodeToml α] (t : Table) (k : Lean.Name) :
                                              Instances For
                                                @[inline]
                                                def Lake.Toml.Table.tryDecodeD {α : Type} [dec : DecodeToml α] (k : Lean.Name) (default : α) (t : Table) :
                                                Instances For