Module Prelude
In: lib/prelude.rb
lib/prelude/list.rb
lib/prelude/monad.rb
lib/prelude/tuple.rb

Methods

Classes and Modules

Module Prelude::List
Module Prelude::Monad
Class Prelude::EmptyListError
Class Prelude::MissingFunctionError
Class Prelude::Tuple

Constants

VERSION = '0.0.3'
Id = lambda { |x| x }   Returns function that returns its argument

Public Instance methods

This is used to handle empty list errors in this library. Re-define to fit.

[Source]

    # File lib/prelude.rb, line 39
39:   def empty_list_error
40:     raise EmptyListError, 'Illegal operation on an empty list.'
41:   end

A utility to determine if a function was passed

[Source]

    # File lib/prelude.rb, line 52
52:   def get_proc(f=nil, &block)
53:     # Has to be either function 'f' or block
54:     f = block_given? ? block : missing_function_error if f.nil?
55:     f.to_proc
56:   end

This is used to handle missing function errors in this library. Re-define to fit.

[Source]

    # File lib/prelude.rb, line 47
47:   def missing_function_error
48:     raise MissingFunctionError, 'No function or block supplied.'
49:   end