Sha256: 3880837a3b6e7aa6232cf26c196c94fb430730222e6d2eeb2a0c0a9495b19086

Contents?: true

Size: 504 Bytes

Versions: 13

Compression:

Stored size: 504 Bytes

Contents

require 'funkr/categories'

module Funkr
  module Types
    class Container

      include Funkr::Categories

      def initialize(value)
        @value = value
      end

      def unbox; @value; end

      def to_s; format("{- %s -}", @value.to_s); end

      include Functor

      def map(&block)
        self.class.new(yield(@value))
      end

      include Monoid
      extend Monoid::ClassMethods

      def mplus(c_y)
        self.class.new(@value.mplus(c_y.unbox))
      end

    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
funkr-0.0.40 lib/funkr/types/container.rb
funkr-0.0.30 lib/funkr/types/container.rb
funkr-0.0.28 lib/funkr/types/container.rb
funkr-0.0.27 lib/funkr/types/container.rb
funkr-0.0.26 lib/funkr/types/container.rb
funkr-0.0.25 lib/funkr/types/container.rb
funkr-0.0.24 lib/funkr/types/container.rb
funkr-0.0.23 lib/funkr/types/container.rb
funkr-0.0.22 lib/funkr/types/container.rb
funkr-0.0.21 lib/funkr/types/container.rb
funkr-0.0.20 lib/funkr/types/container.rb
funkr-0.0.19 lib/funkr/types/container.rb
funkr-0.0.18 lib/funkr/types/container.rb