For example, I have the following function:
foo :: t -> f foo var = foo' b var where b = bar 0.5 vect
and I need to specify literals like 0.5 - 't'
If I write smth. for example, (0.5::t) , GHC creates a new variable of type 't0' that does not match the original 't'.
I wrote a little function
ct :: v -> v -> v ct _ u = u
and use it as follows:
b = bar (ct var 0.5) d
Is there a better solution?
source share