public protocol Generator { associatedtype Value mutating func next() -> Value? } public struct Counter: Generator { var state: Int = 0 public mutating func next() -> Int? { let value = state state += 1 return value } } public func advance(by n: Int, _ t: inout T) { for _ in 0..: ~Copyable { case just(Wrapped) case none } extension Maybe: Copyable where Wrapped: Copyable {} public func ncIdentity(_ t: consuming T) -> T { return t } public protocol Either: ~Copyable { associatedtype Left: ~Copyable associatedtype Right: ~Copyable }