I have a problem considering implicit parameters in Haskell (GHC). I have a function f, that assumes the implicit parameter x, and would like to encapsulate it in a context by applying f to g
f :: (?x :: Int) => Int -> Int
f n = n + ?x
g :: (Int -> Int) -> (Int -> Int)
g t = let ?x = 5 in t
But when i try to evaluate
g f 10
I get an error that x is not bound, e.g.:
Unbound implicit parameter (?x::Int)
arising from a use of `f'
In the first argument of `g', namely `f'
In the second argument of `($)', namely `g f 10'
Can anybody tell me, what I am doing wrong?
(I am trying to get the WordNet Interface for Haskell to work - http://www.umiacs.umd.edu/~hal/HWordNet/ - and it uses on implicit parameters in the above manner, and I keep getting errors as the one above when I try to compile it)