From cc35609370ee94129af90cf4b14676b6b3dd48f2 Mon Sep 17 00:00:00 2001 From: Nikolaos Bezirgiannis Date: Thu, 7 Sep 2023 12:02:18 +0200 Subject: [PATCH] Added NoThunks instance for Identity --- CHANGELOG.md | 1 + src/NoThunks/Class.hs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eeb6362..6d6a689 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## next version * `NoThunks ThreadId` instance. +* `NoThunks Identity` instance * Fix tests on ghc 9.8. Andreas Abel * Tested with ghc 8.10 to 9.8. diff --git a/src/NoThunks/Class.hs b/src/NoThunks/Class.hs index e8e843a..443fabe 100644 --- a/src/NoThunks/Class.hs +++ b/src/NoThunks/Class.hs @@ -48,6 +48,7 @@ import GHC.Conc.Sync (ThreadId (..)) -- For instances import Data.Foldable (toList) +import Data.Functor.Identity (Identity) import Data.Int import Data.IntMap (IntMap) import Data.Kind (Type) @@ -638,6 +639,7 @@ instance NoThunks Void instance NoThunks () instance NoThunks a => NoThunks [a] +instance NoThunks a => NoThunks (Identity a) instance NoThunks a => NoThunks (Maybe a) instance NoThunks a => NoThunks (NonEmpty a)