Sha256: 5233419cd8af643756b394a459daebd4bb0ac5152013f947aa06c28bd35e8edb

Contents?: true

Size: 606 Bytes

Versions: 11

Compression:

Stored size: 606 Bytes

Contents

# frozen_string_literal: true

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

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

        def initialize
          super('fail', '#u')
        end

        # @return [DuckFiber]
        def solver_for(_actuals, _env)
          DuckFiber.new(:failure)
        end
      end # class

      Fail.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/fail.rb
mini_kraken-0.2.03 lib/mini_kraken/core/fail.rb
mini_kraken-0.2.02 lib/mini_kraken/core/fail.rb
mini_kraken-0.2.01 lib/mini_kraken/core/fail.rb
mini_kraken-0.2.00 lib/mini_kraken/core/fail.rb
mini_kraken-0.1.13 lib/mini_kraken/core/fail.rb
mini_kraken-0.1.12 lib/mini_kraken/core/fail.rb
mini_kraken-0.1.11 lib/mini_kraken/core/fail.rb
mini_kraken-0.1.10 lib/mini_kraken/core/fail.rb
mini_kraken-0.1.09 lib/mini_kraken/core/fail.rb
mini_kraken-0.1.08 lib/mini_kraken/core/fail.rb