summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-03-07 13:36:40 +0100
committertv <tv@krebsco.de>2026-03-07 13:36:40 +0100
commit96e42c2aba5e29fd795aa624a9f2ea992ec52c21 (patch)
tree32670bf8ad24689abb8421c98ff43dfa4d631e31
parenta2d987d58aabe0bf3e15315b2541ee6dfb309608 (diff)
add show
-rw-r--r--src/Blessings.hs5
-rw-r--r--src/Blessings/ByteString.hs3
-rw-r--r--src/Blessings/ByteString/Lazy.hs3
-rw-r--r--src/Blessings/Internal.hs2
-rw-r--r--src/Blessings/String.hs3
-rw-r--r--src/Blessings/String/WCWidth.hs3
-rw-r--r--src/Blessings/Text.hs3
-rw-r--r--src/Blessings/Text/WCWidth.hs3
8 files changed, 17 insertions, 8 deletions
diff --git a/src/Blessings.hs b/src/Blessings.hs
index ebf14e2..3d8a5c4 100644
--- a/src/Blessings.hs
+++ b/src/Blessings.hs
@@ -15,8 +15,7 @@ import Data.List (genericDrop)
import Data.String
import Data.Tuple.Extra (both, first, second)
import Data.Word (Word8)
-import qualified Prelude
-import Prelude hiding (drop, length, take)
+
type Ps = Word8
type Pm = [Ps]
@@ -454,6 +453,8 @@ instance (Eq a, Blessable a) => Blessable (Blessings a) where
fromWord8 = Plain . Bless.fromWord8
+ show = Plain . Bless.show
+
chunksOf :: (Eq a, Blessable a) => Int -> a -> [a]
chunksOf k = rec
diff --git a/src/Blessings/ByteString.hs b/src/Blessings/ByteString.hs
index 6c4ed76..4fe66cc 100644
--- a/src/Blessings/ByteString.hs
+++ b/src/Blessings/ByteString.hs
@@ -16,4 +16,5 @@ instance Blessable B.ByteString where
splitAt = B.splitAt
break = B.break
intercalate = B.intercalate
- fromWord8 = B.pack . show
+ fromWord8 = B.pack . Prelude.show
+ show = B.pack . Prelude.show
diff --git a/src/Blessings/ByteString/Lazy.hs b/src/Blessings/ByteString/Lazy.hs
index 79361b7..23394b5 100644
--- a/src/Blessings/ByteString/Lazy.hs
+++ b/src/Blessings/ByteString/Lazy.hs
@@ -16,4 +16,5 @@ instance Blessable L.ByteString where
splitAt = L.splitAt . fromIntegral
break = L.break
intercalate = L.intercalate
- fromWord8 = L.pack . show
+ fromWord8 = L.pack . Prelude.show
+ show = L.pack . Prelude.show
diff --git a/src/Blessings/Internal.hs b/src/Blessings/Internal.hs
index 7e5aeb1..62d8fd4 100644
--- a/src/Blessings/Internal.hs
+++ b/src/Blessings/Internal.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE ConstrainedClassMethods #-}
module Blessings.Internal where
import Data.String (IsString)
@@ -12,3 +13,4 @@ class (IsString a, Monoid a) => Blessable a where
break :: (Char -> Bool) -> a -> (a, a)
intercalate :: a -> [a] -> a
fromWord8 :: Word8 -> a
+ show :: Show x => x -> a
diff --git a/src/Blessings/String.hs b/src/Blessings/String.hs
index fa0f939..8dc6bcf 100644
--- a/src/Blessings/String.hs
+++ b/src/Blessings/String.hs
@@ -17,4 +17,5 @@ instance Blessable String where
splitAt = L.splitAt
break = L.break
intercalate = L.intercalate
- fromWord8 = show
+ fromWord8 = Prelude.show
+ show = Prelude.show
diff --git a/src/Blessings/String/WCWidth.hs b/src/Blessings/String/WCWidth.hs
index 7935019..16ab853 100644
--- a/src/Blessings/String/WCWidth.hs
+++ b/src/Blessings/String/WCWidth.hs
@@ -20,7 +20,8 @@ instance Blessable String where
splitAt = splitAt'
break = List.break
intercalate = List.intercalate
- fromWord8 = show
+ fromWord8 = Prelude.show
+ show = Prelude.show
length' :: String -> Int
diff --git a/src/Blessings/Text.hs b/src/Blessings/Text.hs
index 4516d72..04572dd 100644
--- a/src/Blessings/Text.hs
+++ b/src/Blessings/Text.hs
@@ -17,4 +17,5 @@ instance Blessable Text where
splitAt = T.splitAt
break = T.break
intercalate = T.intercalate
- fromWord8 = T.pack . show
+ fromWord8 = T.pack . Prelude.show
+ show = T.pack . Prelude.show
diff --git a/src/Blessings/Text/WCWidth.hs b/src/Blessings/Text/WCWidth.hs
index ccc0864..84e7cfa 100644
--- a/src/Blessings/Text/WCWidth.hs
+++ b/src/Blessings/Text/WCWidth.hs
@@ -20,7 +20,8 @@ instance Blessable Text where
splitAt = splitAt'
break = Text.break
intercalate = Text.intercalate
- fromWord8 = Text.pack . show
+ fromWord8 = Text.pack . Prelude.show
+ show = Text.pack . Prelude.show
length' :: Text -> Int