File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
2- source:
3- - var
2+ revision: 2013
3+ type: ruby
4+ sources:
5+ - Indexfile
46authors:
57- name: Thomas Sawyer
68 email: transfire@gmail.com
7- copyrights: []
8- replacements: []
9- alternatives: []
9+ organizations: []
1010requirements:
11- - name: detroit
12- groups:
13- - build
14- development: true
15- - name: lemon
16- groups:
11+ - groups:
1712 - test
1813 development: true
19- - name: ae
20- groups:
14+ name: lemon
15+ - groups:
2116 - test
2217 development: true
23- dependencies: []
18+ name: ae
2419conflicts: []
20+ alternatives: []
21+ resources:
22+ - type: home
23+ uri: http://rubyworks.github.com/functor
24+ label: Homepage
25+ - type: code
26+ uri: http://github.com/rubyworks/functor
27+ label: Source Code
2528repositories:
26- - uri: git://github.com/proutils/functor.git
29+ - name: upstream
2730 scm: git
28- name: upstream
29- resources:
30- home: http://rubyworks.github.com/functor
31- code: http://github.com/rubyworks/functor
32- mail: http://groups.google.com/group/rubyworks-mailinglist
33- extra: {}
34- load_path:
35- - lib
36- revision: 0
37- created: '2004-03-04'
38- summary: Higher-Order Functions for Ruby
31+ uri: git://github.com/rubyworks/functor.git
32+ categories: []
33+ copyrights:
34+ - holder: Rubyworks
35+ year: '2011'
36+ license: BSD-2
37+ customs: []
38+ paths:
39+ lib:
40+ - lib
41+ name: functor
3942title: Functor
4043version: 1.0.0
41- name: functor
42- description: ! 'By definition a Functor is simply a first class method, but these
43- are common
44-
45- in the form of Method and Proc. So for Ruby a Functor is a more specialized
46-
47- as a Higher-order function or Metafunction. Essentally, a Functor can vary
48-
49- its behavior accorrding to the operation applied to it.'
50- date: '2011-12-07'
44+ summary: Higher-Order Methods for Ruby
45+ description: By definition a Functor is simply a first class method, but these are
46+ common in the form of Method and Proc. So for Ruby a Functor is a more specialized
47+ as a Higher-order function or Metafunction. Essentally, a Functor can vary its behavior
48+ accorrding to the operation applied to it.
49+ created: '2004-03-04'
50+ date: '2015-02-23'
Original file line number Diff line number Diff line change 1- source :rubygems
1+ source "https://rubygems.org"
2+
23gemspec
Original file line number Diff line number Diff line change 1+ ---
2+ name:
3+ functor
4+
5+ version:
6+ 1.0.0
7+
8+ title:
9+ Functor
10+
11+ summary:
12+ Higher-Order Methods for Ruby
13+
14+ description:
15+ By definition a Functor is simply a first class method, but these are common
16+ in the form of Method and Proc. So for Ruby a Functor is a more specialized
17+ as a Higher-order function or Metafunction. Essentally, a Functor can vary
18+ its behavior accorrding to the operation applied to it.
19+
20+ requirements:
21+ #- detroit (build)
22+ - lemon (test)
23+ - ae (test)
24+
25+ resources:
26+ home: http://rubyworks.github.com/functor
27+ code: http://github.com/rubyworks/functor
28+
29+ repositories:
30+ upstream: git://github.com/rubyworks/functor.git
31+
32+ authors:
33+ - Thomas Sawyer <transfire@gmail.com>
34+
35+ created:
36+ 2004-03-04
37+
38+ copyrights:
39+ - 2011 Rubyworks (BSD-2)
40+
Original file line number Diff line number Diff line change 1- Functor - Higher Order Functions for Ruby
2-
3- <http://rubyworks.github.com/functor>
4-
5- Copyright 2004 Rubyworks. All rights reserved.
6-
71BSD-2-Clause License
82
93Redistribution and use in source and binary forms, with or without
Original file line number Diff line number Diff line change 77
88## Synopsis
99
10- By definition a Functor is simply a first class method, but these are common
11- in the form of Method and Proc. So for Ruby a Functor is a more specialized
12- as a Higher-order function or Metafunction . Essentally, a Functor can vary
13- its behavior accorrding to the operation applied to it.
10+ By definition a * Functor* is simply a first class method, but these are common
11+ in Ruby in the form of Method and Proc classes . So for Ruby a Functor is a more
12+ specialized Higher Order Function . Essentally, a Functor can vary its behavior
13+ accorrding to the operation applied to it.
1414
1515 f = Functor.new { |op, x| x.send(op, x) }
1616
@@ -21,6 +21,13 @@ its behavior accorrding to the operation applied to it.
2121 (f * 2) #=> 4
2222 (f * 3) #=> 9
2323
24+ You can also think of the Functor as an * anonymous generic delegator* . Instead
25+ of having to create a specialized delegator class, we can use a Functor. Functors
26+ are perfect when the delegation require is minimal.
27+
28+ NOTE: Ruby functors are not the same thing a Haskell functors. In Ruby, the
29+ Enumerator is most closely akin to Haskell's idea of a functor.
30+
2431
2532## Copyrights
2633
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments