weedTypeDec filename (ITF modifiers name _ methods info)
  | name == "ObjectInterface" = Nothing
  | "private" `elem` modifiers = Just $ "Interfaces cannot be private" ++ show info
  | (nub modifiers) /= modifiers = Just $ "Interface modifiers cannot be repeated" ++ show info
  | methodError /= Nothing = methodError
  | name /= correctName = Just $ "Expected class to be named '" ++ correctName ++ "' but saw '" ++ name ++ "'" ++ show info
  | otherwise = Nothing
  where methodError = weedInterfaceMethods methods
        correctName = head $ splitOneOf "." (last (splitOneOf "/" filename))
weedTypeDec filename (ITF modifiers name _ methods info)
  | name == "ObjectInterface" = Nothing
  | "private" `elem` modifiers = Just $ "Interfaces cannot be private" ++ show info
  | (nub modifiers) /= modifiers = Just $ "Interface modifiers cannot be repeated" ++ show info
  | methodError /= Nothing = methodError
  | name /= correctName = Just $ "Expected class to be named '" ++ correctName ++ "' but saw '" ++ name ++ "'" ++ show info
  | otherwise = Nothing
  where methodError = weedInterfaceMethods methods
        correctName = head $ splitOneOf "." (last (splitOneOf "/" filename))
weedTypeDec filename (ITF modifiers name _ methods info)
  | name == "ObjectInterface" = Nothing
  | "private" `elem` modifiers = Just $ "Interfaces cannot be private" ++ show info
  | (nub modifiers) /= modifiers = Just $ "Interface modifiers cannot be repeated" ++ show info
  | methodError /= Nothing = methodError
  | name /= correctName = Just $ "Expected class to be named '" ++ correctName ++ "' but saw '" ++ name ++ "'" ++ show info
  | otherwise = Nothing
  where methodError = weedInterfaceMethods methods
        correctName = head $ splitOneOf "." (last (splitOneOf "/" filename))