summaryrefslogtreecommitdiff
path: root/lib/ChainedMapper.cs
blob: 1f5ee2b90192f399ee19a9fda837f4b1ee1f13aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
namespace jive
{
  public class ChainedMapper<Left, Middle, Right> : Mapper<Left, Right>
  {
    readonly Mapper<Left, Middle> left;
    readonly Mapper<Middle, Right> right;

    public ChainedMapper(Mapper<Left, Middle> left, Mapper<Middle, Right> right)
    {
      this.left = left;
      this.right = right;
    }

    public Right map_from(Left item)
    {
      return right.map_from(left.map_from(item));
    }
  }
}