summaryrefslogtreecommitdiffhomepage
path: root/Cost.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-07 00:35:59 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-07 00:35:59 -0400
commit2881564838b52658e4a2bf624b07ad5b54a0a42f (patch)
treee33f958aec192803c188441545fa6bfdcaa1d3e9 /Cost.hs
parent7890e78cc6e98fed07bc2ad471b527a2f1b1494f (diff)
downloadkeysafe-2881564838b52658e4a2bf624b07ad5b54a0a42f.tar.gz
num for entropy
Diffstat (limited to 'Cost.hs')
-rw-r--r--Cost.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/Cost.hs b/Cost.hs
index 5fd003f..99baa33 100644
--- a/Cost.hs
+++ b/Cost.hs
@@ -58,6 +58,7 @@ type CostCalc op t = Entropy t -> Cost op
-- | Number of bits of entropy
newtype Entropy t = Entropy Int
+ deriving (Num)
-- | Entropy can never go negative when subtracting bits from it.
reduceEntropy :: Entropy t -> Int -> Entropy t