T5689.hs:10:36: error: Couldn't match expected type ‘Bool’ with actual type ‘t’ In the expression: v In the expression: if v then False else True Relevant bindings include v :: t (bound at T5689.hs:10:28) r :: IORef (t -> t) (bound at T5689.hs:7:14)