     }
     return nil
 }
-
-enum ParseResult<T> {
-    case Default
-    case Error
-    case Result(T)
-
-    func defaultTo(d: T?) -> T? {
-        switch self {
-        case .Default:
-            return d
-        case .Result(let value):
-            return value
-        case .Error:
-            return nil
-        }
-    }
-
-    func overrideWith(possibleOverride: T?) -> T? {
-        if let concreteValue = possibleOverride {
-            return concreteValue
-        }
-        return self.defaultTo(possibleOverride)
-    }
-}

        return nil
    }

    func factorParser(parsedCounter: ParseResult<UInt64>, parsedPeriod: ParseResult<NSTimeInterval>) -> (string: String) -> Generator.Factor? {
        return { string in
        if string == FactorCounterString {
            if let counter = parsedCounter.defaultTo(0) {

            return .Default
        }
    }

    enum ParsedResult<T> {
        case Result(T), Default, Error

        func defaultTo(d: T?) -> T? {
            switch self {
            case .Default: return d
            case .Result(let value): return value
            case .Error: return nil
            }
        }

        func overrideWith(possibleOverride: T?) -> T? {
            if let concreteValue = possibleOverride {
                return concreteValue
            }
            return self.defaultTo(possibleOverride)
        }
    }


    func counterParser(string: String) -> UInt64? {
        errno = 0
