Class Prelude::Monad
In: lib/prelude/monad.rb
Parent: Array

$Id: monad.rb 7 2006-09-06 17:03:26Z prelude $

The Monad is an Array only in an implementation sence of the word

Methods

bind   empty   join   wrap  

Public Instance methods

[Source]

    # File lib/prelude/monad.rb, line 45
45:     def bind(&block)
46:       map(&block).join
47:     end

[Source]

    # File lib/prelude/monad.rb, line 35
35:     def empty
36:       []
37:     end

[Source]

    # File lib/prelude/monad.rb, line 39
39:     def join
40:       r = []
41:       each {|a| r.push *a}
42:       r
43:     end

[Source]

    # File lib/prelude/monad.rb, line 31
31:     def wrap(v)
32:       [v]
33:     end