Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 3.11.5
* Support `Generically` and `Generically1` from `base-4.17` (GHC 9.4) or later in addition to `FromGeneric` and `FromGeneric1`.

### 3.11.4 [2026.06.19]
* Make the test suite report source locations for test failures accurately.

Expand Down
1 change: 1 addition & 0 deletions src/TextShow.hs
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,6 @@ import Prelude ()

import TextShow.Classes
import TextShow.FromStringTextShow
import TextShow.Generic ()
import TextShow.Instances ()
import TextShow.Utils (toString, toText, lengthB, unlinesB, unwordsB)
20 changes: 20 additions & 0 deletions src/TextShow/Generic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@
{-# LANGUAGE UndecidableInstances #-}

#if __GLASGOW_HASKELL__ >= 806
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE QuantifiedConstraints #-}
#endif

{-# OPTIONS_GHC -Wno-orphans #-}
Comment thread
RyanGlScott marked this conversation as resolved.

{-|
Module: TextShow.Generic
Copyright: (C) 2014-2017 Ryan Scott
Expand Down Expand Up @@ -219,6 +222,23 @@ instance ( Generic1 f
) => TextShow1 (FromGeneric1 f) where
liftShowbPrec sp sl p = genericLiftShowbPrec sp sl p . fromGeneric1

#if MIN_VERSION_base(4,17,0)
-- | The 'TextShow' instance for 'Generically' behaves exactly like the instance for 'FromGeneric'.
--
-- /Since: 3.11.5/
deriving via FromGeneric a instance (Generic a, GTextShowB (Rep a ())) => TextShow (Generically a)

-- | The 'TextShow' instance for 'Generically1' behaves exactly like the instance for 'FromGeneric1'.
--
-- /Since: 3.11.5/
deriving via FromGeneric1 f a instance (Generic1 f, GTextShowB (Rep1 f a)) => TextShow (Generically1 f a)

-- | The 'TextShow1' instance for 'Generically1' behaves exactly like the instance for 'FromGeneric1'.
--
-- /Since: 3.11.5/
deriving via FromGeneric1 (f :: * -> *) instance (Generic1 f, GTextShowB1 (Rep1 f)) => TextShow1 (Generically1 f)
#endif

-- | A 'Generic' implementation of 'showt'.
--
-- /Since: 2/
Expand Down
Loading