From ffaba28677908d722247ddbb481d04d69fc99717 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Wed, 27 Mar 2019 09:03:49 -0400 Subject: [PATCH] Fix tests. --- src/Data/Flag.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Data/Flag.hs b/src/Data/Flag.hs index e74a5a00b..785d369cd 100644 --- a/src/Data/Flag.hs +++ b/src/Data/Flag.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE RankNTypes, KindSignatures #-} +{-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, RankNTypes, KindSignatures #-} -- | -- This technique is due to Oleg Grenrus: -- The implementation is clean-room due to unclear licensing of the original post. @@ -10,7 +10,7 @@ module Data.Flag , choose ) where -import Data.Coerce +import Prologue -- | To declare a new flag, declare a singly-inhabited type: -- @data MyFlag = MyFlag@ @@ -19,6 +19,8 @@ import Data.Coerce -- working with multiple flag values in flight, as the 'toBool' deconstructor provides a witness -- that you really want the given semantic flag value from the flag datum. newtype Flag (t :: *) = Flag Bool + deriving stock (Eq, Show) + deriving newtype NFData -- | The constructor for a 'Flag'. You specify @t@ with a visible type application. flag :: t -> Bool -> Flag t