in the range on the right. if 1...list.count ~= indexPath.row { ... } // Check to see if the key is contained in the array. if ["foo", "bar"] ~= key { ... }
in repos { if let permissions = repoDict.objectForKey("permissions") as? NSDictionary { if let isAdmin = permissions.objectForKey("admin") as? Bool { if isAdmin { println("They are an admin!") } } } } }
:: Integer } deriving (Show) instance FromJSON User where parseJSON (Object j) = User <$> (j .: "username") <*> (j .:? "id") case decode JSON :: Maybe User of Just user -> print user Nothing -> error "Invalid JSON"