import TDRedux

public typealias Store = TDRedux.Store<State>

public protocol ToDoAction: Action { }

public struct ToDo {
    public let title: String

    public init(title: String) {
        self.title = title
    }
}

public struct State {
    public static let initial = State.init(todos: [])

    public let todos: [ToDo]

    public init(todos: [ToDo]) {
        self.todos = todos
    }

    func add(title: String) -> State {
        return .init(todos: todos + [.init(title: title)])
    }
}

public enum ToDoActions: ToDoAction {
    case add(title: String)
}

public let reducer = Reducer(initialState: State.initial) { (state, action: ToDoActions) in
    switch action {
    case let .add(title):
        return state.add(title: title)
    }
}

import TDRedux

public typealias Store = TDRedux.Store<State>

public protocol ToDoAction { }

public struct ToDo {
    public let title: String

    public init(title: String) {
        self.title = title
    }
}

public struct State {
    public static let initial = State.init(todos: [])

    public let todos: [ToDo]

    public init(todos: [ToDo]) {
        self.todos = todos
    }

    func add(title: String) -> State {
        return .init(todos: todos + [.init(title: title)])
    }
}

public enum ToDoActions: ToDoAction {
    case add(title: String)
}

public let reducer = Reducer(initialState: State.initial) { (state, action: ToDoActions) in
    switch action {
    case let .add(title):
        return state.add(title: title)
    }
}

--- 
+++ 
@@ -2,7 +2,7 @@
 
 public typealias Store = TDRedux.Store<State>
 
-public protocol ToDoAction { }
+public protocol ToDoAction: Action { }
 
 public struct ToDo {
     public let title: String
Fix ToDoAction did not conform to Action
