Module: Funkr::Categories::Applicative

Defined in:
lib/funkr/categories/applicative.rb

Overview

Functors that can contain a function and be applied to functors containing parameters for the function

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#<(other) ⇒ Object



46
47
48
# File 'lib/funkr/categories/applicative.rb', line 46

def <(other)
  proxy_comp(other){|a,b| a < b}
end

#<=(other) ⇒ Object



50
51
52
# File 'lib/funkr/categories/applicative.rb', line 50

def <=(other)
  proxy_comp(other){|a,b| a <= b}
end

#<=>(other) ⇒ Object



38
39
40
# File 'lib/funkr/categories/applicative.rb', line 38

def <=>(other)
  proxy_comp(other){|a,b| a <=> b}
end

#==(other) ⇒ Object



42
43
44
# File 'lib/funkr/categories/applicative.rb', line 42

def ==(other)
  proxy_comp(other){|a,b| a == b}
end

#>(other) ⇒ Object



54
55
56
# File 'lib/funkr/categories/applicative.rb', line 54

def >(other)
  proxy_comp(other){|a,b| a > b}
end

#>=(other) ⇒ Object



58
59
60
# File 'lib/funkr/categories/applicative.rb', line 58

def >=(other)
  proxy_comp(other){|a,b| a >= b}
end

#applyObject

Apply the function living inside the functor . The type must be as follow :

Functor(λ(A) : B).apply(Functor(A)) : Functor(B)


11
12
13
# File 'lib/funkr/categories/applicative.rb', line 11

def apply
  raise "Applicative#apply not implemented"
end