From 99a2b0ba09f3fb3e88f9abd020cde3a03a6501a4 Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Wed, 20 May 2020 19:27:15 +0200 Subject: [PATCH] add instance deriving instructions --- src/Hash2Pub/FediChord.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Hash2Pub/FediChord.hs b/src/Hash2Pub/FediChord.hs index ca87945..fd26b6f 100644 --- a/src/Hash2Pub/FediChord.hs +++ b/src/Hash2Pub/FediChord.hs @@ -1,4 +1,5 @@ {-# LANGUAGE DataKinds #-} +{-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {- | @@ -84,7 +85,7 @@ idBits = 256 -- -- for being able to check value bounds, the constructor should not be used directly -- and new values are created via @toNodeID@ (newtype constructors cannot be hidden) -newtype NodeID = NodeID { getNodeID :: Integer } deriving (Eq, Show, Enum) +newtype NodeID = NodeID { getNodeID :: Integer } deriving stock (Show, Eq) deriving newtype Enum -- |smart data constructor for NodeID that throws a runtime exception for out-of-bounds values. -- When needing a runtime-safe constructor with drawbacks, try @fromInteger@