prelude 0.0.1
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.
- data/CHANGELOG +7 -0
- data/COPYING +339 -0
- data/README +47 -0
- data/Rakefile +109 -0
- data/TODO +6 -0
- data/lib/prelude.rb +66 -0
- data/lib/prelude/list.rb +572 -0
- data/lib/prelude/monad.rb +39 -0
- data/lib/prelude/tuple.rb +64 -0
- data/test/tc_higher.rb +89 -0
- data/test/tc_list.rb +772 -0
- data/test/tc_tuple.rb +44 -0
- data/test/ts_prelude.rb +35 -0
- metadata +59 -0
data/test/tc_tuple.rb
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
#--
|
2
|
+
# $Id: tc_tuple.rb 1 2006-08-24 20:34:21Z 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 program is free software; you can redistribute it and/or modify
|
13
|
+
# it under the terms of the GNU General Public License as published by
|
14
|
+
# the Free Software Foundation; either version 2 of the License, or
|
15
|
+
# (at your option) any later version.
|
16
|
+
#
|
17
|
+
# This program 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
|
20
|
+
# GNU General Public License for more details.
|
21
|
+
#
|
22
|
+
# You should have received a copy of the GNU General Public License along
|
23
|
+
# with this program; if not, write to the Free Software Foundation, Inc.,
|
24
|
+
# 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([1, 2, 3, 4, 5])
|
39
|
+
expect = [1, [2, 3, 4, 5]]
|
40
|
+
|
41
|
+
assert_equal(expect, result)
|
42
|
+
end
|
43
|
+
|
44
|
+
end # TestTuple
|
data/test/ts_prelude.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
#--
|
2
|
+
# $Id: ts_prelude.rb 1 2006-08-24 20:34:21Z 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 program is free software; you can redistribute it and/or modify
|
13
|
+
# it under the terms of the GNU General Public License as published by
|
14
|
+
# the Free Software Foundation; either version 2 of the License, or
|
15
|
+
# (at your option) any later version.
|
16
|
+
#
|
17
|
+
# This program 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
|
20
|
+
# GNU General Public License for more details.
|
21
|
+
#
|
22
|
+
# You should have received a copy of the GNU General Public License along
|
23
|
+
# with this program; if not, write to the Free Software Foundation, Inc.,
|
24
|
+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
25
|
+
#++
|
26
|
+
|
27
|
+
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
28
|
+
|
29
|
+
require 'prelude'
|
30
|
+
include Prelude
|
31
|
+
require 'test/unit'
|
32
|
+
|
33
|
+
require 'tc_list'
|
34
|
+
require 'tc_higher'
|
35
|
+
require 'tc_tuple'
|
metadata
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.9.0
|
3
|
+
specification_version: 1
|
4
|
+
name: prelude
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.0.1
|
7
|
+
date: 2006-08-24 00:00:00 -05:00
|
8
|
+
summary: Haskell-like functional library
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email: prelude@rubyforge.org
|
12
|
+
homepage: http://prelude.rubyforge.org
|
13
|
+
rubyforge_project: prelude
|
14
|
+
description: Enables Ruby programmers to use higher functions, monads, and other Haskell features.
|
15
|
+
autorequire: prelude
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: true
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
24
|
+
version:
|
25
|
+
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
29
|
+
authors:
|
30
|
+
- Ivan K. and APP Design, Inc.
|
31
|
+
files:
|
32
|
+
- Rakefile
|
33
|
+
- README
|
34
|
+
- TODO
|
35
|
+
- CHANGELOG
|
36
|
+
- COPYING
|
37
|
+
- lib/prelude
|
38
|
+
- lib/prelude.rb
|
39
|
+
- lib/prelude/list.rb
|
40
|
+
- lib/prelude/monad.rb
|
41
|
+
- lib/prelude/tuple.rb
|
42
|
+
- test/tc_higher.rb
|
43
|
+
- test/tc_list.rb
|
44
|
+
- test/tc_tuple.rb
|
45
|
+
- test/ts_prelude.rb
|
46
|
+
test_files:
|
47
|
+
- test/ts_prelude.rb
|
48
|
+
rdoc_options: []
|
49
|
+
|
50
|
+
extra_rdoc_files: []
|
51
|
+
|
52
|
+
executables: []
|
53
|
+
|
54
|
+
extensions: []
|
55
|
+
|
56
|
+
requirements:
|
57
|
+
- none
|
58
|
+
dependencies: []
|
59
|
+
|