Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 1a1bfc3

Browse files
committed
Generalize the Custom strategy over any Show-able type.
1 parent bb54b30 commit 1a1bfc3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Serializing/SExpression/Precise.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ instance (ToSExpressionWithStrategy strategy t, strategy ~ ToSExpressionStrategy
2020
toSExpression = toSExpressionWithStrategy @strategy undefined
2121

2222

23-
data Strategy = Generic | Custom
23+
data Strategy = Generic | Show
2424

2525
type family ToSExpressionStrategy t :: Strategy where
26-
ToSExpressionStrategy Text = 'Custom
26+
ToSExpressionStrategy Text = 'Show
2727
ToSExpressionStrategy _ = 'Generic
2828

2929
class ToSExpressionWithStrategy (strategy :: Strategy) t where
3030
toSExpressionWithStrategy :: proxy strategy -> t -> Int -> Builder
3131

32-
instance ToSExpressionWithStrategy 'Custom Text where
32+
instance Show t => ToSExpressionWithStrategy 'Show t where
3333
toSExpressionWithStrategy _ t _ = stringUtf8 (show t)
3434

3535
instance (Generic t, GToSExpression (Rep t)) => ToSExpressionWithStrategy 'Generic t where

0 commit comments

Comments
 (0)