Skip to content

Commit bc52ded

Browse files
committed
Support Generically and Generically1.
1 parent 67e19a5 commit bc52ded

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### 3.11.5
2+
* Support `Generically` and `Generically1` from `base-4.17` (GHC 9.4) or later in addition to `FromGeneric` and `FromGeneric1`.
3+
14
### 3.11.4 [2026.06.19]
25
* Make the test suite report source locations for test failures accurately.
36

‎src/TextShow/Generic.hs‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@
2525
{-# LANGUAGE UndecidableInstances #-}
2626

2727
#if __GLASGOW_HASKELL__ >= 806
28+
{-# LANGUAGE DerivingVia #-}
2829
{-# LANGUAGE QuantifiedConstraints #-}
2930
#endif
3031

32+
{-# OPTIONS_GHC -Wno-orphans #-}
33+
3134
{-|
3235
Module: TextShow.Generic
3336
Copyright: (C) 2014-2017 Ryan Scott
@@ -219,6 +222,23 @@ instance ( Generic1 f
219222
) => TextShow1 (FromGeneric1 f) where
220223
liftShowbPrec sp sl p = genericLiftShowbPrec sp sl p . fromGeneric1
221224

225+
#if MIN_VERSION_base(4,17,0)
226+
-- | The 'TextShow' instance for 'Generically' behaves exactly like the instance for 'FromGeneric'.
227+
--
228+
-- /Since: 3.11.5/
229+
deriving via FromGeneric a instance (Generic a, GTextShowB (Rep a ())) => TextShow (Generically a)
230+
231+
-- | The 'TextShow' instance for 'Generically1' behaves exactly like the instance for 'FromGeneric1'.
232+
--
233+
-- /Since: 3.11.5/
234+
deriving via FromGeneric1 f a instance (Generic1 f, GTextShowB (Rep1 f a)) => TextShow (Generically1 f a)
235+
236+
-- | The 'TextShow1' instance for 'Generically1' behaves exactly like the instance for 'FromGeneric1'.
237+
--
238+
-- /Since: 3.11.5/
239+
deriving via FromGeneric1 (f :: * -> *) instance (Generic1 f, GTextShowB1 (Rep1 f)) => TextShow1 (Generically1 f)
240+
#endif
241+
222242
-- | A 'Generic' implementation of 'showt'.
223243
--
224244
-- /Since: 2/

0 commit comments

Comments
 (0)