
17 Jan
2020
17 Jan
'20
10:38 p.m.
Richard Eisenberg
One advantage of the phantom-parameter approach is that it allows for nice polymorphism.
lookupEnv :: Uniquable dom => UniqFM dom rng -> dom -> Maybe rng
Now, we don't need lookupVarEnv separately from lookupNameEnv, but we get the type-checking for free.
This is true but some consider the fact that the function name captures the environment type to be a good thing. I don't have a strong opinion one way of the other on this. Cheers, - Ben