{-# LANGUAGE OverloadedStrings #-}
module TextShow.Utils (liftShowbUnaryWith, showbUnaryListWith) where
import TextShow (Builder, TextShow1(..), showbUnaryWith)
liftShowbUnaryWith :: TextShow1 m
=> (Int -> a -> Builder) -> ([a] -> Builder)
-> Builder -> Int -> m a -> Builder
liftShowbUnaryWith :: forall (m :: * -> *) a.
TextShow1 m =>
(Int -> a -> Builder)
-> ([a] -> Builder) -> Builder -> Int -> m a -> Builder
liftShowbUnaryWith Int -> a -> Builder
sp [a] -> Builder
sl = forall a. (Int -> a -> Builder) -> Builder -> Int -> a -> Builder
showbUnaryWith (forall (f :: * -> *) a.
TextShow1 f =>
(Int -> a -> Builder) -> ([a] -> Builder) -> Int -> f a -> Builder
liftShowbPrec Int -> a -> Builder
sp [a] -> Builder
sl)
{-# INLINE liftShowbUnaryWith #-}
showbUnaryListWith :: ([a] -> Builder) -> Int -> [a] -> Builder
showbUnaryListWith :: forall a. ([a] -> Builder) -> Int -> [a] -> Builder
showbUnaryListWith [a] -> Builder
sl Int
p = forall a. (Int -> a -> Builder) -> Builder -> Int -> a -> Builder
showbUnaryWith (forall a b. a -> b -> a
const [a] -> Builder
sl) Builder
"fromList" Int
p
{-# INLINE showbUnaryListWith #-}