public void Create() { var result = StateResult.Create(5, "A"); Assert.AreEqual(5, result.State); Assert.AreEqual("A", result.Value); }
State <string, int> DoSomething() { return(state => StateResult.Create(state + ", Wo", 2)); }
State <string, int> DoSomethingElse() { return(state => StateResult.Create(state + "rld", 1)); }
static State <Unit, S> Put <S>(S state) { return(_ => StateResult.Create <Unit, S>(Unit.Default, state)); }
private static State <int, int> ThirdOperation() { return(state => StateResult.Create(state + 2, 55)); }
private static State <int, string> SecondOperation(string value) { return(state => StateResult.Create(state + 1, value + "B")); }
private static State <int, string> FirstOperation() { return(state => StateResult.Create(state, "A")); }