We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa7aab2 commit 0375504Copy full SHA for 0375504
src/Nix/Var.hs
@@ -15,6 +15,7 @@ import Data.STRef
15
import Type.Reflection ((:~:)(Refl))
16
17
import Unsafe.Coerce
18
+import Data.Bool ( bool )
19
20
type Var m = Ref m
21
@@ -37,7 +38,15 @@ atomicModifyVar = atomicModifyRef
37
38
39
--TODO: Upstream GEq instances
40
instance GEq IORef where
- a `geq` b = if a == unsafeCoerce b then Just $ unsafeCoerce Refl else Nothing
41
+ a `geq` b =
42
+ bool
43
+ Nothing
44
+ (pure $ unsafeCoerce Refl)
45
+ (a == unsafeCoerce b )
46
47
instance GEq (STRef s) where
48
49
50
51
+ (pure $ unsafeCoerce Refl )
52
+ (a == unsafeCoerce b)
0 commit comments