For example, i've got following function:
foo :: t -> f
foo var = foo' b var
where
b = bar 0.5 vect
and I need to specify literals' 0.5 type — 't'
If i write smth. like (0.5::t), GHC creates new type variable 't0', which is not corresponding to original 't'.
I've wrote a small function
ct :: v -> v -> v
ct _ u = u
and use it like this:
b = bar (ct var 0.5) d
Is there any better solution?
(0.5::t)and it will match thetto the surrounding scope'st, but I forget what it is.FloatorIntso you pass almost no type information to the compiler which is asking for more information.ghcithe interpreter does it still fail - as i remember it is less strictly. in addition you can find out about a function's type by:t foo