If I may, there is another alternative that provides more flexibility. i.e., Use of
\rule[raise-height]{width}{thickness}
The \rule
command is used to produce horizontal lines. The arguments are defined as follows.
raise-height specifies how high to raise the rule (optional)
width specifies the length of the rule (mandatory)
thickness specifies the thickness of the rule (mandatory)
Code
\documentclass{article}
\usepackage[paper size={12cm,8cm}
\pagestyle{empty}
\begin{document}
baseline + 0cm \hfil shorter \hfil thicker
\hfil $\rule[0cm]{1cm} {0.1pt}: A\to B$
\hfil $\rule[0cm]{0.5cm} {0.1pt}: A\to B$
\hfil $\rule[0cm]{1cm} {1pt}: A\to B$ \hfil
\medskip baseline + 0.1cm \medskip
\hfil $\rule[0.1cm]{1cm} {0.1pt}: A\to B$
\hfil $\rule[0.1cm]{0.5cm}{0.1pt}: A\to B$
\hfil $\rule[0.1cm]{1cm} {1pt}: A\to B$ \hfil
\medskip baseline + 0.3cm \medskip
\hfil $\rule[0.3cm]{1cm} {0.1pt}: A\to B$
\hfil $\rule[0.3cm]{0.5cm}{0.1pt}: A\to B$
\hfil $\rule[0.3cm]{1cm} {1pt}: A\to B$ \hfil
\medskip baseline + 0.5cm \medskip
\hfil $\rule[0.5cm]{1cm} {0.1pt}: A\to B$
\hfil $\rule[0.5cm]{0.5cm} {0.1pt}: A\to B$
\hfil $\rule[0.5cm]{1cm} {1pt}: A\to B$ \hfil
\end{document}
We define $x\to \overline{x}$ as a map $A\mapsto B$.
Or something like that, I'm not a very good English speaker. If you go for the direct notation anyways, use parentheses to clarify the notation:$(\overline{\phantom{A}}):A\mapsto B$
.f: A -> B
instead off : A -> B
.