Define a domain filter of a function Let $\mathbb{B}, \mathbb{V}$ two sets. I have defined a function $f: \mathbb{B} \rightarrow \mathbb{V}$. 
$\mathcal{P}(\mathbb{B})$ means the power set of $\mathbb{B}$,
I am looking for a function $g: (\mathbb{B} \rightarrow \mathbb{V}) \times \mathcal{P}(\mathbb{B}) \rightarrow (\mathcal{P}(\mathbb{B}) \rightarrow \mathbb{V})$ which can filter the domain of $f$ by a subset of $\mathbb{B}$, that means $g: (f, \mathbb{S}) \mapsto h$ such that the domain of $h$ is $\mathbb{S}$ and $\forall x \in \mathbb{S}, h(x) = f(x)$.
I am wondering if this kind of function exists already. If not, is there a better way to define it?
Could anyone help?

What you denote $g(f,\mathbb S)$ is usually called the restriction of $f$ to $\mathbb S$, and denoted $f|\mathbb S$ or $f\upharpoonright \mathbb S$. Sometimes this notation is used even if $\mathbb S$ is not contained in the domain of $f$, in which case it is understood to be $f\upharpoonright A$, where $A=\mathbb S\cap{\rm dom}(f)$.
(And, agreeing with Trevor's comment, the range of $g$ should be $\bigcup_{\mathbb S\in\mathcal P(\mathbb B)}(\mathbb S\to \mathbb V)$ rather than ${\mathcal P}(\mathbb B)\to\mathbb V$. Anyway, I much prefer the notation $A^B$ or ${}^B A$ instead of $B\to A$.)
