prelude 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. data/CHANGELOG +25 -1
  2. data/README +11 -12
  3. data/Rakefile +6 -10
  4. data/lib/prelude.rb +36 -91
  5. data/lib/prelude/{tuple.rb → array_list.rb} +30 -27
  6. data/lib/prelude/functions.rb +414 -0
  7. data/lib/prelude/functors.rb +72 -0
  8. data/lib/prelude/lambda.rb +89 -0
  9. data/lib/prelude/minimal_array_list.rb +61 -0
  10. data/lib/prelude/monad.rb +11 -15
  11. data/lib/prelude/proper_list.rb +47 -0
  12. data/lib/prelude/proper_ruby_list.rb +48 -0
  13. data/lib/prelude/util.rb +33 -0
  14. data/test/tc_functions.rb +801 -0
  15. data/test/tc_monad.rb +21 -41
  16. data/test/ts_prelude.rb +2 -8
  17. metadata +13 -36
  18. data/doc/classes/Kernel.html +0 -198
  19. data/doc/classes/Prelude.html +0 -241
  20. data/doc/classes/Prelude/EmptyListError.html +0 -113
  21. data/doc/classes/Prelude/List.html +0 -2692
  22. data/doc/classes/Prelude/MissingFunctionError.html +0 -113
  23. data/doc/classes/Prelude/Monad.html +0 -283
  24. data/doc/classes/Prelude/Tuple.html +0 -217
  25. data/doc/classes/Proc.html +0 -198
  26. data/doc/classes/Symbol.html +0 -219
  27. data/doc/created.rid +0 -1
  28. data/doc/files/CHANGELOG.html +0 -122
  29. data/doc/files/README.html +0 -328
  30. data/doc/files/TODO.html +0 -95
  31. data/doc/files/lib/prelude/list_rb.html +0 -83
  32. data/doc/files/lib/prelude/monad_rb.html +0 -83
  33. data/doc/files/lib/prelude/tuple_rb.html +0 -83
  34. data/doc/files/lib/prelude_rb.html +0 -98
  35. data/doc/fr_class_index.html +0 -35
  36. data/doc/fr_file_index.html +0 -33
  37. data/doc/fr_method_index.html +0 -140
  38. data/doc/index.html +0 -27
  39. data/doc/rdoc-style.css +0 -208
  40. data/lib/prelude/list.rb +0 -588
  41. data/test/tc_higher.rb +0 -89
  42. data/test/tc_list.rb +0 -777
  43. data/test/tc_tuple.rb +0 -82
@@ -1,82 +0,0 @@
1
- #--
2
- # $Id: tc_tuple.rb 7 2006-09-06 17:03:26Z prelude $
3
- #
4
- #
5
- # This file is part of the Prelude library that provides tools to
6
- # enable Haskell style functional programming in Ruby.
7
- #
8
- # http://prelude.rubyforge.org
9
- #
10
- # Copyright (C) 2006 APP Design, Inc.
11
- #
12
- # This library is free software; you can redistribute it and/or
13
- # modify it under the terms of the GNU Lesser General Public
14
- # License as published by the Free Software Foundation; either
15
- # version 2.1 of the License, or (at your option) any later version.
16
- #
17
- # This library is distributed in the hope that it will be useful,
18
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
- # Lesser General Public License for more details.
21
- #
22
- # You should have received a copy of the GNU Lesser General Public
23
- # License along with this library; if not, write to the Free Software
24
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25
- #++
26
-
27
- class TestTuple < Test::Unit::TestCase
28
-
29
- def setup
30
- # Nothing
31
- end # setup
32
-
33
- def teardown
34
- # Nothing
35
- end # teardown
36
-
37
- def test_tuple
38
- result = Tuple.new()
39
- expect = [nil, nil]
40
-
41
- assert_equal(expect, result)
42
-
43
- result = Tuple.new(1)
44
- expect = [1, nil]
45
-
46
- assert_equal(expect, result)
47
-
48
- result = Tuple.new(1, 2)
49
- expect = [1, 2]
50
-
51
- assert_equal(expect, result)
52
-
53
- result = Tuple.new(1, 2, 3)
54
- expect = [1, [2, 3]]
55
-
56
- assert_equal(expect, result)
57
-
58
- result = Tuple.new([1, 2])
59
- expect = [1, [2]]
60
-
61
- assert_equal(expect, result)
62
-
63
- result = Tuple.new([1, 2, 3, 4, 5])
64
- expect = [1, [2, 3, 4, 5]]
65
-
66
- assert_equal(expect, result)
67
- end
68
-
69
- def test_fst
70
- result = Tuple.new(1, 2, 3).fst
71
- expect = 1
72
-
73
- assert_equal(expect, result)
74
- end
75
-
76
- def test_snd
77
- result = Tuple.new(1, 2, 3).snd
78
- expect = [2, 3]
79
-
80
- assert_equal(expect, result)
81
- end
82
- end # TestTuple