 infix operator ~ {}
 
 public func ~(lhs: ViewExpression, rhs: Int) -> ViewExpression {
-    switch lhs {
-    case .Predicate(let p):
+    if case let .Predicate(p) = lhs {
         return .Predicate(LayoutPredicate(relation: p.relation, object: p.object, priority: rhs))
-    default:
-        fatalError("Error")
-    }
+    }
+    fatalError("Error")
 }
 
 public func ~(lhs: LayoutOrientation, rhs: VisualFormat) -> [AnyObject] {

// MARK: helper funcs

private func createVisualFormatPredicate(view: ViewExpression, priority: Int? = nil) -> VisualFormat {
    switch view {
    case .Predicate(let p):
        return .Predicate(LayoutPredicate(relation: p.relation, object: p.object, priority: priority))
    default:
        fatalError("Error")
    }
}

private func createViewExpressionPredicate(view: ViewExpression, relation: LayoutRelation) -> ViewExpression {
    switch view {
    case .View(let v):
        return .Predicate(LayoutPredicate(relation: relation, object: .View(v), priority: nil))
    default:
        fatalError("Error")
    }
}

// MARK: - operators


    public var description: String {
        let d = relation.rawValue + object.description
        guard let p = priority else { return d }
        return "\(d)@\(p)"
    }
}

// MARK: <relation>

public enum LayoutRelation : String {
    case Equal              = "=="
    case GreaterThanOrEqual = ">="
    case LessThanOrEqual    = "<="
}

// MARK: <objectOfPredicate>
