Module: System::Collections::BooleanLambdas

Extended by:
BooleanLambdas
Included in:
BooleanLambdas, F
Defined in:
lib/raskell/f.rb

Instance Method Summary collapse

Instance Method Details

#andObject



137
138
139
# File 'lib/raskell/f.rb', line 137

def and
  @@and||= ->(x,y) { x && y }
end

#andsObject



157
158
159
# File 'lib/raskell/f.rb', line 157

def ands
  @@ands||= ->(x) { x == Nothing } * find_where.(F.equals.(false))
end

#nandObject



141
142
143
# File 'lib/raskell/f.rb', line 141

def nand
  @@nand||= ->(x,y) { !(x && y) }
end

#norObject



149
150
151
# File 'lib/raskell/f.rb', line 149

def nor
  @@nor||= ->(x,y) { !x && !y }
end

#notObject

booleans



133
134
135
# File 'lib/raskell/f.rb', line 133

def not
  @@not||= ->(x) { !x }
end

#orObject



145
146
147
# File 'lib/raskell/f.rb', line 145

def or
  @@or||= ->(x,y) { x || y }
end

#orsObject



161
162
163
# File 'lib/raskell/f.rb', line 161

def ors
  @@ors||= ->(x) { x != Nothing } * find_where.(F.equals.(true))
end

#xorObject



153
154
155
# File 'lib/raskell/f.rb', line 153

def xor
  @@xor||= ->(x,y) { !(x && y) && (x || y) }
end