Sha256: c76f85c97d4a30a0339e2de4912e8fe9ac6241023a84cd11b644b73bddb038e5

Contents?: true

Size: 588 Bytes

Versions: 11

Compression:

Stored size: 588 Bytes

Contents

# frozen_string_literal: true

require 'singleton'
require_relative 'duck_fiber'
require_relative 'nullary_relation'

unless MiniKraken::Core.constants(false).include? :Succeed
  module MiniKraken
    module Core
      # A nullary relation that unconditionally always fails.
      class Succeed < NullaryRelation
        include Singleton

        def initialize
          super('succeed', '#s')
        end

        def solver_for(_actuals, _env)
          DuckFiber.new(:success)
        end
      end # class

      Succeed.instance.freeze
    end # module
  end # module
end # unless

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mini_kraken-0.2.04 lib/mini_kraken/core/succeed.rb
mini_kraken-0.2.03 lib/mini_kraken/core/succeed.rb
mini_kraken-0.2.02 lib/mini_kraken/core/succeed.rb
mini_kraken-0.2.01 lib/mini_kraken/core/succeed.rb
mini_kraken-0.2.00 lib/mini_kraken/core/succeed.rb
mini_kraken-0.1.13 lib/mini_kraken/core/succeed.rb
mini_kraken-0.1.12 lib/mini_kraken/core/succeed.rb
mini_kraken-0.1.11 lib/mini_kraken/core/succeed.rb
mini_kraken-0.1.10 lib/mini_kraken/core/succeed.rb
mini_kraken-0.1.09 lib/mini_kraken/core/succeed.rb
mini_kraken-0.1.08 lib/mini_kraken/core/succeed.rb