The type
search :: EnvV -> Store -> State
means
search :: EnvV -> Store -> Variable -> Z
Hence, you can use
search envV store var = store (envV var)
because envV var is a Location, which is then applied to store to produce a Z.
Note that the following code is correct, even if it's a bit puzzling
search :: EnvV -> Store -> State
search envV store var = store (envV var)
It's puzzling because its type shows two arguments, when the code below takes three. Equivalently, the code above is more commonly written as
search :: EnvV -> Store -> State
search envV store = \var -> store (envV var)
so that even in the definition we can find two arguments, and a result value which is actually a function of type State which maps every variable var into its value.
The code above can then further be simplified to use the function composition operator ., as @ChrisMartin already showed.
EnvVtakesVariablea.k.a.String, while you're applying it toStore. Please elaborate what you want to do.envV storeinstead ofenvV(store)).