nsidToFriendlyName :: L2.L2NamespaceID -> L2.L2NamespaceID -> ModelTranslation String
nsidToFriendlyName context target
  | context == target = return "main namespace"
  | otherwise = do
    n <- BSC.unpack <$>
           (fromMaybe "anonymous namespace" <$> (nsidToFriendlyName' context target))
    nsc <- getNamespaceContents "friendlyname" target
    return $ n ++ (" at " ++ show (L2.l2nsSrcSpan nsc))
nsidToFriendlyName :: L2.L2NamespaceID -> L2.L2NamespaceID -> ModelTranslation String
nsidToFriendlyName context target
  | context == target = return "main namespace"
  | otherwise = do
    n <- BSC.unpack <$>
           (fromMaybe "anonymous namespace" <$> (nsidToFriendlyName' context target))
    nsc <- getNamespaceContents "friendlyname" target
    return $ n ++ (" at " ++ show (L2.l2nsSrcSpan nsc))
nsidToFriendlyName context target
  | context == target = return "main namespace"
  | otherwise = do
    n <- BSC.unpack <$>
           (fromMaybe "anonymous namespace" <$> (nsidToFriendlyName' context target))
    nsc <- getNamespaceContents "friendlyname" target
    return $ n ++ (" at " ++ show (L2.l2nsSrcSpan nsc))