about summary refs log tree commit diff
path: root/users/grfn/xanthous/src/Xanthous/Random.hs
diff options
context:
space:
mode:
Diffstat (limited to 'users/grfn/xanthous/src/Xanthous/Random.hs')
-rw-r--r--users/grfn/xanthous/src/Xanthous/Random.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/users/grfn/xanthous/src/Xanthous/Random.hs b/users/grfn/xanthous/src/Xanthous/Random.hs
index d97dcb9e11..72bdb63d2c 100644
--- a/users/grfn/xanthous/src/Xanthous/Random.hs
+++ b/users/grfn/xanthous/src/Xanthous/Random.hs
@@ -1,5 +1,6 @@
 --------------------------------------------------------------------------------
 {-# LANGUAGE UndecidableInstances #-}
+{-# LANGUAGE StandaloneDeriving #-}
 {-# OPTIONS_GHC -fno-warn-orphans #-}
 --------------------------------------------------------------------------------
 module Xanthous.Random
@@ -74,6 +75,10 @@ instance Choose (a, a) where
 newtype Weighted w t a = Weighted (t (w, a))
   deriving (Functor, Foldable) via (t `Compose` (,) w)
 
+deriving newtype instance Eq (t (w, a)) => Eq (Weighted w t a)
+deriving newtype instance Show (t (w, a)) => Show (Weighted w t a)
+deriving newtype instance NFData (t (w, a)) => NFData (Weighted w t a)
+
 instance Traversable t => Traversable (Weighted w t) where
   traverse f (Weighted twa) = Weighted <$> (traverse . traverse) f twa