public void SecondFunctorLawHoldsForMapNode(IRoseTree <int, string> t) { char f(bool b) => b ? 'T' : 'F'; bool g(int i) => i % 2 == 0; Assert.Equal( t.MapNode(x => f(g(x))), t.MapNode(g).MapNode(f)); }
public void ConsistencyLawHolds(IRoseTree <int, string> t) { DateTime f(int i) => new DateTime(i); bool g(string s) => string.IsNullOrWhiteSpace(s); Assert.Equal(t.BiMap(f, g), t.MapLeaf(g).MapNode(f)); Assert.Equal( t.MapNode(f).MapLeaf(g), t.MapLeaf(g).MapNode(f)); }
public void MapNodeObeysFirstFunctoryLaw(IRoseTree <int, string> t) { Assert.Equal(t, t.MapNode(Id)); }