-- |
-- Module      : Text.Show.Pragmatic
-- Copyright   : (c) Justus Sagemüller 2017
-- License     : GPL v3
-- 
-- Maintainer  : (@) jsagemue $ uni-koeln.de
-- Stability   : experimental
-- Portability : portable
-- 

{-# LANGUAGE CPP                  #-}
{-# LANGUAGE FlexibleInstances    #-}
{-# LANGUAGE FlexibleContexts     #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ScopedTypeVariables  #-}
{-# LANGUAGE UnicodeSyntax        #-}
{-# LANGUAGE GADTs                #-}
{-# LANGUAGE DeriveFunctor        #-}
{-# LANGUAGE DeriveFoldable       #-}
{-# LANGUAGE DeriveTraversable    #-}

#include "HsBaseConfig.h"

module Text.Show.Pragmatic (
       -- * Replacement for the standard class
         Show(..), print
       -- * Utility (unstable)
       , ltdPrecShowsPrec
       , showsPrecWithSharedPrecision
       , ShowMagnitudeRangeLimited(..)
       , PaddingMode(..)
       ) where

import Prelude hiding (Show(..), shows, print)
import qualified Prelude
import Data.Foldable (toList)
import Data.List (intersperse, minimumBy)
import Data.Ord (comparing)

import Data.Int (Int8, Int16, Int32, Int64)
import Data.Word (Word8, Word16, Word32, Word64)
import Data.Ratio
import Data.Complex (Complex((:+)), magnitude)
#if MIN_VERSION_base(4,8,0)
import Numeric.Natural (Natural)
#endif
#if MIN_VERSION_base(4,10,0)
import Type.Reflection (TyCon, SomeTypeRep, Module)
#endif
#if MIN_VERSION_base(4,9,0)
import GHC.Stack (SrcLoc, CallStack)
#endif
#if MIN_VERSION_base(3,0,0)
import Control.Exception.Base ( SomeException, ArithException, ErrorCall, IOException
                              , MaskingState
                              , ArrayException, AsyncException
#if MIN_VERSION_base(4,7,0)
                              , SomeAsyncException
#endif
                              , AssertionFailed
#if MIN_VERSION_base(4,10,0)
                              , CompactionFailed
#endif
#if MIN_VERSION_base(4,7,1)
                              , AllocationLimitExceeded
#endif
                              , Deadlock, BlockedIndefinitelyOnSTM
                              , BlockedIndefinitelyOnMVar
                              , NestedAtomically, NonTermination
#if MIN_VERSION_base(4,9,0)
                              , TypeError
#endif
                              , NoMethodError
                              , RecUpdError, RecConError, RecSelError, PatternMatchFail
                              )
#endif
import Data.Char (GeneralCategory)
import Text.Read.Lex (Number, Lexeme)
#if MIN_VERSION_base(4,7,0)
import GHC.Fingerprint.Type (Fingerprint)
#endif
import System.IO (IOMode)
import System.IO.Error (IOErrorType)
import System.Exit (ExitCode)
import Foreign.Ptr (IntPtr, WordPtr)
import Foreign.C.Types ( CUIntMax, CIntMax, CUIntPtr, CIntPtr
                       , CSUSeconds, CUSeconds, CTime, CClock
                       , CSigAtomic, CWchar, CSize, CPtrdiff
                       , CDouble, CFloat
#if MIN_VERSION_base(4,10,0)
                       , CBool
#endif
                       , CULLong, CLLong, CULong, CLong, CUInt, CInt, CUShort, CShort
                       , CUChar, CSChar, CChar
                       )
#if MIN_VERSION_base(4,10,0)
import GHC.TypeNats (SomeNat)
import GHC.TypeLits (SomeSymbol)
#endif
#if MIN_VERSION_base(4,9,0)
import GHC.Generics ( DecidedStrictness, SourceStrictness, SourceUnpackedness
                    , Associativity, Fixity )
#endif
import Data.Monoid (Any, All)
#if MIN_VERSION_base(4,4,0)
import GHC.IO.Encoding.Types (CodingProgress, TextEncoding)
import GHC.IO.Encoding.Failure (CodingFailureMode)
#endif
import GHC.IO.Device (SeekMode)
import GHC.IO.Handle (NewlineMode, Newline, BufferMode, Handle, HandlePosn)
#if MIN_VERSION_base(4,10,0)
import GHC.IO.Handle.Lock (FileLockingNotSupported)
#endif
#if MIN_VERSION_base(4,9,0)
import GHC.StaticPtr (StaticPtrInfo)
#endif
import System.Posix.Types ( Fd
#if MIN_VERSION_base(4,10,0)
#if defined(HTYPE_TIMER_T)
                          , CTimer
#endif
                          , CKey, CId, CFsFilCnt, CFsBlkCnt
#if defined(HTYPE_CLOCKID_T)
                          , CClockId
#endif
                          , CBlkCnt, CBlkSize
#endif
                          , CRLim, CTcflag, CSpeed, CCc, CUid
                          , CNlink, CGid, CSsize, CPid, COff, CMode, CIno, CDev )
#if MIN_VERSION_base(4,8,1)
import GHC.Event (Lifetime, Event, FdKey)
#endif
#if MIN_VERSION_base(2,1,0)
import Data.Dynamic (Dynamic)
#endif
import GHC.Conc (ThreadStatus, BlockReason)
import Control.Concurrent (ThreadId)
#if MIN_VERSION_base(4,8,0)
import Data.Version (Version)
#endif
#if MIN_VERSION_base(4,5,0)
import Data.Version (Version)
#endif
#if MIN_VERSION_base(4,10,0)
import GHC.Stats (RTSStats)
#endif
#if MIN_VERSION_base(4,9,0)
import GHC.RTS.Flags ( RTSFlags
#if MIN_VERSION_base(4,10,0)
                     , ParFlags
#endif
                     , TickyFlags, TraceFlags, DoTrace, ProfFlags
                     , DoHeapProfile, CCFlags, DoCostCentres, DebugFlags, MiscFlags
                     , ConcFlags, GCFlags, GiveGCStats )
#endif
import Data.Data ( Fixity, ConstrRep, DataRep
#if MIN_VERSION_base(4,0,0)
                 , Constr
#endif
                 , DataType )
#if MIN_VERSION_base(4,8,0)
import Data.Void
#endif

import qualified Data.Set as Set
import qualified Data.IntSet as ℤSet
import qualified Data.Map as Map
import qualified Data.IntMap as ℤMap
import qualified Data.Sequence as Seq
import qualified Data.Tree as Tree
import Data.Functor.Identity (Identity(..))


data PaddingMode = NoPadding
                 | PadLeftToAlign
                 | PadRightToAlign
                 | PadToConstantWidth

-- | A drop-in replacement for 'Prelude.Show'. The behaviour is mostly the same:
--   the result of 'show' should be valid Haskell code, and 'read'ing back such a
--   value should give the original value – but, unlike in 'Prelude.Show', we don't
--   require this in an /exact/ sense, i.e. @'read' ('show' x) == x@ is not necessarily
--   fulfilled.
--   
--   Notably for floating-point values, we allow a slight deviation if
--   it considerably shortens the shown representation: for example,
--   @0.90000004 :: Float@, which can easily come up as
--   the result of a computation which should in principle be exactly @0.9@, is shown
--   as @0.9@ instead. We do however /not/ commit to any particular fixed precision;
--   it depends on the type and the order of magnitude which amount of rounding is
--   appropriate. See <https://github.com/leftaroundabout/pragmatic-show/blob/master/test/tasty/test.hs the test suite> for some examples.
class Show a where
  {-# MINIMAL showsPrec | show | showEach #-}
  showsPrec :: Int -> a -> ShowS
  showsPrec Int
_ a
x = (a -> String
forall a. Show a => a -> String
show a
xString -> ShowS
forall a. [a] -> [a] -> [a]
++)
  show :: a -> String
  show = (a -> ShowS
forall a. Show a => a -> ShowS
`shows`String
"")
  showEach :: Traversable t
                => PaddingMode -- ^ Whether / how to ensure that e.g. decimal points line up.
                -> Int         -- ^ Precedence to use for showing each individual element
                -> t a         -- ^ List or other container of elements
                -> t ShowS     -- ^ Every element in the container shown, possibly with
                               --   shared processing like trimmed insignificant decimals
  showEach = PaddingMode -> Int -> t a -> t ShowS
forall a (t :: * -> *).
(Show a, Traversable t) =>
PaddingMode -> Int -> t a -> t ShowS
defaultShowEach
  showList :: [a] -> ShowS
  showList = [a] -> ShowS
forall a. Show a => [a] -> ShowS
defaultShowList

defaultAssembleListShow :: [ShowS] -> ShowS
defaultAssembleListShow :: [ShowS] -> ShowS
defaultAssembleListShow [] = (String
"[]"String -> ShowS
forall a. [a] -> [a] -> [a]
++)
defaultAssembleListShow (ShowS
x:[ShowS]
xs) = (Char
'['Char -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShowS
x ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String -> [ShowS] -> String) -> [ShowS] -> ShowS
forall a b c. (a -> b -> c) -> b -> a -> c
flip ((ShowS -> ShowS) -> String -> [ShowS] -> String
forall a b. (a -> b -> b) -> b -> [a] -> b
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr (\ShowS
y -> (Char
','Char -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShowS
y)) [ShowS]
xs ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char
']'Char -> ShowS
forall a. a -> [a] -> [a]
:)

defaultShowList :: Show a => [a] -> ShowS
defaultShowList :: forall a. Show a => [a] -> ShowS
defaultShowList = [ShowS] -> ShowS
defaultAssembleListShow ([ShowS] -> ShowS) -> ([a] -> [ShowS]) -> [a] -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PaddingMode -> Int -> [a] -> [ShowS]
forall a (t :: * -> *).
(Show a, Traversable t) =>
PaddingMode -> Int -> t a -> t ShowS
forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t a -> t ShowS
showEach PaddingMode
NoPadding Int
0

defaultShowEach :: (Show a, Traversable t) => PaddingMode -> Int -> t a -> t ShowS
defaultShowEach :: forall a (t :: * -> *).
(Show a, Traversable t) =>
PaddingMode -> Int -> t a -> t ShowS
defaultShowEach PaddingMode
PadToConstantWidth Int
p t a
l
          = (String -> ShowS) -> t String -> t ShowS
forall a b. (a -> b) -> t a -> t b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\String
r String
c -> String
r String -> ShowS
forall a. Semigroup a => a -> a -> a
<> Int -> Char -> String
forall a. Int -> a -> [a]
replicate (Int
totalWidth Int -> Int -> Int
forall a. Num a => a -> a -> a
- String -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length String
r) Char
' ' String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
c) t String
shown
 where totalWidth :: Int
totalWidth = t Int -> Int
forall a. Ord a => t a -> a
forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
maximum (t Int -> Int) -> t Int -> Int
forall a b. (a -> b) -> a -> b
$ String -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length(String -> Int) -> t String -> t Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>t String
shown
       shown :: t String
shown = (a -> String) -> t a -> t String
forall a b. (a -> b) -> t a -> t b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((ShowS -> ShowS
forall a b. (a -> b) -> a -> b
$ String
"") (ShowS -> String) -> (a -> ShowS) -> a -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> a -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
p) t a
l
defaultShowEach PaddingMode
_ Int
p t a
l = (a -> ShowS) -> t a -> t ShowS
forall a b. (a -> b) -> t a -> t b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (Int -> a -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
p) t a
l

shows :: Show a => a -> ShowS
shows :: forall a. Show a => a -> ShowS
shows = Identity ShowS -> ShowS
forall a. Identity a -> a
runIdentity (Identity ShowS -> ShowS) -> (a -> Identity ShowS) -> a -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PaddingMode -> Int -> Identity a -> Identity ShowS
forall a (t :: * -> *).
(Show a, Traversable t) =>
PaddingMode -> Int -> t a -> t ShowS
forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t a -> t ShowS
showEach PaddingMode
NoPadding Int
0 (Identity a -> Identity ShowS)
-> (a -> Identity a) -> a -> Identity ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Identity a
forall a. a -> Identity a
Identity

#define StdShow(A)             \
instance Show (A) where {       \
  show = Prelude.show;           \
  showsPrec = Prelude.showsPrec;  \
  showList = Prelude.showList }

StdShow(Bool)
StdShow(Int)
StdShow(Int8)
StdShow(Int16)
StdShow(Int32)
StdShow(Int64)
StdShow(Integer)

#if MIN_VERSION_base(4,8,0)
StdShow(Natural)
#endif

StdShow(Ordering)
StdShow(Word)
StdShow(Word8)
StdShow(Word16)
StdShow(Word32)
StdShow(Word64)

#if MIN_VERSION_base(4,9,0)
StdShow(CallStack)
#endif

#if MIN_VERSION_base(4,10,0)
StdShow(SomeTypeRep)
#endif

StdShow(())

#if MIN_VERSION_base(4,10,0)
StdShow(TyCon)
StdShow(Module)
#endif

#if MIN_VERSION_base(4,9,0)
StdShow(SrcLoc)
#endif

#if MIN_VERSION_base(3,0,0)
StdShow(SomeException)
#endif

StdShow(GeneralCategory)
StdShow(Number)
StdShow(Lexeme)

#if MIN_VERSION_base(4,7,0)
StdShow(Fingerprint)
#endif

StdShow(IOMode)
StdShow(IntPtr)
StdShow(WordPtr)
StdShow(CUIntMax)
StdShow(CIntMax)
StdShow(CUIntPtr)
StdShow(CIntPtr)
StdShow(CSUSeconds)
StdShow(CUSeconds)
StdShow(CTime)
StdShow(CClock)
StdShow(CSigAtomic)
StdShow(CWchar)
StdShow(CSize)
StdShow(CPtrdiff)

#if MIN_VERSION_base(4,10,0)
StdShow(CBool)
#endif

StdShow(CULLong)
StdShow(CLLong)
StdShow(CULong)
StdShow(CLong)
StdShow(CUInt)
StdShow(CInt)
StdShow(CUShort)
StdShow(CShort)
StdShow(CUChar)
StdShow(CSChar)
StdShow(CChar)

#if MIN_VERSION_base(4,10,0)
StdShow(SomeNat)
StdShow(SomeSymbol)
#endif

#if MIN_VERSION_base(4,9,0)
StdShow(DecidedStrictness)
StdShow(SourceStrictness)
StdShow(SourceUnpackedness)
StdShow(Associativity)
StdShow(GHC.Generics.Fixity)
#endif

StdShow(Any)
StdShow(All)

#if MIN_VERSION_base(4,0,0)
StdShow(ArithException)
StdShow(ErrorCall)
#endif

#if MIN_VERSION_base(4,1,0)
StdShow(IOException)
#endif

StdShow(MaskingState)

#if MIN_VERSION_base(4,4,0)
StdShow(CodingProgress)
#endif

#if MIN_VERSION_base(4,3,0)
StdShow(TextEncoding)
#endif

StdShow(SeekMode)
StdShow(NewlineMode)
StdShow(Newline)
StdShow(BufferMode)

#if MIN_VERSION_base(4,1,0)
StdShow(Handle)
StdShow(IOErrorType)
#endif

StdShow(ExitCode)

#if MIN_VERSION_base(4,1,0)
StdShow(ArrayException)
StdShow(AsyncException)
#endif

#if MIN_VERSION_base(4,7,0)
StdShow(SomeAsyncException)
#endif

#if MIN_VERSION_base(4,1,0)
StdShow(AssertionFailed)
#endif

#if MIN_VERSION_base(4,10,0)
StdShow(CompactionFailed)
#endif

#if MIN_VERSION_base(4,7,1)
StdShow(AllocationLimitExceeded)
#endif

#if MIN_VERSION_base(4,1,0)
StdShow(Deadlock)
StdShow(BlockedIndefinitelyOnSTM)
StdShow(BlockedIndefinitelyOnMVar)
StdShow(CodingFailureMode)
#endif

StdShow(Fd)

#if MIN_VERSION_base(4,10,0)
#if defined(HTYPE_TIMER_T)
StdShow(CTimer)
#endif
StdShow(CKey)
StdShow(CId)
StdShow(CFsFilCnt)
StdShow(CFsBlkCnt)
#if defined(HTYPE_CLOCKID_T)
StdShow(CClockId)
#endif
StdShow(CBlkCnt)
StdShow(CBlkSize)
#endif
StdShow(CRLim)
StdShow(CTcflag)
StdShow(CSpeed)
StdShow(CCc)
StdShow(CUid)
StdShow(CNlink)
StdShow(CGid)
StdShow(CSsize)
StdShow(CPid)
StdShow(COff)
StdShow(CMode)
StdShow(CIno)
StdShow(CDev)

#if MIN_VERSION_base(4,8,1)
StdShow(Lifetime)
StdShow(Event)
#endif

#if MIN_VERSION_base(2,1,0)
StdShow(Dynamic)
#endif

StdShow(ThreadStatus)
StdShow(BlockReason)

#if MIN_VERSION_base(4,2,0)
StdShow(ThreadId)
#endif

#if MIN_VERSION_base(4,0,0)
StdShow(NestedAtomically)
StdShow(NonTermination)
#endif

#if MIN_VERSION_base(4,9,0)
StdShow(TypeError)
#endif

#if MIN_VERSION_base(4,0,0)
StdShow(NoMethodError)
StdShow(RecUpdError)
StdShow(RecConError)
StdShow(RecSelError)
StdShow(PatternMatchFail)
#endif

StdShow(FdKey)
#if MIN_VERSION_base(4,10,0)
StdShow(FileLockingNotSupported)
#endif

#if MIN_VERSION_base(4,1,0)
StdShow(HandlePosn)
#endif

#if MIN_VERSION_base(4,8,0)
StdShow(Version)
#endif

#if MIN_VERSION_base(4,10,0)
StdShow(RTSStats)
StdShow(ParFlags)
#endif
#if MIN_VERSION_base(4,9,0)
StdShow(RTSFlags)
StdShow(TickyFlags)
StdShow(TraceFlags)
StdShow(DoTrace)
StdShow(ProfFlags)
StdShow(DoHeapProfile)
StdShow(CCFlags)
StdShow(DoCostCentres)
StdShow(DebugFlags)
StdShow(MiscFlags)
StdShow(ConcFlags)
StdShow(GCFlags)
StdShow(GiveGCStats)
#endif

StdShow(Data.Data.Fixity)
StdShow(ConstrRep)
StdShow(DataRep)

#if MIN_VERSION_base(4,0,0)
StdShow(Constr)
#endif

StdShow(DataType)

#if MIN_VERSION_base(4,9,0)
StdShow(StaticPtrInfo)
#endif

#if MIN_VERSION_base(4,8,0)
StdShow(Void)
#endif


instance Show Char where
  show :: Char -> String
show Char
c | Char
cChar -> Char -> Bool
forall a. Ord a => a -> a -> Bool
>Char
'\31', Char
cChar -> Char -> Bool
forall a. Eq a => a -> a -> Bool
/=Char
'\'', Char
cChar -> Char -> Bool
forall a. Eq a => a -> a -> Bool
/=Char
'\\'
                      = Char
'\''Char -> ShowS
forall a. a -> [a] -> [a]
:Char
cChar -> ShowS
forall a. a -> [a] -> [a]
:String
"'"
         | Bool
otherwise  = Char -> String
forall a. Show a => a -> String
Prelude.show Char
c
  showList :: String -> ShowS
showList String
cs = (Char
'"'Char -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String -> ShowS) -> String -> ShowS
forall a b c. (a -> b -> c) -> b -> a -> c
flip ((Char -> ShowS) -> String -> ShowS
forall a b. (a -> b -> b) -> b -> [a] -> b
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr Char -> ShowS
showc) String
cs ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char
'"'Char -> ShowS
forall a. a -> [a] -> [a]
:)
   where showc :: Char -> ShowS
showc Char
'"' = (String
"\\\""String -> ShowS
forall a. [a] -> [a] -> [a]
++)
         showc Char
'\\' = (String
"\\\\"String -> ShowS
forall a. [a] -> [a] -> [a]
++)
         showc Char
'\SO' = (String
"\\SO\\&"String -> ShowS
forall a. [a] -> [a] -> [a]
++)  -- prevent problem with "\SO\&H"≈[14,72] getting
                                      -- shown as "\SOH"≈[2]. (Thanks, QuickCheck!)
         showc Char
c | Char
cChar -> Char -> Bool
forall a. Ord a => a -> a -> Bool
>Char
'\31'    = (Char
cChar -> ShowS
forall a. a -> [a] -> [a]
:)
                 | Bool
otherwise  = case Char -> String
forall a. Show a => a -> String
show Char
c of
                     (Char
'\'':String
q) -> case (Char -> Bool) -> String -> (String, String)
forall a. (a -> Bool) -> [a] -> ([a], [a])
break (Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
==Char
'\'') String
q of
                       (String
r,String
"'") -> (String
rString -> ShowS
forall a. [a] -> [a] -> [a]
++)


class Show a => ShowMagnitudeRangeLimited a where
  showsPrecMagnitudeRangeLimited
          :: Int     -- ^ Precision of the data type
          -> Int     -- ^ Precedence of the showing context
          -> a       -- ^ Numerical value to show
          -> ShowS

instance Show Float where
  showsPrec :: Int -> Float -> ShowS
showsPrec = Int -> Int -> Float -> ShowS
forall n. RealFloat n => Int -> Int -> n -> ShowS
ltdPrecShowsPrec Int
7
  showEach :: forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t Float -> t ShowS
showEach = (Float -> Float) -> Int -> PaddingMode -> Int -> t Float -> t ShowS
forall n (list :: * -> *) sn.
(ShowMagnitudeRangeLimited n, RealFloat sn, Traversable list) =>
(n -> sn) -> Int -> PaddingMode -> Int -> list n -> list ShowS
showsPrecWithSharedPrecision Float -> Float
forall a. a -> a
id Int
7
instance ShowMagnitudeRangeLimited Float where
  showsPrecMagnitudeRangeLimited :: Int -> Int -> Float -> ShowS
showsPrecMagnitudeRangeLimited = Int -> Int -> Float -> ShowS
forall n. RealFloat n => Int -> Int -> n -> ShowS
ltdPrecShowsPrec

instance Show Double where
  showsPrec :: Int -> Double -> ShowS
showsPrec = Int -> Int -> Double -> ShowS
forall n. RealFloat n => Int -> Int -> n -> ShowS
ltdPrecShowsPrec Int
10
  showEach :: forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t Double -> t ShowS
showEach = (Double -> Double)
-> Int -> PaddingMode -> Int -> t Double -> t ShowS
forall n (list :: * -> *) sn.
(ShowMagnitudeRangeLimited n, RealFloat sn, Traversable list) =>
(n -> sn) -> Int -> PaddingMode -> Int -> list n -> list ShowS
showsPrecWithSharedPrecision Double -> Double
forall a. a -> a
id Int
10
instance ShowMagnitudeRangeLimited Double where
  showsPrecMagnitudeRangeLimited :: Int -> Int -> Double -> ShowS
showsPrecMagnitudeRangeLimited = Int -> Int -> Double -> ShowS
forall n. RealFloat n => Int -> Int -> n -> ShowS
ltdPrecShowsPrec

instance Show CFloat where
  showsPrec :: Int -> CFloat -> ShowS
showsPrec = Int -> Int -> CFloat -> ShowS
forall n. RealFloat n => Int -> Int -> n -> ShowS
ltdPrecShowsPrec Int
5
  showEach :: forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t CFloat -> t ShowS
showEach = (CFloat -> CFloat)
-> Int -> PaddingMode -> Int -> t CFloat -> t ShowS
forall n (list :: * -> *) sn.
(ShowMagnitudeRangeLimited n, RealFloat sn, Traversable list) =>
(n -> sn) -> Int -> PaddingMode -> Int -> list n -> list ShowS
showsPrecWithSharedPrecision CFloat -> CFloat
forall a. a -> a
id Int
5
instance ShowMagnitudeRangeLimited CFloat where
  showsPrecMagnitudeRangeLimited :: Int -> Int -> CFloat -> ShowS
showsPrecMagnitudeRangeLimited = Int -> Int -> CFloat -> ShowS
forall n. RealFloat n => Int -> Int -> n -> ShowS
ltdPrecShowsPrec

instance Show CDouble where
  showsPrec :: Int -> CDouble -> ShowS
showsPrec = Int -> Int -> CDouble -> ShowS
forall n. RealFloat n => Int -> Int -> n -> ShowS
ltdPrecShowsPrec Int
10
  showEach :: forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t CDouble -> t ShowS
showEach = (CDouble -> CDouble)
-> Int -> PaddingMode -> Int -> t CDouble -> t ShowS
forall n (list :: * -> *) sn.
(ShowMagnitudeRangeLimited n, RealFloat sn, Traversable list) =>
(n -> sn) -> Int -> PaddingMode -> Int -> list n -> list ShowS
showsPrecWithSharedPrecision CDouble -> CDouble
forall a. a -> a
id Int
10
instance ShowMagnitudeRangeLimited CDouble where
  showsPrecMagnitudeRangeLimited :: Int -> Int -> CDouble -> ShowS
showsPrecMagnitudeRangeLimited = Int -> Int -> CDouble -> ShowS
forall n. RealFloat n => Int -> Int -> n -> ShowS
ltdPrecShowsPrec

showsPrecWithSharedPrecision :: ∀ n list sn . (ShowMagnitudeRangeLimited n, RealFloat sn, Traversable list)
              => (n -> sn)   -- ^ Magnitude-function. Should be a norm.
              -> Int         -- ^ Precision of the type, in significant decimals. This will
                             --   be used to trim the length of all entries to match the
                             --   expected numerical uncertainty of the biggest one.
              -> PaddingMode -- ^ What to do to align decimal points
              -> Int         -- ^ Precedence of the enclosing context in which the values
                             --   are to be shown.
              -> list n      -- ^ Values to show
              -> list ShowS  -- ^ Individual values' string representation.
showsPrecWithSharedPrecision :: forall n (list :: * -> *) sn.
(ShowMagnitudeRangeLimited n, RealFloat sn, Traversable list) =>
(n -> sn) -> Int -> PaddingMode -> Int -> list n -> list ShowS
showsPrecWithSharedPrecision n -> sn
magnitudeFn Int
precision PaddingMode
padMode Int
p list n
vals
        = (case PaddingMode
padMode of
            PaddingMode
PadToConstantWidth -> \String
strn -> 
                  let lenStrn :: Int
lenStrn = String -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length String
strn
                  in (Int -> Char -> String
forall a. Int -> a -> [a]
replicate (Int
longestPaddedValLength Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
lenStrn) Char
' 'String -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String
strnString -> ShowS
forall a. [a] -> [a] -> [a]
++)
            PaddingMode
_ -> String -> ShowS
forall a. [a] -> [a] -> [a]
(++)
           ) (String -> ShowS) -> list String -> list ShowS
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> list String
paddedShownVals
 where shownVals :: list (n, String)
       shownVals :: list (n, String)
shownVals = (n -> (n, String)) -> list n -> list (n, String)
forall a b. (a -> b) -> list a -> list b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\n
val ->
              let uMagn :: sn
uMagn = sn -> sn
forall {t}. (Ord t, Floating t) => t -> t
usableMagnitude (sn -> sn) -> sn -> sn
forall a b. (a -> b) -> a -> b
$ n -> sn
magnitudeFn n
val
              in (n
val, Int -> Int -> n -> ShowS
forall a. ShowMagnitudeRangeLimited a => Int -> Int -> a -> ShowS
showsPrecMagnitudeRangeLimited
                   (Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 (Int -> Int) -> Int -> Int
forall a b. (a -> b) -> a -> b
$ Int
precision Int -> Int -> Int
forall a. Num a => a -> a -> a
- sn -> Int
forall b. Integral b => sn -> b
forall a b. (RealFrac a, Integral b) => a -> b
floor (sn
maxUMag sn -> sn -> sn
forall a. Num a => a -> a -> a
- sn
uMagn)) Int
p n
val String
"")
            ) list n
vals
       usableMagnitude :: t -> t
usableMagnitude t
n
        | t
nt -> t -> Bool
forall a. Ord a => a -> a -> Bool
<t
0            = t -> t
usableMagnitude (-t
n)
        | t
nt -> t -> Bool
forall a. Eq a => a -> a -> Bool
==t
n, t
2t -> t -> t
forall a. Num a => a -> a -> a
*t
nt -> t -> Bool
forall a. Ord a => a -> a -> Bool
>t
n    = t -> t -> t
forall a. Floating a => a -> a -> a
logBase t
10 t
n
        | Bool
otherwise      = -t
1t -> t -> t
forall a. Fractional a => a -> a -> a
/t
0    -- NaN or infinite values are disregarded
       maxUMag :: sn
maxUMag = list sn -> sn
forall a. Ord a => list a -> a
forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
maximum (list sn -> sn) -> list sn -> sn
forall a b. (a -> b) -> a -> b
$ sn -> sn
forall {t}. (Ord t, Floating t) => t -> t
usableMagnitude (sn -> sn) -> (n -> sn) -> n -> sn
forall b c a. (b -> c) -> (a -> b) -> a -> c
. n -> sn
magnitudeFn (n -> sn) -> list n -> list sn
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> list n
vals
       leftmostCharacterMagnitude :: (n, String) -> Int
       leftmostCharacterMagnitude :: (n, String) -> Int
leftmostCharacterMagnitude (n
_, String
"0") = Int
0
       leftmostCharacterMagnitude (n
n, (Char
'-':String
strn))
                     = Int
1 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (n, String) -> Int
leftmostCharacterMagnitude (n
n, (Char -> Bool) -> ShowS
forall a. (a -> Bool) -> [a] -> [a]
dropWhile (Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
==Char
'-') String
strn)
       leftmostCharacterMagnitude (n
n, Char
'.':String
strn)
                     = (n, String) -> Int
leftmostCharacterMagnitude (n
n, String
strn)
       leftmostCharacterMagnitude (n
n, Char
'0':String
strn)
                     = Int
1 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (n, String) -> Int
leftmostCharacterMagnitude (n
n, String
strn)
       leftmostCharacterMagnitude (n
n, String
strn) = sn -> Int
forall b. Integral b => sn -> b
forall a b. (RealFrac a, Integral b) => a -> b
floor (sn -> sn
forall {t}. (Ord t, Floating t) => t -> t
usableMagnitude (sn -> sn) -> sn -> sn
forall a b. (a -> b) -> a -> b
$ n -> sn
magnitudeFn n
n)
       leftmostColumnMagnitude, rightmostColumnMagnitude :: Int
       leftmostColumnMagnitude :: Int
leftmostColumnMagnitude = list Int -> Int
forall a. Ord a => list a -> a
forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
maximum (list Int -> Int) -> list Int -> Int
forall a b. (a -> b) -> a -> b
$ (n, String) -> Int
leftmostCharacterMagnitude ((n, String) -> Int) -> list (n, String) -> list Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> list (n, String)
shownVals
       rightmostColumnMagnitude :: Int
rightmostColumnMagnitude = Int
leftmostColumnMagnitude Int -> Int -> Int
forall a. Num a => a -> a -> a
- list Int -> Int
forall a. Ord a => list a -> a
forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
maximum (String -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> ((n, String) -> String) -> (n, String) -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (n, String) -> String
forall a b. (a, b) -> b
snd ((n, String) -> Int) -> list (n, String) -> list Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> list (n, String)
shownVals)
       administerPadding :: (n, String) -> String
       administerPadding :: (n, String) -> String
administerPadding (n
n,String
strn) = case PaddingMode
padMode of
          PaddingMode
NoPadding -> String
strn
          PaddingMode
PadLeftToAlign -> Int -> Char -> String
forall a. Int -> a -> [a]
replicate (Int
leftmostColumnMagnitude Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
lchm) Char
' ' String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
strn
          PaddingMode
_ -> String
strn String -> ShowS
forall a. [a] -> [a] -> [a]
++ Int -> Char -> String
forall a. Int -> a -> [a]
replicate (Int
rchm Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
rightmostColumnMagnitude) Char
' '
        where lchm, rchm :: Int
              lchm :: Int
lchm = (n, String) -> Int
leftmostCharacterMagnitude (n
n, String
strn)
              rchm :: Int
rchm = Int
lchm Int -> Int -> Int
forall a. Num a => a -> a -> a
- String -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length String
strn
       paddedShownVals :: list String
       paddedShownVals :: list String
paddedShownVals = (n, String) -> String
administerPadding ((n, String) -> String) -> list (n, String) -> list String
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> list (n, String)
shownVals
       longestPaddedValLength :: Int
longestPaddedValLength = list Int -> Int
forall a. Ord a => list a -> a
forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
maximum (list Int -> Int) -> list Int -> Int
forall a b. (a -> b) -> a -> b
$ String -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> list String -> list Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>list String
paddedShownVals

-- | @'ltdPrecShowsPrec' prcn@ displays floating-point values with a precision
--   of at least @prcn@ digits. That does not mean it will necessarily display
--   that many digits, rather it tries to always choose the shortest representation
--   with the required precision.
ltdPrecShowsPrec :: (RealFloat n)
          => Int     -- ^ Precision of the data type
          -> Int     -- ^ Precedence of the showing context
          -> n       -- ^ Numerical value to show
          -> ShowS
ltdPrecShowsPrec :: forall n. RealFloat n => Int -> Int -> n -> ShowS
ltdPrecShowsPrec Int
precision Int
p n
n String
cont
    = (String -> String -> Ordering) -> [String] -> String
forall (t :: * -> *) a.
Foldable t =>
(a -> a -> Ordering) -> t a -> a
minimumBy ((String -> Int) -> String -> String -> Ordering
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing String -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length)
        [ ShowS
postProc ShowS -> ShowS
forall a b. (a -> b) -> a -> b
$ Int -> Int -> n -> ShowS
forall n. RealFloat n => Int -> Int -> n -> ShowS
ltdPrecShowsPrecDecimal Int
precision Int
p' (n -> n
preProc n
n) String
""
        | (n -> n
preProc, Int
p', ShowS
postProc)
            <- [ (n -> n
forall a. a -> a
id, Int
p, ShowS
forall a. a -> a
id) ]
             [(n -> n, Int, ShowS)]
-> [(n -> n, Int, ShowS)] -> [(n -> n, Int, ShowS)]
forall a. [a] -> [a] -> [a]
++[ ( (n -> n -> n
forall a. Fractional a => a -> a -> a
/n
μ)
                 , Int
7, \String
s -> case String
s of
                        String
"1"   -> ShowS
sμ String
""
                        String
"(-1)"-> Bool -> ShowS -> ShowS
showParen (Int
pInt -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>=Int
6) ((Char
'-'Char -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShowS
sμ) String
""
                        String
_     -> Bool -> ShowS -> ShowS
showParen (Int
pInt -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>Int
7) ((String
sString -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char
'*'Char -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShowS
sμ) String
""
                 )
               | (n
μ,ShowS
sμ) <- (n
forall a. Floating a => a
pi, (String
"pi"String -> ShowS
forall a. [a] -> [a] -> [a]
++))
                          (n, ShowS) -> [(n, ShowS)] -> [(n, ShowS)]
forall a. a -> [a] -> [a]
:[ (n
forall a. Floating a => a
pi n -> n -> n
forall a. Fractional a => a -> a -> a
/ Int -> n
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
m, (String
"pi/"String -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> ShowS
forall a. Show a => a -> ShowS
shows Int
m)
                           | Int
m<-[Int
2,Int
3,Int
4 :: Int] ]
                         [(n, ShowS)] -> [(n, ShowS)] -> [(n, ShowS)]
forall a. [a] -> [a] -> [a]
++[ (n -> n
forall a. Floating a => a -> a
sqrt (n -> n) -> n -> n
forall a b. (a -> b) -> a -> b
$ Int -> n
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
n, (String
"sqrt "String -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> ShowS
forall a. Show a => a -> ShowS
shows Int
n)
                           | Int
n<-[Int
2,Int
3,Int
5 :: Int] ]
                         [(n, ShowS)] -> [(n, ShowS)] -> [(n, ShowS)]
forall a. [a] -> [a] -> [a]
++[ ( n -> n
forall a. Floating a => a -> a
sqrt (Int -> n
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
n)n -> n -> n
forall a. Fractional a => a -> a -> a
/Int -> n
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
m
                             , (String
"sqrt "String -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> ShowS
forall a. Show a => a -> ShowS
shows Int
n ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char
'/'Char -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> ShowS
forall a. Show a => a -> ShowS
shows Int
m)
                           | Int
n<-[Int
2,Int
3 :: Int]
                           , Int
m<-[Int
2,Int
3 :: Int] ]
               ]
             [(n -> n, Int, ShowS)]
-> [(n -> n, Int, ShowS)] -> [(n -> n, Int, ShowS)]
forall a. [a] -> [a] -> [a]
++[ ( (n -> n -> n
forall a. Num a => a -> a -> a
*Int -> n
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
n)
                 , Int
7, \String
s -> Bool -> ShowS -> ShowS
showParen (Int
pInt -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>Int
7) ((String
sString -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char
'/'Char -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> ShowS
forall a. Show a => a -> ShowS
shows Int
n) String
"" )
               | Int
n<-[Int
3,Int
7,Int
9 :: Int] ]
        ] String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
cont

ltdPrecShowsPrecDecimal :: (RealFloat n) => Int -> Int -> n -> ShowS
ltdPrecShowsPrecDecimal :: forall n. RealFloat n => Int -> Int -> n -> ShowS
ltdPrecShowsPrecDecimal Int
_ Int
_ n
0 = (String
"0"String -> ShowS
forall a. [a] -> [a] -> [a]
++)
ltdPrecShowsPrecDecimal Int
precision Int
p n
n
    | Bool -> Bool
not (n
nn -> n -> Bool
forall a. Eq a => a -> a -> Bool
==n
n)  = (String
"NaN"String -> ShowS
forall a. [a] -> [a] -> [a]
++)
    | n
nn -> n -> Bool
forall a. Ord a => a -> a -> Bool
<n
0         = Bool -> ShowS -> ShowS
showParen (Int
pInt -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>Int
5)
                      (ShowS -> ShowS) -> ShowS -> ShowS
forall a b. (a -> b) -> a -> b
$ (Char
'-'Char -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int -> n -> ShowS
forall n. RealFloat n => Int -> Int -> n -> ShowS
ltdPrecShowsPrecDecimal Int
precision Int
0 (n -> n
forall a. Num a => a -> a
negate n
n)
    | n
nn -> n -> Bool
forall a. Eq a => a -> a -> Bool
==n
nn -> n -> n
forall a. Num a => a -> a -> a
*n
2      = (String
"Infinity"String -> ShowS
forall a. [a] -> [a] -> [a]
++)
    | Int
e₁₀Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<Int
7 Bool -> Bool -> Bool
&& Int
lrDigs Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<= Int
e₁₀
                  = Int -> ShowS
forall a. Show a => a -> ShowS
shows (n -> Int
forall b. Integral b => n -> b
forall a b. (RealFrac a, Integral b) => a -> b
round n
n :: Int)
    | Int
e₁₀Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>Int
0 Bool -> Bool -> Bool
&& Int
e₁₀Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<Int
3
                  = (Int -> ShowS
forall a. Int -> [a] -> [a]
take Int
e₁₀ String
rDigitsString -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char
'.'Char -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> ShowS
forall a. Int -> [a] -> [a]
drop Int
e₁₀ String
rDigitsString -> ShowS
forall a. [a] -> [a] -> [a]
++)
    | Int
e₁₀Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> -Int
2 Bool -> Bool -> Bool
&& Int
e₁₀Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<=Int
0
                  = (String
"0."String -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Char -> String
forall a. Int -> a -> [a]
replicate (Int -> Int
forall a. Num a => a -> a
negate Int
e₁₀) Char
'0'String -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String
rDigitsString -> ShowS
forall a. [a] -> [a] -> [a]
++)
    | [Char
hd] <- String
rDigits
                  = (Char
hdChar -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String
"e"String -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> ShowS
forall a. Show a => a -> ShowS
shows (Int
e₁₀Int -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1)
    | (Char
hd:qd :: String
qd@(Char
_:String
_)) <- String
rDigits
                  = (Char
hdChar -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char
'.'Char -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String
qdString -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String
"e"String -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> ShowS
forall a. Show a => a -> ShowS
shows (Int
e₁₀Int -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1)
   where (Int
e₁₀,String
m₁₀Approx) = Int -> (Int, String)
correctPrecision (Int -> (Int, String)) -> (n -> Int) -> n -> (Int, String)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. n -> Int
forall b. Integral b => n -> b
forall a b. (RealFrac a, Integral b) => a -> b
ceiling (n -> (Int, String)) -> n -> (Int, String)
forall a b. (a -> b) -> a -> b
$ n -> n -> n
forall a. Floating a => a -> a -> a
logBase n
10 n
n
          where correctPrecision :: Int -> (Int, String)
correctPrecision Int
e
                 = case Int -> String
forall a. Show a => a -> String
show (n -> Int
forall b. Integral b => n -> b
forall a b. (RealFrac a, Integral b) => a -> b
round (n -> Int) -> n -> Int
forall a b. (a -> b) -> a -> b
$ n
n n -> n -> n
forall a. Num a => a -> a -> a
* n
10n -> Int -> n
forall a b. (Fractional a, Integral b) => a -> b -> a
^^(Int
precisionInt -> Int -> Int
forall a. Num a => a -> a -> a
+Int
2 Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
e) :: Int) of
                     String
digits | String -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length String
digits Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<= Int
precisionInt -> Int -> Int
forall a. Num a => a -> a -> a
+Int
2  -> (Int
e,String
digits)
                            | Bool
otherwise                     -> Int -> (Int, String)
correctPrecision (Int -> (Int, String)) -> Int -> (Int, String)
forall a b. (a -> b) -> a -> b
$ Int
eInt -> Int -> Int
forall a. Num a => a -> a -> a
+Int
1
         (String
rApprZeroes, String
rDigits') = (Char -> Bool) -> String -> (String, String)
forall a. (a -> Bool) -> [a] -> ([a], [a])
break (Char -> Char -> Bool
forall a. Ord a => a -> a -> Bool
>Char
'0') (String -> (String, String)) -> ShowS -> String -> (String, String)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShowS
forall a. [a] -> [a]
reverse (String -> (String, String)) -> String -> (String, String)
forall a b. (a -> b) -> a -> b
$ String
m₁₀Approx
         rDigits :: String
rDigits = ShowS
forall a. [a] -> [a]
reverse String
rDigits'
         lrDigs :: Int
lrDigs = String -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length String
rDigits

instance (Show a) => Show (Identity a) where
  showsPrec :: Int -> Identity a -> ShowS
showsPrec Int
p (Identity a
x) = Bool -> ShowS -> ShowS
showParen (Int
pInt -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>Int
9) (ShowS -> ShowS) -> ShowS -> ShowS
forall a b. (a -> b) -> a -> b
$ (String
"Identity "String -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> a -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
11 a
x

instance (Show a) => Show (Maybe a) where
  showsPrec :: Int -> Maybe a -> ShowS
showsPrec Int
_ Maybe a
Nothing = (String
"Nothing"String -> ShowS
forall a. [a] -> [a] -> [a]
++)
  showsPrec Int
p (Just a
x) = Bool -> ShowS -> ShowS
showParen (Int
pInt -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>Int
9) (ShowS -> ShowS) -> ShowS -> ShowS
forall a b. (a -> b) -> a -> b
$ (String
"Just "String -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> a -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
11 a
x

instance (Show a) => Show [a] where
  showsPrec :: Int -> [a] -> ShowS
showsPrec Int
_ = [a] -> ShowS
forall a. Show a => [a] -> ShowS
showList

instance (Show a, Ord a) => Show (Seq.Seq a) where
  showsPrec :: Int -> Seq a -> ShowS
showsPrec Int
_ = [a] -> ShowS
forall a. Show a => [a] -> ShowS
defaultShowList ([a] -> ShowS) -> (Seq a -> [a]) -> Seq a -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Seq a -> [a]
forall a. Seq a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList
instance (Show a, Ord a) => Show (Set.Set a) where
  showsPrec :: Int -> Set a -> ShowS
showsPrec Int
_ = [a] -> ShowS
forall a. Show a => [a] -> ShowS
defaultShowList ([a] -> ShowS) -> (Set a -> [a]) -> Set a -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Set a -> [a]
forall a. Set a -> [a]
Set.toList
instance Show ℤSet.IntSet where
  showsPrec :: Int -> IntSet -> ShowS
showsPrec Int
_ = [Int] -> ShowS
forall a. Show a => [a] -> ShowS
defaultShowList ([Int] -> ShowS) -> (IntSet -> [Int]) -> IntSet -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IntSet -> [Int]
ℤSet.toList
instance (Show a, Ord a, Show b) => Show (Map.Map a b) where
  showsPrec :: Int -> Map a b -> ShowS
showsPrec Int
_ = [(a, b)] -> ShowS
forall a. Show a => [a] -> ShowS
defaultShowList ([(a, b)] -> ShowS) -> (Map a b -> [(a, b)]) -> Map a b -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Map a b -> [(a, b)]
forall k a. Map k a -> [(k, a)]
Map.toList
instance (Show b) => Show (ℤMap.IntMap b) where
  showsPrec :: Int -> IntMap b -> ShowS
showsPrec Int
_ = [(Int, b)] -> ShowS
forall a. Show a => [a] -> ShowS
defaultShowList ([(Int, b)] -> ShowS)
-> (IntMap b -> [(Int, b)]) -> IntMap b -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IntMap b -> [(Int, b)]
forall a. IntMap a -> [(Int, a)]
ℤMap.toList
instance (Show a) => Show (Tree.Tree a) where
  showsPrec :: Int -> Tree a -> ShowS
showsPrec Int
p (Tree.Node a
a [Tree a]
st) = Bool -> ShowS -> ShowS
showParen (Int
pInt -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>Int
9)
                (ShowS -> ShowS) -> ShowS -> ShowS
forall a b. (a -> b) -> a -> b
$ (String
"Node "String -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> a -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
11 a
a ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char
' 'Char -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Tree a] -> ShowS
forall a. Show a => a -> ShowS
shows [Tree a]
st

data TraverseFirst t b a where
  TraverseFirst :: { forall (t :: * -> *) a b. TraverseFirst t b a -> t (a, b)
firstTraversed :: t (a,b) } -> TraverseFirst t b a
 deriving ((forall a b.
 (a -> b) -> TraverseFirst t b a -> TraverseFirst t b b)
-> (forall a b. a -> TraverseFirst t b b -> TraverseFirst t b a)
-> Functor (TraverseFirst t b)
forall a b. a -> TraverseFirst t b b -> TraverseFirst t b a
forall a b. (a -> b) -> TraverseFirst t b a -> TraverseFirst t b b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
forall (t :: * -> *) b a b.
Functor t =>
a -> TraverseFirst t b b -> TraverseFirst t b a
forall (t :: * -> *) b a b.
Functor t =>
(a -> b) -> TraverseFirst t b a -> TraverseFirst t b b
$cfmap :: forall (t :: * -> *) b a b.
Functor t =>
(a -> b) -> TraverseFirst t b a -> TraverseFirst t b b
fmap :: forall a b. (a -> b) -> TraverseFirst t b a -> TraverseFirst t b b
$c<$ :: forall (t :: * -> *) b a b.
Functor t =>
a -> TraverseFirst t b b -> TraverseFirst t b a
<$ :: forall a b. a -> TraverseFirst t b b -> TraverseFirst t b a
Functor, (forall m. Monoid m => TraverseFirst t b m -> m)
-> (forall m a. Monoid m => (a -> m) -> TraverseFirst t b a -> m)
-> (forall m a. Monoid m => (a -> m) -> TraverseFirst t b a -> m)
-> (forall a b. (a -> b -> b) -> b -> TraverseFirst t b a -> b)
-> (forall a b. (a -> b -> b) -> b -> TraverseFirst t b a -> b)
-> (forall b a. (b -> a -> b) -> b -> TraverseFirst t b a -> b)
-> (forall b a. (b -> a -> b) -> b -> TraverseFirst t b a -> b)
-> (forall a. (a -> a -> a) -> TraverseFirst t b a -> a)
-> (forall a. (a -> a -> a) -> TraverseFirst t b a -> a)
-> (forall a. TraverseFirst t b a -> [a])
-> (forall a. TraverseFirst t b a -> Bool)
-> (forall a. TraverseFirst t b a -> Int)
-> (forall a. Eq a => a -> TraverseFirst t b a -> Bool)
-> (forall a. Ord a => TraverseFirst t b a -> a)
-> (forall a. Ord a => TraverseFirst t b a -> a)
-> (forall a. Num a => TraverseFirst t b a -> a)
-> (forall a. Num a => TraverseFirst t b a -> a)
-> Foldable (TraverseFirst t b)
forall a. Eq a => a -> TraverseFirst t b a -> Bool
forall a. Num a => TraverseFirst t b a -> a
forall a. Ord a => TraverseFirst t b a -> a
forall m. Monoid m => TraverseFirst t b m -> m
forall a. TraverseFirst t b a -> Bool
forall a. TraverseFirst t b a -> Int
forall a. TraverseFirst t b a -> [a]
forall a. (a -> a -> a) -> TraverseFirst t b a -> a
forall m a. Monoid m => (a -> m) -> TraverseFirst t b a -> m
forall b a. (b -> a -> b) -> b -> TraverseFirst t b a -> b
forall a b. (a -> b -> b) -> b -> TraverseFirst t b a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
forall (t :: * -> *) b a.
(Foldable t, Eq a) =>
a -> TraverseFirst t b a -> Bool
forall (t :: * -> *) b a.
(Foldable t, Num a) =>
TraverseFirst t b a -> a
forall (t :: * -> *) b a.
(Foldable t, Ord a) =>
TraverseFirst t b a -> a
forall (t :: * -> *) b m.
(Foldable t, Monoid m) =>
TraverseFirst t b m -> m
forall (t :: * -> *) b a. Foldable t => TraverseFirst t b a -> Bool
forall (t :: * -> *) b a. Foldable t => TraverseFirst t b a -> Int
forall (t :: * -> *) b a. Foldable t => TraverseFirst t b a -> [a]
forall (t :: * -> *) b a.
Foldable t =>
(a -> a -> a) -> TraverseFirst t b a -> a
forall (t :: * -> *) b m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseFirst t b a -> m
forall (t :: * -> *) b b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseFirst t b a -> b
forall (t :: * -> *) b a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseFirst t b a -> b
$cfold :: forall (t :: * -> *) b m.
(Foldable t, Monoid m) =>
TraverseFirst t b m -> m
fold :: forall m. Monoid m => TraverseFirst t b m -> m
$cfoldMap :: forall (t :: * -> *) b m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseFirst t b a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> TraverseFirst t b a -> m
$cfoldMap' :: forall (t :: * -> *) b m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseFirst t b a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> TraverseFirst t b a -> m
$cfoldr :: forall (t :: * -> *) b a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseFirst t b a -> b
foldr :: forall a b. (a -> b -> b) -> b -> TraverseFirst t b a -> b
$cfoldr' :: forall (t :: * -> *) b a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseFirst t b a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> TraverseFirst t b a -> b
$cfoldl :: forall (t :: * -> *) b b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseFirst t b a -> b
foldl :: forall b a. (b -> a -> b) -> b -> TraverseFirst t b a -> b
$cfoldl' :: forall (t :: * -> *) b b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseFirst t b a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> TraverseFirst t b a -> b
$cfoldr1 :: forall (t :: * -> *) b a.
Foldable t =>
(a -> a -> a) -> TraverseFirst t b a -> a
foldr1 :: forall a. (a -> a -> a) -> TraverseFirst t b a -> a
$cfoldl1 :: forall (t :: * -> *) b a.
Foldable t =>
(a -> a -> a) -> TraverseFirst t b a -> a
foldl1 :: forall a. (a -> a -> a) -> TraverseFirst t b a -> a
$ctoList :: forall (t :: * -> *) b a. Foldable t => TraverseFirst t b a -> [a]
toList :: forall a. TraverseFirst t b a -> [a]
$cnull :: forall (t :: * -> *) b a. Foldable t => TraverseFirst t b a -> Bool
null :: forall a. TraverseFirst t b a -> Bool
$clength :: forall (t :: * -> *) b a. Foldable t => TraverseFirst t b a -> Int
length :: forall a. TraverseFirst t b a -> Int
$celem :: forall (t :: * -> *) b a.
(Foldable t, Eq a) =>
a -> TraverseFirst t b a -> Bool
elem :: forall a. Eq a => a -> TraverseFirst t b a -> Bool
$cmaximum :: forall (t :: * -> *) b a.
(Foldable t, Ord a) =>
TraverseFirst t b a -> a
maximum :: forall a. Ord a => TraverseFirst t b a -> a
$cminimum :: forall (t :: * -> *) b a.
(Foldable t, Ord a) =>
TraverseFirst t b a -> a
minimum :: forall a. Ord a => TraverseFirst t b a -> a
$csum :: forall (t :: * -> *) b a.
(Foldable t, Num a) =>
TraverseFirst t b a -> a
sum :: forall a. Num a => TraverseFirst t b a -> a
$cproduct :: forall (t :: * -> *) b a.
(Foldable t, Num a) =>
TraverseFirst t b a -> a
product :: forall a. Num a => TraverseFirst t b a -> a
Foldable, Functor (TraverseFirst t b)
Foldable (TraverseFirst t b)
(Functor (TraverseFirst t b), Foldable (TraverseFirst t b)) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> TraverseFirst t b a -> f (TraverseFirst t b b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    TraverseFirst t b (f a) -> f (TraverseFirst t b a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> TraverseFirst t b a -> m (TraverseFirst t b b))
-> (forall (m :: * -> *) a.
    Monad m =>
    TraverseFirst t b (m a) -> m (TraverseFirst t b a))
-> Traversable (TraverseFirst t b)
forall (t :: * -> *).
(Functor t, Foldable t) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
TraverseFirst t b (m a) -> m (TraverseFirst t b a)
forall (f :: * -> *) a.
Applicative f =>
TraverseFirst t b (f a) -> f (TraverseFirst t b a)
forall (t :: * -> *) b.
Traversable t =>
Functor (TraverseFirst t b)
forall (t :: * -> *) b.
Traversable t =>
Foldable (TraverseFirst t b)
forall (t :: * -> *) b (m :: * -> *) a.
(Traversable t, Monad m) =>
TraverseFirst t b (m a) -> m (TraverseFirst t b a)
forall (t :: * -> *) b (f :: * -> *) a.
(Traversable t, Applicative f) =>
TraverseFirst t b (f a) -> f (TraverseFirst t b a)
forall (t :: * -> *) b (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> TraverseFirst t b a -> m (TraverseFirst t b b)
forall (t :: * -> *) b (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> TraverseFirst t b a -> f (TraverseFirst t b b)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> TraverseFirst t b a -> m (TraverseFirst t b b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> TraverseFirst t b a -> f (TraverseFirst t b b)
$ctraverse :: forall (t :: * -> *) b (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> TraverseFirst t b a -> f (TraverseFirst t b b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> TraverseFirst t b a -> f (TraverseFirst t b b)
$csequenceA :: forall (t :: * -> *) b (f :: * -> *) a.
(Traversable t, Applicative f) =>
TraverseFirst t b (f a) -> f (TraverseFirst t b a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
TraverseFirst t b (f a) -> f (TraverseFirst t b a)
$cmapM :: forall (t :: * -> *) b (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> TraverseFirst t b a -> m (TraverseFirst t b b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> TraverseFirst t b a -> m (TraverseFirst t b b)
$csequence :: forall (t :: * -> *) b (m :: * -> *) a.
(Traversable t, Monad m) =>
TraverseFirst t b (m a) -> m (TraverseFirst t b a)
sequence :: forall (m :: * -> *) a.
Monad m =>
TraverseFirst t b (m a) -> m (TraverseFirst t b a)
Traversable)

data TraverseSecond t a b where
  TraverseSecond :: { forall (t :: * -> *) a b. TraverseSecond t a b -> t (a, b)
secondTraversed :: t (a,b) } -> TraverseSecond t a b
 deriving ((forall a b.
 (a -> b) -> TraverseSecond t a a -> TraverseSecond t a b)
-> (forall a b. a -> TraverseSecond t a b -> TraverseSecond t a a)
-> Functor (TraverseSecond t a)
forall a b. a -> TraverseSecond t a b -> TraverseSecond t a a
forall a b.
(a -> b) -> TraverseSecond t a a -> TraverseSecond t a b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
forall (t :: * -> *) a a b.
Functor t =>
a -> TraverseSecond t a b -> TraverseSecond t a a
forall (t :: * -> *) a a b.
Functor t =>
(a -> b) -> TraverseSecond t a a -> TraverseSecond t a b
$cfmap :: forall (t :: * -> *) a a b.
Functor t =>
(a -> b) -> TraverseSecond t a a -> TraverseSecond t a b
fmap :: forall a b.
(a -> b) -> TraverseSecond t a a -> TraverseSecond t a b
$c<$ :: forall (t :: * -> *) a a b.
Functor t =>
a -> TraverseSecond t a b -> TraverseSecond t a a
<$ :: forall a b. a -> TraverseSecond t a b -> TraverseSecond t a a
Functor, (forall m. Monoid m => TraverseSecond t a m -> m)
-> (forall m a. Monoid m => (a -> m) -> TraverseSecond t a a -> m)
-> (forall m a. Monoid m => (a -> m) -> TraverseSecond t a a -> m)
-> (forall a b. (a -> b -> b) -> b -> TraverseSecond t a a -> b)
-> (forall a b. (a -> b -> b) -> b -> TraverseSecond t a a -> b)
-> (forall b a. (b -> a -> b) -> b -> TraverseSecond t a a -> b)
-> (forall b a. (b -> a -> b) -> b -> TraverseSecond t a a -> b)
-> (forall a. (a -> a -> a) -> TraverseSecond t a a -> a)
-> (forall a. (a -> a -> a) -> TraverseSecond t a a -> a)
-> (forall a. TraverseSecond t a a -> [a])
-> (forall a. TraverseSecond t a a -> Bool)
-> (forall a. TraverseSecond t a a -> Int)
-> (forall a. Eq a => a -> TraverseSecond t a a -> Bool)
-> (forall a. Ord a => TraverseSecond t a a -> a)
-> (forall a. Ord a => TraverseSecond t a a -> a)
-> (forall a. Num a => TraverseSecond t a a -> a)
-> (forall a. Num a => TraverseSecond t a a -> a)
-> Foldable (TraverseSecond t a)
forall a. Eq a => a -> TraverseSecond t a a -> Bool
forall a. Num a => TraverseSecond t a a -> a
forall a. Ord a => TraverseSecond t a a -> a
forall m. Monoid m => TraverseSecond t a m -> m
forall a. TraverseSecond t a a -> Bool
forall a. TraverseSecond t a a -> Int
forall a. TraverseSecond t a a -> [a]
forall a. (a -> a -> a) -> TraverseSecond t a a -> a
forall m a. Monoid m => (a -> m) -> TraverseSecond t a a -> m
forall b a. (b -> a -> b) -> b -> TraverseSecond t a a -> b
forall a b. (a -> b -> b) -> b -> TraverseSecond t a a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
forall (t :: * -> *) a a.
(Foldable t, Eq a) =>
a -> TraverseSecond t a a -> Bool
forall (t :: * -> *) a a.
(Foldable t, Num a) =>
TraverseSecond t a a -> a
forall (t :: * -> *) a a.
(Foldable t, Ord a) =>
TraverseSecond t a a -> a
forall (t :: * -> *) a m.
(Foldable t, Monoid m) =>
TraverseSecond t a m -> m
forall (t :: * -> *) a a.
Foldable t =>
TraverseSecond t a a -> Bool
forall (t :: * -> *) a a. Foldable t => TraverseSecond t a a -> Int
forall (t :: * -> *) a a. Foldable t => TraverseSecond t a a -> [a]
forall (t :: * -> *) a a.
Foldable t =>
(a -> a -> a) -> TraverseSecond t a a -> a
forall (t :: * -> *) a m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseSecond t a a -> m
forall (t :: * -> *) a b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseSecond t a a -> b
forall (t :: * -> *) a a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseSecond t a a -> b
$cfold :: forall (t :: * -> *) a m.
(Foldable t, Monoid m) =>
TraverseSecond t a m -> m
fold :: forall m. Monoid m => TraverseSecond t a m -> m
$cfoldMap :: forall (t :: * -> *) a m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseSecond t a a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> TraverseSecond t a a -> m
$cfoldMap' :: forall (t :: * -> *) a m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseSecond t a a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> TraverseSecond t a a -> m
$cfoldr :: forall (t :: * -> *) a a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseSecond t a a -> b
foldr :: forall a b. (a -> b -> b) -> b -> TraverseSecond t a a -> b
$cfoldr' :: forall (t :: * -> *) a a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseSecond t a a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> TraverseSecond t a a -> b
$cfoldl :: forall (t :: * -> *) a b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseSecond t a a -> b
foldl :: forall b a. (b -> a -> b) -> b -> TraverseSecond t a a -> b
$cfoldl' :: forall (t :: * -> *) a b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseSecond t a a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> TraverseSecond t a a -> b
$cfoldr1 :: forall (t :: * -> *) a a.
Foldable t =>
(a -> a -> a) -> TraverseSecond t a a -> a
foldr1 :: forall a. (a -> a -> a) -> TraverseSecond t a a -> a
$cfoldl1 :: forall (t :: * -> *) a a.
Foldable t =>
(a -> a -> a) -> TraverseSecond t a a -> a
foldl1 :: forall a. (a -> a -> a) -> TraverseSecond t a a -> a
$ctoList :: forall (t :: * -> *) a a. Foldable t => TraverseSecond t a a -> [a]
toList :: forall a. TraverseSecond t a a -> [a]
$cnull :: forall (t :: * -> *) a a.
Foldable t =>
TraverseSecond t a a -> Bool
null :: forall a. TraverseSecond t a a -> Bool
$clength :: forall (t :: * -> *) a a. Foldable t => TraverseSecond t a a -> Int
length :: forall a. TraverseSecond t a a -> Int
$celem :: forall (t :: * -> *) a a.
(Foldable t, Eq a) =>
a -> TraverseSecond t a a -> Bool
elem :: forall a. Eq a => a -> TraverseSecond t a a -> Bool
$cmaximum :: forall (t :: * -> *) a a.
(Foldable t, Ord a) =>
TraverseSecond t a a -> a
maximum :: forall a. Ord a => TraverseSecond t a a -> a
$cminimum :: forall (t :: * -> *) a a.
(Foldable t, Ord a) =>
TraverseSecond t a a -> a
minimum :: forall a. Ord a => TraverseSecond t a a -> a
$csum :: forall (t :: * -> *) a a.
(Foldable t, Num a) =>
TraverseSecond t a a -> a
sum :: forall a. Num a => TraverseSecond t a a -> a
$cproduct :: forall (t :: * -> *) a a.
(Foldable t, Num a) =>
TraverseSecond t a a -> a
product :: forall a. Num a => TraverseSecond t a a -> a
Foldable, Functor (TraverseSecond t a)
Foldable (TraverseSecond t a)
(Functor (TraverseSecond t a), Foldable (TraverseSecond t a)) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> TraverseSecond t a a -> f (TraverseSecond t a b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    TraverseSecond t a (f a) -> f (TraverseSecond t a a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> TraverseSecond t a a -> m (TraverseSecond t a b))
-> (forall (m :: * -> *) a.
    Monad m =>
    TraverseSecond t a (m a) -> m (TraverseSecond t a a))
-> Traversable (TraverseSecond t a)
forall (t :: * -> *).
(Functor t, Foldable t) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
TraverseSecond t a (m a) -> m (TraverseSecond t a a)
forall (f :: * -> *) a.
Applicative f =>
TraverseSecond t a (f a) -> f (TraverseSecond t a a)
forall (t :: * -> *) a.
Traversable t =>
Functor (TraverseSecond t a)
forall (t :: * -> *) a.
Traversable t =>
Foldable (TraverseSecond t a)
forall (t :: * -> *) a (m :: * -> *) a.
(Traversable t, Monad m) =>
TraverseSecond t a (m a) -> m (TraverseSecond t a a)
forall (t :: * -> *) a (f :: * -> *) a.
(Traversable t, Applicative f) =>
TraverseSecond t a (f a) -> f (TraverseSecond t a a)
forall (t :: * -> *) a (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> TraverseSecond t a a -> m (TraverseSecond t a b)
forall (t :: * -> *) a (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> TraverseSecond t a a -> f (TraverseSecond t a b)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> TraverseSecond t a a -> m (TraverseSecond t a b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> TraverseSecond t a a -> f (TraverseSecond t a b)
$ctraverse :: forall (t :: * -> *) a (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> TraverseSecond t a a -> f (TraverseSecond t a b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> TraverseSecond t a a -> f (TraverseSecond t a b)
$csequenceA :: forall (t :: * -> *) a (f :: * -> *) a.
(Traversable t, Applicative f) =>
TraverseSecond t a (f a) -> f (TraverseSecond t a a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
TraverseSecond t a (f a) -> f (TraverseSecond t a a)
$cmapM :: forall (t :: * -> *) a (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> TraverseSecond t a a -> m (TraverseSecond t a b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> TraverseSecond t a a -> m (TraverseSecond t a b)
$csequence :: forall (t :: * -> *) a (m :: * -> *) a.
(Traversable t, Monad m) =>
TraverseSecond t a (m a) -> m (TraverseSecond t a a)
sequence :: forall (m :: * -> *) a.
Monad m =>
TraverseSecond t a (m a) -> m (TraverseSecond t a a)
Traversable)

instance (Show a, Show b) => Show (a,b) where
  showEach :: forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t (a, b) -> t ShowS
showEach PaddingMode
padMode Int
_
         = ((ShowS, ShowS) -> ShowS) -> t (ShowS, ShowS) -> t ShowS
forall a b. (a -> b) -> t a -> t b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\(ShowS
sa,ShowS
sb) -> (Char
'('Char -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShowS
sa ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char
','Char -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShowS
sb ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char
')'Char -> ShowS
forall a. a -> [a] -> [a]
:))
             (t (ShowS, ShowS) -> t ShowS)
-> (t (a, b) -> t (ShowS, ShowS)) -> t (a, b) -> t ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.  TraverseFirst t ShowS ShowS -> t (ShowS, ShowS)
forall (t :: * -> *) a b. TraverseFirst t b a -> t (a, b)
firstTraversed (TraverseFirst t ShowS ShowS -> t (ShowS, ShowS))
-> (t (a, b) -> TraverseFirst t ShowS ShowS)
-> t (a, b)
-> t (ShowS, ShowS)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PaddingMode
-> Int -> TraverseFirst t ShowS a -> TraverseFirst t ShowS ShowS
forall a (t :: * -> *).
(Show a, Traversable t) =>
PaddingMode -> Int -> t a -> t ShowS
forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t a -> t ShowS
showEach PaddingMode
padMode Int
0 (TraverseFirst t ShowS a -> TraverseFirst t ShowS ShowS)
-> (t (a, b) -> TraverseFirst t ShowS a)
-> t (a, b)
-> TraverseFirst t ShowS ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. t (a, ShowS) -> TraverseFirst t ShowS a
forall (t :: * -> *) a b. t (a, b) -> TraverseFirst t b a
TraverseFirst
             (t (a, ShowS) -> TraverseFirst t ShowS a)
-> (t (a, b) -> t (a, ShowS))
-> t (a, b)
-> TraverseFirst t ShowS a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TraverseSecond t a ShowS -> t (a, ShowS)
forall (t :: * -> *) a b. TraverseSecond t a b -> t (a, b)
secondTraversed (TraverseSecond t a ShowS -> t (a, ShowS))
-> (t (a, b) -> TraverseSecond t a ShowS)
-> t (a, b)
-> t (a, ShowS)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PaddingMode
-> Int -> TraverseSecond t a b -> TraverseSecond t a ShowS
forall a (t :: * -> *).
(Show a, Traversable t) =>
PaddingMode -> Int -> t a -> t ShowS
forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t b -> t ShowS
showEach PaddingMode
padMode Int
0 (TraverseSecond t a b -> TraverseSecond t a ShowS)
-> (t (a, b) -> TraverseSecond t a b)
-> t (a, b)
-> TraverseSecond t a ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. t (a, b) -> TraverseSecond t a b
forall (t :: * -> *) a b. t (a, b) -> TraverseSecond t a b
TraverseSecond

data TraverseFirstOf3 t b c a where
  TraverseFirstOf3 :: { forall (t :: * -> *) a b c. TraverseFirstOf3 t b c a -> t (a, b, c)
firstOf3Traversed :: t (a,b,c) } -> TraverseFirstOf3 t b c a
 deriving ((forall a b.
 (a -> b) -> TraverseFirstOf3 t b c a -> TraverseFirstOf3 t b c b)
-> (forall a b.
    a -> TraverseFirstOf3 t b c b -> TraverseFirstOf3 t b c a)
-> Functor (TraverseFirstOf3 t b c)
forall a b.
a -> TraverseFirstOf3 t b c b -> TraverseFirstOf3 t b c a
forall a b.
(a -> b) -> TraverseFirstOf3 t b c a -> TraverseFirstOf3 t b c b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
forall (t :: * -> *) b c a b.
Functor t =>
a -> TraverseFirstOf3 t b c b -> TraverseFirstOf3 t b c a
forall (t :: * -> *) b c a b.
Functor t =>
(a -> b) -> TraverseFirstOf3 t b c a -> TraverseFirstOf3 t b c b
$cfmap :: forall (t :: * -> *) b c a b.
Functor t =>
(a -> b) -> TraverseFirstOf3 t b c a -> TraverseFirstOf3 t b c b
fmap :: forall a b.
(a -> b) -> TraverseFirstOf3 t b c a -> TraverseFirstOf3 t b c b
$c<$ :: forall (t :: * -> *) b c a b.
Functor t =>
a -> TraverseFirstOf3 t b c b -> TraverseFirstOf3 t b c a
<$ :: forall a b.
a -> TraverseFirstOf3 t b c b -> TraverseFirstOf3 t b c a
Functor, (forall m. Monoid m => TraverseFirstOf3 t b c m -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> TraverseFirstOf3 t b c a -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> TraverseFirstOf3 t b c a -> m)
-> (forall a b.
    (a -> b -> b) -> b -> TraverseFirstOf3 t b c a -> b)
-> (forall a b.
    (a -> b -> b) -> b -> TraverseFirstOf3 t b c a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> TraverseFirstOf3 t b c a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> TraverseFirstOf3 t b c a -> b)
-> (forall a. (a -> a -> a) -> TraverseFirstOf3 t b c a -> a)
-> (forall a. (a -> a -> a) -> TraverseFirstOf3 t b c a -> a)
-> (forall a. TraverseFirstOf3 t b c a -> [a])
-> (forall a. TraverseFirstOf3 t b c a -> Bool)
-> (forall a. TraverseFirstOf3 t b c a -> Int)
-> (forall a. Eq a => a -> TraverseFirstOf3 t b c a -> Bool)
-> (forall a. Ord a => TraverseFirstOf3 t b c a -> a)
-> (forall a. Ord a => TraverseFirstOf3 t b c a -> a)
-> (forall a. Num a => TraverseFirstOf3 t b c a -> a)
-> (forall a. Num a => TraverseFirstOf3 t b c a -> a)
-> Foldable (TraverseFirstOf3 t b c)
forall a. Eq a => a -> TraverseFirstOf3 t b c a -> Bool
forall a. Num a => TraverseFirstOf3 t b c a -> a
forall a. Ord a => TraverseFirstOf3 t b c a -> a
forall m. Monoid m => TraverseFirstOf3 t b c m -> m
forall a. TraverseFirstOf3 t b c a -> Bool
forall a. TraverseFirstOf3 t b c a -> Int
forall a. TraverseFirstOf3 t b c a -> [a]
forall a. (a -> a -> a) -> TraverseFirstOf3 t b c a -> a
forall m a. Monoid m => (a -> m) -> TraverseFirstOf3 t b c a -> m
forall b a. (b -> a -> b) -> b -> TraverseFirstOf3 t b c a -> b
forall a b. (a -> b -> b) -> b -> TraverseFirstOf3 t b c a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
forall (t :: * -> *) b c a.
(Foldable t, Eq a) =>
a -> TraverseFirstOf3 t b c a -> Bool
forall (t :: * -> *) b c a.
(Foldable t, Num a) =>
TraverseFirstOf3 t b c a -> a
forall (t :: * -> *) b c a.
(Foldable t, Ord a) =>
TraverseFirstOf3 t b c a -> a
forall (t :: * -> *) b c m.
(Foldable t, Monoid m) =>
TraverseFirstOf3 t b c m -> m
forall (t :: * -> *) b c a.
Foldable t =>
TraverseFirstOf3 t b c a -> Bool
forall (t :: * -> *) b c a.
Foldable t =>
TraverseFirstOf3 t b c a -> Int
forall (t :: * -> *) b c a.
Foldable t =>
TraverseFirstOf3 t b c a -> [a]
forall (t :: * -> *) b c a.
Foldable t =>
(a -> a -> a) -> TraverseFirstOf3 t b c a -> a
forall (t :: * -> *) b c m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseFirstOf3 t b c a -> m
forall (t :: * -> *) b c b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseFirstOf3 t b c a -> b
forall (t :: * -> *) b c a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseFirstOf3 t b c a -> b
$cfold :: forall (t :: * -> *) b c m.
(Foldable t, Monoid m) =>
TraverseFirstOf3 t b c m -> m
fold :: forall m. Monoid m => TraverseFirstOf3 t b c m -> m
$cfoldMap :: forall (t :: * -> *) b c m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseFirstOf3 t b c a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> TraverseFirstOf3 t b c a -> m
$cfoldMap' :: forall (t :: * -> *) b c m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseFirstOf3 t b c a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> TraverseFirstOf3 t b c a -> m
$cfoldr :: forall (t :: * -> *) b c a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseFirstOf3 t b c a -> b
foldr :: forall a b. (a -> b -> b) -> b -> TraverseFirstOf3 t b c a -> b
$cfoldr' :: forall (t :: * -> *) b c a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseFirstOf3 t b c a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> TraverseFirstOf3 t b c a -> b
$cfoldl :: forall (t :: * -> *) b c b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseFirstOf3 t b c a -> b
foldl :: forall b a. (b -> a -> b) -> b -> TraverseFirstOf3 t b c a -> b
$cfoldl' :: forall (t :: * -> *) b c b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseFirstOf3 t b c a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> TraverseFirstOf3 t b c a -> b
$cfoldr1 :: forall (t :: * -> *) b c a.
Foldable t =>
(a -> a -> a) -> TraverseFirstOf3 t b c a -> a
foldr1 :: forall a. (a -> a -> a) -> TraverseFirstOf3 t b c a -> a
$cfoldl1 :: forall (t :: * -> *) b c a.
Foldable t =>
(a -> a -> a) -> TraverseFirstOf3 t b c a -> a
foldl1 :: forall a. (a -> a -> a) -> TraverseFirstOf3 t b c a -> a
$ctoList :: forall (t :: * -> *) b c a.
Foldable t =>
TraverseFirstOf3 t b c a -> [a]
toList :: forall a. TraverseFirstOf3 t b c a -> [a]
$cnull :: forall (t :: * -> *) b c a.
Foldable t =>
TraverseFirstOf3 t b c a -> Bool
null :: forall a. TraverseFirstOf3 t b c a -> Bool
$clength :: forall (t :: * -> *) b c a.
Foldable t =>
TraverseFirstOf3 t b c a -> Int
length :: forall a. TraverseFirstOf3 t b c a -> Int
$celem :: forall (t :: * -> *) b c a.
(Foldable t, Eq a) =>
a -> TraverseFirstOf3 t b c a -> Bool
elem :: forall a. Eq a => a -> TraverseFirstOf3 t b c a -> Bool
$cmaximum :: forall (t :: * -> *) b c a.
(Foldable t, Ord a) =>
TraverseFirstOf3 t b c a -> a
maximum :: forall a. Ord a => TraverseFirstOf3 t b c a -> a
$cminimum :: forall (t :: * -> *) b c a.
(Foldable t, Ord a) =>
TraverseFirstOf3 t b c a -> a
minimum :: forall a. Ord a => TraverseFirstOf3 t b c a -> a
$csum :: forall (t :: * -> *) b c a.
(Foldable t, Num a) =>
TraverseFirstOf3 t b c a -> a
sum :: forall a. Num a => TraverseFirstOf3 t b c a -> a
$cproduct :: forall (t :: * -> *) b c a.
(Foldable t, Num a) =>
TraverseFirstOf3 t b c a -> a
product :: forall a. Num a => TraverseFirstOf3 t b c a -> a
Foldable, Functor (TraverseFirstOf3 t b c)
Foldable (TraverseFirstOf3 t b c)
(Functor (TraverseFirstOf3 t b c),
 Foldable (TraverseFirstOf3 t b c)) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b)
 -> TraverseFirstOf3 t b c a -> f (TraverseFirstOf3 t b c b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    TraverseFirstOf3 t b c (f a) -> f (TraverseFirstOf3 t b c a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> TraverseFirstOf3 t b c a -> m (TraverseFirstOf3 t b c b))
-> (forall (m :: * -> *) a.
    Monad m =>
    TraverseFirstOf3 t b c (m a) -> m (TraverseFirstOf3 t b c a))
-> Traversable (TraverseFirstOf3 t b c)
forall (t :: * -> *).
(Functor t, Foldable t) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
TraverseFirstOf3 t b c (m a) -> m (TraverseFirstOf3 t b c a)
forall (f :: * -> *) a.
Applicative f =>
TraverseFirstOf3 t b c (f a) -> f (TraverseFirstOf3 t b c a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> TraverseFirstOf3 t b c a -> m (TraverseFirstOf3 t b c b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> TraverseFirstOf3 t b c a -> f (TraverseFirstOf3 t b c b)
forall (t :: * -> *) b c.
Traversable t =>
Functor (TraverseFirstOf3 t b c)
forall (t :: * -> *) b c.
Traversable t =>
Foldable (TraverseFirstOf3 t b c)
forall (t :: * -> *) b c (m :: * -> *) a.
(Traversable t, Monad m) =>
TraverseFirstOf3 t b c (m a) -> m (TraverseFirstOf3 t b c a)
forall (t :: * -> *) b c (f :: * -> *) a.
(Traversable t, Applicative f) =>
TraverseFirstOf3 t b c (f a) -> f (TraverseFirstOf3 t b c a)
forall (t :: * -> *) b c (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b)
-> TraverseFirstOf3 t b c a -> m (TraverseFirstOf3 t b c b)
forall (t :: * -> *) b c (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b)
-> TraverseFirstOf3 t b c a -> f (TraverseFirstOf3 t b c b)
$ctraverse :: forall (t :: * -> *) b c (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b)
-> TraverseFirstOf3 t b c a -> f (TraverseFirstOf3 t b c b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> TraverseFirstOf3 t b c a -> f (TraverseFirstOf3 t b c b)
$csequenceA :: forall (t :: * -> *) b c (f :: * -> *) a.
(Traversable t, Applicative f) =>
TraverseFirstOf3 t b c (f a) -> f (TraverseFirstOf3 t b c a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
TraverseFirstOf3 t b c (f a) -> f (TraverseFirstOf3 t b c a)
$cmapM :: forall (t :: * -> *) b c (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b)
-> TraverseFirstOf3 t b c a -> m (TraverseFirstOf3 t b c b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> TraverseFirstOf3 t b c a -> m (TraverseFirstOf3 t b c b)
$csequence :: forall (t :: * -> *) b c (m :: * -> *) a.
(Traversable t, Monad m) =>
TraverseFirstOf3 t b c (m a) -> m (TraverseFirstOf3 t b c a)
sequence :: forall (m :: * -> *) a.
Monad m =>
TraverseFirstOf3 t b c (m a) -> m (TraverseFirstOf3 t b c a)
Traversable)

data TraverseSecondOf3 t a c b where
  TraverseSecondOf3 :: { forall (t :: * -> *) a b c.
TraverseSecondOf3 t a c b -> t (a, b, c)
secondOf3Traversed :: t (a,b,c) } -> TraverseSecondOf3 t a c b
 deriving ((forall a b.
 (a -> b) -> TraverseSecondOf3 t a c a -> TraverseSecondOf3 t a c b)
-> (forall a b.
    a -> TraverseSecondOf3 t a c b -> TraverseSecondOf3 t a c a)
-> Functor (TraverseSecondOf3 t a c)
forall a b.
a -> TraverseSecondOf3 t a c b -> TraverseSecondOf3 t a c a
forall a b.
(a -> b) -> TraverseSecondOf3 t a c a -> TraverseSecondOf3 t a c b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
forall (t :: * -> *) a c a b.
Functor t =>
a -> TraverseSecondOf3 t a c b -> TraverseSecondOf3 t a c a
forall (t :: * -> *) a c a b.
Functor t =>
(a -> b) -> TraverseSecondOf3 t a c a -> TraverseSecondOf3 t a c b
$cfmap :: forall (t :: * -> *) a c a b.
Functor t =>
(a -> b) -> TraverseSecondOf3 t a c a -> TraverseSecondOf3 t a c b
fmap :: forall a b.
(a -> b) -> TraverseSecondOf3 t a c a -> TraverseSecondOf3 t a c b
$c<$ :: forall (t :: * -> *) a c a b.
Functor t =>
a -> TraverseSecondOf3 t a c b -> TraverseSecondOf3 t a c a
<$ :: forall a b.
a -> TraverseSecondOf3 t a c b -> TraverseSecondOf3 t a c a
Functor, (forall m. Monoid m => TraverseSecondOf3 t a c m -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> TraverseSecondOf3 t a c a -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> TraverseSecondOf3 t a c a -> m)
-> (forall a b.
    (a -> b -> b) -> b -> TraverseSecondOf3 t a c a -> b)
-> (forall a b.
    (a -> b -> b) -> b -> TraverseSecondOf3 t a c a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> TraverseSecondOf3 t a c a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> TraverseSecondOf3 t a c a -> b)
-> (forall a. (a -> a -> a) -> TraverseSecondOf3 t a c a -> a)
-> (forall a. (a -> a -> a) -> TraverseSecondOf3 t a c a -> a)
-> (forall a. TraverseSecondOf3 t a c a -> [a])
-> (forall a. TraverseSecondOf3 t a c a -> Bool)
-> (forall a. TraverseSecondOf3 t a c a -> Int)
-> (forall a. Eq a => a -> TraverseSecondOf3 t a c a -> Bool)
-> (forall a. Ord a => TraverseSecondOf3 t a c a -> a)
-> (forall a. Ord a => TraverseSecondOf3 t a c a -> a)
-> (forall a. Num a => TraverseSecondOf3 t a c a -> a)
-> (forall a. Num a => TraverseSecondOf3 t a c a -> a)
-> Foldable (TraverseSecondOf3 t a c)
forall a. Eq a => a -> TraverseSecondOf3 t a c a -> Bool
forall a. Num a => TraverseSecondOf3 t a c a -> a
forall a. Ord a => TraverseSecondOf3 t a c a -> a
forall m. Monoid m => TraverseSecondOf3 t a c m -> m
forall a. TraverseSecondOf3 t a c a -> Bool
forall a. TraverseSecondOf3 t a c a -> Int
forall a. TraverseSecondOf3 t a c a -> [a]
forall a. (a -> a -> a) -> TraverseSecondOf3 t a c a -> a
forall m a. Monoid m => (a -> m) -> TraverseSecondOf3 t a c a -> m
forall b a. (b -> a -> b) -> b -> TraverseSecondOf3 t a c a -> b
forall a b. (a -> b -> b) -> b -> TraverseSecondOf3 t a c a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
forall (t :: * -> *) a c a.
(Foldable t, Eq a) =>
a -> TraverseSecondOf3 t a c a -> Bool
forall (t :: * -> *) a c a.
(Foldable t, Num a) =>
TraverseSecondOf3 t a c a -> a
forall (t :: * -> *) a c a.
(Foldable t, Ord a) =>
TraverseSecondOf3 t a c a -> a
forall (t :: * -> *) a c m.
(Foldable t, Monoid m) =>
TraverseSecondOf3 t a c m -> m
forall (t :: * -> *) a c a.
Foldable t =>
TraverseSecondOf3 t a c a -> Bool
forall (t :: * -> *) a c a.
Foldable t =>
TraverseSecondOf3 t a c a -> Int
forall (t :: * -> *) a c a.
Foldable t =>
TraverseSecondOf3 t a c a -> [a]
forall (t :: * -> *) a c a.
Foldable t =>
(a -> a -> a) -> TraverseSecondOf3 t a c a -> a
forall (t :: * -> *) a c m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseSecondOf3 t a c a -> m
forall (t :: * -> *) a c b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseSecondOf3 t a c a -> b
forall (t :: * -> *) a c a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseSecondOf3 t a c a -> b
$cfold :: forall (t :: * -> *) a c m.
(Foldable t, Monoid m) =>
TraverseSecondOf3 t a c m -> m
fold :: forall m. Monoid m => TraverseSecondOf3 t a c m -> m
$cfoldMap :: forall (t :: * -> *) a c m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseSecondOf3 t a c a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> TraverseSecondOf3 t a c a -> m
$cfoldMap' :: forall (t :: * -> *) a c m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseSecondOf3 t a c a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> TraverseSecondOf3 t a c a -> m
$cfoldr :: forall (t :: * -> *) a c a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseSecondOf3 t a c a -> b
foldr :: forall a b. (a -> b -> b) -> b -> TraverseSecondOf3 t a c a -> b
$cfoldr' :: forall (t :: * -> *) a c a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseSecondOf3 t a c a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> TraverseSecondOf3 t a c a -> b
$cfoldl :: forall (t :: * -> *) a c b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseSecondOf3 t a c a -> b
foldl :: forall b a. (b -> a -> b) -> b -> TraverseSecondOf3 t a c a -> b
$cfoldl' :: forall (t :: * -> *) a c b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseSecondOf3 t a c a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> TraverseSecondOf3 t a c a -> b
$cfoldr1 :: forall (t :: * -> *) a c a.
Foldable t =>
(a -> a -> a) -> TraverseSecondOf3 t a c a -> a
foldr1 :: forall a. (a -> a -> a) -> TraverseSecondOf3 t a c a -> a
$cfoldl1 :: forall (t :: * -> *) a c a.
Foldable t =>
(a -> a -> a) -> TraverseSecondOf3 t a c a -> a
foldl1 :: forall a. (a -> a -> a) -> TraverseSecondOf3 t a c a -> a
$ctoList :: forall (t :: * -> *) a c a.
Foldable t =>
TraverseSecondOf3 t a c a -> [a]
toList :: forall a. TraverseSecondOf3 t a c a -> [a]
$cnull :: forall (t :: * -> *) a c a.
Foldable t =>
TraverseSecondOf3 t a c a -> Bool
null :: forall a. TraverseSecondOf3 t a c a -> Bool
$clength :: forall (t :: * -> *) a c a.
Foldable t =>
TraverseSecondOf3 t a c a -> Int
length :: forall a. TraverseSecondOf3 t a c a -> Int
$celem :: forall (t :: * -> *) a c a.
(Foldable t, Eq a) =>
a -> TraverseSecondOf3 t a c a -> Bool
elem :: forall a. Eq a => a -> TraverseSecondOf3 t a c a -> Bool
$cmaximum :: forall (t :: * -> *) a c a.
(Foldable t, Ord a) =>
TraverseSecondOf3 t a c a -> a
maximum :: forall a. Ord a => TraverseSecondOf3 t a c a -> a
$cminimum :: forall (t :: * -> *) a c a.
(Foldable t, Ord a) =>
TraverseSecondOf3 t a c a -> a
minimum :: forall a. Ord a => TraverseSecondOf3 t a c a -> a
$csum :: forall (t :: * -> *) a c a.
(Foldable t, Num a) =>
TraverseSecondOf3 t a c a -> a
sum :: forall a. Num a => TraverseSecondOf3 t a c a -> a
$cproduct :: forall (t :: * -> *) a c a.
(Foldable t, Num a) =>
TraverseSecondOf3 t a c a -> a
product :: forall a. Num a => TraverseSecondOf3 t a c a -> a
Foldable, Functor (TraverseSecondOf3 t a c)
Foldable (TraverseSecondOf3 t a c)
(Functor (TraverseSecondOf3 t a c),
 Foldable (TraverseSecondOf3 t a c)) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b)
 -> TraverseSecondOf3 t a c a -> f (TraverseSecondOf3 t a c b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    TraverseSecondOf3 t a c (f a) -> f (TraverseSecondOf3 t a c a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> TraverseSecondOf3 t a c a -> m (TraverseSecondOf3 t a c b))
-> (forall (m :: * -> *) a.
    Monad m =>
    TraverseSecondOf3 t a c (m a) -> m (TraverseSecondOf3 t a c a))
-> Traversable (TraverseSecondOf3 t a c)
forall (t :: * -> *).
(Functor t, Foldable t) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
TraverseSecondOf3 t a c (m a) -> m (TraverseSecondOf3 t a c a)
forall (f :: * -> *) a.
Applicative f =>
TraverseSecondOf3 t a c (f a) -> f (TraverseSecondOf3 t a c a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> TraverseSecondOf3 t a c a -> m (TraverseSecondOf3 t a c b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> TraverseSecondOf3 t a c a -> f (TraverseSecondOf3 t a c b)
forall (t :: * -> *) a c.
Traversable t =>
Functor (TraverseSecondOf3 t a c)
forall (t :: * -> *) a c.
Traversable t =>
Foldable (TraverseSecondOf3 t a c)
forall (t :: * -> *) a c (m :: * -> *) a.
(Traversable t, Monad m) =>
TraverseSecondOf3 t a c (m a) -> m (TraverseSecondOf3 t a c a)
forall (t :: * -> *) a c (f :: * -> *) a.
(Traversable t, Applicative f) =>
TraverseSecondOf3 t a c (f a) -> f (TraverseSecondOf3 t a c a)
forall (t :: * -> *) a c (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b)
-> TraverseSecondOf3 t a c a -> m (TraverseSecondOf3 t a c b)
forall (t :: * -> *) a c (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b)
-> TraverseSecondOf3 t a c a -> f (TraverseSecondOf3 t a c b)
$ctraverse :: forall (t :: * -> *) a c (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b)
-> TraverseSecondOf3 t a c a -> f (TraverseSecondOf3 t a c b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> TraverseSecondOf3 t a c a -> f (TraverseSecondOf3 t a c b)
$csequenceA :: forall (t :: * -> *) a c (f :: * -> *) a.
(Traversable t, Applicative f) =>
TraverseSecondOf3 t a c (f a) -> f (TraverseSecondOf3 t a c a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
TraverseSecondOf3 t a c (f a) -> f (TraverseSecondOf3 t a c a)
$cmapM :: forall (t :: * -> *) a c (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b)
-> TraverseSecondOf3 t a c a -> m (TraverseSecondOf3 t a c b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> TraverseSecondOf3 t a c a -> m (TraverseSecondOf3 t a c b)
$csequence :: forall (t :: * -> *) a c (m :: * -> *) a.
(Traversable t, Monad m) =>
TraverseSecondOf3 t a c (m a) -> m (TraverseSecondOf3 t a c a)
sequence :: forall (m :: * -> *) a.
Monad m =>
TraverseSecondOf3 t a c (m a) -> m (TraverseSecondOf3 t a c a)
Traversable)

data TraverseThird t a b c where
  TraverseThird :: { forall (t :: * -> *) a b c. TraverseThird t a b c -> t (a, b, c)
thirdTraversed :: t (a,b,c) } -> TraverseThird t a b c
 deriving ((forall a b.
 (a -> b) -> TraverseThird t a b a -> TraverseThird t a b b)
-> (forall a b.
    a -> TraverseThird t a b b -> TraverseThird t a b a)
-> Functor (TraverseThird t a b)
forall a b. a -> TraverseThird t a b b -> TraverseThird t a b a
forall a b.
(a -> b) -> TraverseThird t a b a -> TraverseThird t a b b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
forall (t :: * -> *) a b a b.
Functor t =>
a -> TraverseThird t a b b -> TraverseThird t a b a
forall (t :: * -> *) a b a b.
Functor t =>
(a -> b) -> TraverseThird t a b a -> TraverseThird t a b b
$cfmap :: forall (t :: * -> *) a b a b.
Functor t =>
(a -> b) -> TraverseThird t a b a -> TraverseThird t a b b
fmap :: forall a b.
(a -> b) -> TraverseThird t a b a -> TraverseThird t a b b
$c<$ :: forall (t :: * -> *) a b a b.
Functor t =>
a -> TraverseThird t a b b -> TraverseThird t a b a
<$ :: forall a b. a -> TraverseThird t a b b -> TraverseThird t a b a
Functor, (forall m. Monoid m => TraverseThird t a b m -> m)
-> (forall m a. Monoid m => (a -> m) -> TraverseThird t a b a -> m)
-> (forall m a. Monoid m => (a -> m) -> TraverseThird t a b a -> m)
-> (forall a b. (a -> b -> b) -> b -> TraverseThird t a b a -> b)
-> (forall a b. (a -> b -> b) -> b -> TraverseThird t a b a -> b)
-> (forall b a. (b -> a -> b) -> b -> TraverseThird t a b a -> b)
-> (forall b a. (b -> a -> b) -> b -> TraverseThird t a b a -> b)
-> (forall a. (a -> a -> a) -> TraverseThird t a b a -> a)
-> (forall a. (a -> a -> a) -> TraverseThird t a b a -> a)
-> (forall a. TraverseThird t a b a -> [a])
-> (forall a. TraverseThird t a b a -> Bool)
-> (forall a. TraverseThird t a b a -> Int)
-> (forall a. Eq a => a -> TraverseThird t a b a -> Bool)
-> (forall a. Ord a => TraverseThird t a b a -> a)
-> (forall a. Ord a => TraverseThird t a b a -> a)
-> (forall a. Num a => TraverseThird t a b a -> a)
-> (forall a. Num a => TraverseThird t a b a -> a)
-> Foldable (TraverseThird t a b)
forall a. Eq a => a -> TraverseThird t a b a -> Bool
forall a. Num a => TraverseThird t a b a -> a
forall a. Ord a => TraverseThird t a b a -> a
forall m. Monoid m => TraverseThird t a b m -> m
forall a. TraverseThird t a b a -> Bool
forall a. TraverseThird t a b a -> Int
forall a. TraverseThird t a b a -> [a]
forall a. (a -> a -> a) -> TraverseThird t a b a -> a
forall m a. Monoid m => (a -> m) -> TraverseThird t a b a -> m
forall b a. (b -> a -> b) -> b -> TraverseThird t a b a -> b
forall a b. (a -> b -> b) -> b -> TraverseThird t a b a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
forall (t :: * -> *) a b a.
(Foldable t, Eq a) =>
a -> TraverseThird t a b a -> Bool
forall (t :: * -> *) a b a.
(Foldable t, Num a) =>
TraverseThird t a b a -> a
forall (t :: * -> *) a b a.
(Foldable t, Ord a) =>
TraverseThird t a b a -> a
forall (t :: * -> *) a b m.
(Foldable t, Monoid m) =>
TraverseThird t a b m -> m
forall (t :: * -> *) a b a.
Foldable t =>
TraverseThird t a b a -> Bool
forall (t :: * -> *) a b a.
Foldable t =>
TraverseThird t a b a -> Int
forall (t :: * -> *) a b a.
Foldable t =>
TraverseThird t a b a -> [a]
forall (t :: * -> *) a b a.
Foldable t =>
(a -> a -> a) -> TraverseThird t a b a -> a
forall (t :: * -> *) a b m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseThird t a b a -> m
forall (t :: * -> *) a b b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseThird t a b a -> b
forall (t :: * -> *) a b a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseThird t a b a -> b
$cfold :: forall (t :: * -> *) a b m.
(Foldable t, Monoid m) =>
TraverseThird t a b m -> m
fold :: forall m. Monoid m => TraverseThird t a b m -> m
$cfoldMap :: forall (t :: * -> *) a b m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseThird t a b a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> TraverseThird t a b a -> m
$cfoldMap' :: forall (t :: * -> *) a b m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseThird t a b a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> TraverseThird t a b a -> m
$cfoldr :: forall (t :: * -> *) a b a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseThird t a b a -> b
foldr :: forall a b. (a -> b -> b) -> b -> TraverseThird t a b a -> b
$cfoldr' :: forall (t :: * -> *) a b a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseThird t a b a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> TraverseThird t a b a -> b
$cfoldl :: forall (t :: * -> *) a b b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseThird t a b a -> b
foldl :: forall b a. (b -> a -> b) -> b -> TraverseThird t a b a -> b
$cfoldl' :: forall (t :: * -> *) a b b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseThird t a b a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> TraverseThird t a b a -> b
$cfoldr1 :: forall (t :: * -> *) a b a.
Foldable t =>
(a -> a -> a) -> TraverseThird t a b a -> a
foldr1 :: forall a. (a -> a -> a) -> TraverseThird t a b a -> a
$cfoldl1 :: forall (t :: * -> *) a b a.
Foldable t =>
(a -> a -> a) -> TraverseThird t a b a -> a
foldl1 :: forall a. (a -> a -> a) -> TraverseThird t a b a -> a
$ctoList :: forall (t :: * -> *) a b a.
Foldable t =>
TraverseThird t a b a -> [a]
toList :: forall a. TraverseThird t a b a -> [a]
$cnull :: forall (t :: * -> *) a b a.
Foldable t =>
TraverseThird t a b a -> Bool
null :: forall a. TraverseThird t a b a -> Bool
$clength :: forall (t :: * -> *) a b a.
Foldable t =>
TraverseThird t a b a -> Int
length :: forall a. TraverseThird t a b a -> Int
$celem :: forall (t :: * -> *) a b a.
(Foldable t, Eq a) =>
a -> TraverseThird t a b a -> Bool
elem :: forall a. Eq a => a -> TraverseThird t a b a -> Bool
$cmaximum :: forall (t :: * -> *) a b a.
(Foldable t, Ord a) =>
TraverseThird t a b a -> a
maximum :: forall a. Ord a => TraverseThird t a b a -> a
$cminimum :: forall (t :: * -> *) a b a.
(Foldable t, Ord a) =>
TraverseThird t a b a -> a
minimum :: forall a. Ord a => TraverseThird t a b a -> a
$csum :: forall (t :: * -> *) a b a.
(Foldable t, Num a) =>
TraverseThird t a b a -> a
sum :: forall a. Num a => TraverseThird t a b a -> a
$cproduct :: forall (t :: * -> *) a b a.
(Foldable t, Num a) =>
TraverseThird t a b a -> a
product :: forall a. Num a => TraverseThird t a b a -> a
Foldable, Functor (TraverseThird t a b)
Foldable (TraverseThird t a b)
(Functor (TraverseThird t a b), Foldable (TraverseThird t a b)) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> TraverseThird t a b a -> f (TraverseThird t a b b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    TraverseThird t a b (f a) -> f (TraverseThird t a b a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> TraverseThird t a b a -> m (TraverseThird t a b b))
-> (forall (m :: * -> *) a.
    Monad m =>
    TraverseThird t a b (m a) -> m (TraverseThird t a b a))
-> Traversable (TraverseThird t a b)
forall (t :: * -> *).
(Functor t, Foldable t) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
TraverseThird t a b (m a) -> m (TraverseThird t a b a)
forall (f :: * -> *) a.
Applicative f =>
TraverseThird t a b (f a) -> f (TraverseThird t a b a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> TraverseThird t a b a -> m (TraverseThird t a b b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> TraverseThird t a b a -> f (TraverseThird t a b b)
forall (t :: * -> *) a b.
Traversable t =>
Functor (TraverseThird t a b)
forall (t :: * -> *) a b.
Traversable t =>
Foldable (TraverseThird t a b)
forall (t :: * -> *) a b (m :: * -> *) a.
(Traversable t, Monad m) =>
TraverseThird t a b (m a) -> m (TraverseThird t a b a)
forall (t :: * -> *) a b (f :: * -> *) a.
(Traversable t, Applicative f) =>
TraverseThird t a b (f a) -> f (TraverseThird t a b a)
forall (t :: * -> *) a b (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> TraverseThird t a b a -> m (TraverseThird t a b b)
forall (t :: * -> *) a b (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> TraverseThird t a b a -> f (TraverseThird t a b b)
$ctraverse :: forall (t :: * -> *) a b (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> TraverseThird t a b a -> f (TraverseThird t a b b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> TraverseThird t a b a -> f (TraverseThird t a b b)
$csequenceA :: forall (t :: * -> *) a b (f :: * -> *) a.
(Traversable t, Applicative f) =>
TraverseThird t a b (f a) -> f (TraverseThird t a b a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
TraverseThird t a b (f a) -> f (TraverseThird t a b a)
$cmapM :: forall (t :: * -> *) a b (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> TraverseThird t a b a -> m (TraverseThird t a b b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> TraverseThird t a b a -> m (TraverseThird t a b b)
$csequence :: forall (t :: * -> *) a b (m :: * -> *) a.
(Traversable t, Monad m) =>
TraverseThird t a b (m a) -> m (TraverseThird t a b a)
sequence :: forall (m :: * -> *) a.
Monad m =>
TraverseThird t a b (m a) -> m (TraverseThird t a b a)
Traversable)

instance (Show a, Show b, Show c) => Show (a,b,c) where
  showEach :: forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t (a, b, c) -> t ShowS
showEach PaddingMode
padMode Int
_
       = ((ShowS, ShowS, ShowS) -> ShowS)
-> t (ShowS, ShowS, ShowS) -> t ShowS
forall a b. (a -> b) -> t a -> t b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\(ShowS
sa,ShowS
sb,ShowS
sc) -> (Char
'('Char -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShowS
sa ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char
','Char -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShowS
sb ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char
','Char -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShowS
sc ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char
')'Char -> ShowS
forall a. a -> [a] -> [a]
:))
             (t (ShowS, ShowS, ShowS) -> t ShowS)
-> (t (a, b, c) -> t (ShowS, ShowS, ShowS))
-> t (a, b, c)
-> t ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.  TraverseFirstOf3 t ShowS ShowS ShowS -> t (ShowS, ShowS, ShowS)
forall (t :: * -> *) a b c. TraverseFirstOf3 t b c a -> t (a, b, c)
firstOf3Traversed (TraverseFirstOf3 t ShowS ShowS ShowS -> t (ShowS, ShowS, ShowS))
-> (t (a, b, c) -> TraverseFirstOf3 t ShowS ShowS ShowS)
-> t (a, b, c)
-> t (ShowS, ShowS, ShowS)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PaddingMode
-> Int
-> TraverseFirstOf3 t ShowS ShowS a
-> TraverseFirstOf3 t ShowS ShowS ShowS
forall a (t :: * -> *).
(Show a, Traversable t) =>
PaddingMode -> Int -> t a -> t ShowS
forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t a -> t ShowS
showEach PaddingMode
padMode Int
0 (TraverseFirstOf3 t ShowS ShowS a
 -> TraverseFirstOf3 t ShowS ShowS ShowS)
-> (t (a, b, c) -> TraverseFirstOf3 t ShowS ShowS a)
-> t (a, b, c)
-> TraverseFirstOf3 t ShowS ShowS ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. t (a, ShowS, ShowS) -> TraverseFirstOf3 t ShowS ShowS a
forall (t :: * -> *) a b c. t (a, b, c) -> TraverseFirstOf3 t b c a
TraverseFirstOf3
             (t (a, ShowS, ShowS) -> TraverseFirstOf3 t ShowS ShowS a)
-> (t (a, b, c) -> t (a, ShowS, ShowS))
-> t (a, b, c)
-> TraverseFirstOf3 t ShowS ShowS a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TraverseSecondOf3 t a ShowS ShowS -> t (a, ShowS, ShowS)
forall (t :: * -> *) a b c.
TraverseSecondOf3 t a c b -> t (a, b, c)
secondOf3Traversed (TraverseSecondOf3 t a ShowS ShowS -> t (a, ShowS, ShowS))
-> (t (a, b, c) -> TraverseSecondOf3 t a ShowS ShowS)
-> t (a, b, c)
-> t (a, ShowS, ShowS)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PaddingMode
-> Int
-> TraverseSecondOf3 t a ShowS b
-> TraverseSecondOf3 t a ShowS ShowS
forall a (t :: * -> *).
(Show a, Traversable t) =>
PaddingMode -> Int -> t a -> t ShowS
forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t b -> t ShowS
showEach PaddingMode
padMode Int
0 (TraverseSecondOf3 t a ShowS b
 -> TraverseSecondOf3 t a ShowS ShowS)
-> (t (a, b, c) -> TraverseSecondOf3 t a ShowS b)
-> t (a, b, c)
-> TraverseSecondOf3 t a ShowS ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. t (a, b, ShowS) -> TraverseSecondOf3 t a ShowS b
forall (t :: * -> *) a b c.
t (a, b, c) -> TraverseSecondOf3 t a c b
TraverseSecondOf3
             (t (a, b, ShowS) -> TraverseSecondOf3 t a ShowS b)
-> (t (a, b, c) -> t (a, b, ShowS))
-> t (a, b, c)
-> TraverseSecondOf3 t a ShowS b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.     TraverseThird t a b ShowS -> t (a, b, ShowS)
forall (t :: * -> *) a b c. TraverseThird t a b c -> t (a, b, c)
thirdTraversed (TraverseThird t a b ShowS -> t (a, b, ShowS))
-> (t (a, b, c) -> TraverseThird t a b ShowS)
-> t (a, b, c)
-> t (a, b, ShowS)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PaddingMode
-> Int -> TraverseThird t a b c -> TraverseThird t a b ShowS
forall a (t :: * -> *).
(Show a, Traversable t) =>
PaddingMode -> Int -> t a -> t ShowS
forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t c -> t ShowS
showEach PaddingMode
padMode Int
0 (TraverseThird t a b c -> TraverseThird t a b ShowS)
-> (t (a, b, c) -> TraverseThird t a b c)
-> t (a, b, c)
-> TraverseThird t a b ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. t (a, b, c) -> TraverseThird t a b c
forall (t :: * -> *) a b c. t (a, b, c) -> TraverseThird t a b c
TraverseThird

data TraverseFirstOf4 t b c d a where
  TraverseFirstOf4 :: { forall (t :: * -> *) a b c d.
TraverseFirstOf4 t b c d a -> t (a, b, c, d)
firstOf4Traversed :: t (a,b,c,d) } -> TraverseFirstOf4 t b c d a
 deriving ((forall a b.
 (a -> b)
 -> TraverseFirstOf4 t b c d a -> TraverseFirstOf4 t b c d b)
-> (forall a b.
    a -> TraverseFirstOf4 t b c d b -> TraverseFirstOf4 t b c d a)
-> Functor (TraverseFirstOf4 t b c d)
forall a b.
a -> TraverseFirstOf4 t b c d b -> TraverseFirstOf4 t b c d a
forall a b.
(a -> b)
-> TraverseFirstOf4 t b c d a -> TraverseFirstOf4 t b c d b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
forall (t :: * -> *) b c d a b.
Functor t =>
a -> TraverseFirstOf4 t b c d b -> TraverseFirstOf4 t b c d a
forall (t :: * -> *) b c d a b.
Functor t =>
(a -> b)
-> TraverseFirstOf4 t b c d a -> TraverseFirstOf4 t b c d b
$cfmap :: forall (t :: * -> *) b c d a b.
Functor t =>
(a -> b)
-> TraverseFirstOf4 t b c d a -> TraverseFirstOf4 t b c d b
fmap :: forall a b.
(a -> b)
-> TraverseFirstOf4 t b c d a -> TraverseFirstOf4 t b c d b
$c<$ :: forall (t :: * -> *) b c d a b.
Functor t =>
a -> TraverseFirstOf4 t b c d b -> TraverseFirstOf4 t b c d a
<$ :: forall a b.
a -> TraverseFirstOf4 t b c d b -> TraverseFirstOf4 t b c d a
Functor, (forall m. Monoid m => TraverseFirstOf4 t b c d m -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> TraverseFirstOf4 t b c d a -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> TraverseFirstOf4 t b c d a -> m)
-> (forall a b.
    (a -> b -> b) -> b -> TraverseFirstOf4 t b c d a -> b)
-> (forall a b.
    (a -> b -> b) -> b -> TraverseFirstOf4 t b c d a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> TraverseFirstOf4 t b c d a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> TraverseFirstOf4 t b c d a -> b)
-> (forall a. (a -> a -> a) -> TraverseFirstOf4 t b c d a -> a)
-> (forall a. (a -> a -> a) -> TraverseFirstOf4 t b c d a -> a)
-> (forall a. TraverseFirstOf4 t b c d a -> [a])
-> (forall a. TraverseFirstOf4 t b c d a -> Bool)
-> (forall a. TraverseFirstOf4 t b c d a -> Int)
-> (forall a. Eq a => a -> TraverseFirstOf4 t b c d a -> Bool)
-> (forall a. Ord a => TraverseFirstOf4 t b c d a -> a)
-> (forall a. Ord a => TraverseFirstOf4 t b c d a -> a)
-> (forall a. Num a => TraverseFirstOf4 t b c d a -> a)
-> (forall a. Num a => TraverseFirstOf4 t b c d a -> a)
-> Foldable (TraverseFirstOf4 t b c d)
forall a. Eq a => a -> TraverseFirstOf4 t b c d a -> Bool
forall a. Num a => TraverseFirstOf4 t b c d a -> a
forall a. Ord a => TraverseFirstOf4 t b c d a -> a
forall m. Monoid m => TraverseFirstOf4 t b c d m -> m
forall a. TraverseFirstOf4 t b c d a -> Bool
forall a. TraverseFirstOf4 t b c d a -> Int
forall a. TraverseFirstOf4 t b c d a -> [a]
forall a. (a -> a -> a) -> TraverseFirstOf4 t b c d a -> a
forall m a. Monoid m => (a -> m) -> TraverseFirstOf4 t b c d a -> m
forall b a. (b -> a -> b) -> b -> TraverseFirstOf4 t b c d a -> b
forall a b. (a -> b -> b) -> b -> TraverseFirstOf4 t b c d a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
forall (t :: * -> *) b c d a.
(Foldable t, Eq a) =>
a -> TraverseFirstOf4 t b c d a -> Bool
forall (t :: * -> *) b c d a.
(Foldable t, Num a) =>
TraverseFirstOf4 t b c d a -> a
forall (t :: * -> *) b c d a.
(Foldable t, Ord a) =>
TraverseFirstOf4 t b c d a -> a
forall (t :: * -> *) b c d m.
(Foldable t, Monoid m) =>
TraverseFirstOf4 t b c d m -> m
forall (t :: * -> *) b c d a.
Foldable t =>
TraverseFirstOf4 t b c d a -> Bool
forall (t :: * -> *) b c d a.
Foldable t =>
TraverseFirstOf4 t b c d a -> Int
forall (t :: * -> *) b c d a.
Foldable t =>
TraverseFirstOf4 t b c d a -> [a]
forall (t :: * -> *) b c d a.
Foldable t =>
(a -> a -> a) -> TraverseFirstOf4 t b c d a -> a
forall (t :: * -> *) b c d m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseFirstOf4 t b c d a -> m
forall (t :: * -> *) b c d b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseFirstOf4 t b c d a -> b
forall (t :: * -> *) b c d a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseFirstOf4 t b c d a -> b
$cfold :: forall (t :: * -> *) b c d m.
(Foldable t, Monoid m) =>
TraverseFirstOf4 t b c d m -> m
fold :: forall m. Monoid m => TraverseFirstOf4 t b c d m -> m
$cfoldMap :: forall (t :: * -> *) b c d m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseFirstOf4 t b c d a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> TraverseFirstOf4 t b c d a -> m
$cfoldMap' :: forall (t :: * -> *) b c d m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseFirstOf4 t b c d a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> TraverseFirstOf4 t b c d a -> m
$cfoldr :: forall (t :: * -> *) b c d a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseFirstOf4 t b c d a -> b
foldr :: forall a b. (a -> b -> b) -> b -> TraverseFirstOf4 t b c d a -> b
$cfoldr' :: forall (t :: * -> *) b c d a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseFirstOf4 t b c d a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> TraverseFirstOf4 t b c d a -> b
$cfoldl :: forall (t :: * -> *) b c d b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseFirstOf4 t b c d a -> b
foldl :: forall b a. (b -> a -> b) -> b -> TraverseFirstOf4 t b c d a -> b
$cfoldl' :: forall (t :: * -> *) b c d b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseFirstOf4 t b c d a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> TraverseFirstOf4 t b c d a -> b
$cfoldr1 :: forall (t :: * -> *) b c d a.
Foldable t =>
(a -> a -> a) -> TraverseFirstOf4 t b c d a -> a
foldr1 :: forall a. (a -> a -> a) -> TraverseFirstOf4 t b c d a -> a
$cfoldl1 :: forall (t :: * -> *) b c d a.
Foldable t =>
(a -> a -> a) -> TraverseFirstOf4 t b c d a -> a
foldl1 :: forall a. (a -> a -> a) -> TraverseFirstOf4 t b c d a -> a
$ctoList :: forall (t :: * -> *) b c d a.
Foldable t =>
TraverseFirstOf4 t b c d a -> [a]
toList :: forall a. TraverseFirstOf4 t b c d a -> [a]
$cnull :: forall (t :: * -> *) b c d a.
Foldable t =>
TraverseFirstOf4 t b c d a -> Bool
null :: forall a. TraverseFirstOf4 t b c d a -> Bool
$clength :: forall (t :: * -> *) b c d a.
Foldable t =>
TraverseFirstOf4 t b c d a -> Int
length :: forall a. TraverseFirstOf4 t b c d a -> Int
$celem :: forall (t :: * -> *) b c d a.
(Foldable t, Eq a) =>
a -> TraverseFirstOf4 t b c d a -> Bool
elem :: forall a. Eq a => a -> TraverseFirstOf4 t b c d a -> Bool
$cmaximum :: forall (t :: * -> *) b c d a.
(Foldable t, Ord a) =>
TraverseFirstOf4 t b c d a -> a
maximum :: forall a. Ord a => TraverseFirstOf4 t b c d a -> a
$cminimum :: forall (t :: * -> *) b c d a.
(Foldable t, Ord a) =>
TraverseFirstOf4 t b c d a -> a
minimum :: forall a. Ord a => TraverseFirstOf4 t b c d a -> a
$csum :: forall (t :: * -> *) b c d a.
(Foldable t, Num a) =>
TraverseFirstOf4 t b c d a -> a
sum :: forall a. Num a => TraverseFirstOf4 t b c d a -> a
$cproduct :: forall (t :: * -> *) b c d a.
(Foldable t, Num a) =>
TraverseFirstOf4 t b c d a -> a
product :: forall a. Num a => TraverseFirstOf4 t b c d a -> a
Foldable, Functor (TraverseFirstOf4 t b c d)
Foldable (TraverseFirstOf4 t b c d)
(Functor (TraverseFirstOf4 t b c d),
 Foldable (TraverseFirstOf4 t b c d)) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b)
 -> TraverseFirstOf4 t b c d a -> f (TraverseFirstOf4 t b c d b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    TraverseFirstOf4 t b c d (f a) -> f (TraverseFirstOf4 t b c d a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> TraverseFirstOf4 t b c d a -> m (TraverseFirstOf4 t b c d b))
-> (forall (m :: * -> *) a.
    Monad m =>
    TraverseFirstOf4 t b c d (m a) -> m (TraverseFirstOf4 t b c d a))
-> Traversable (TraverseFirstOf4 t b c d)
forall (t :: * -> *).
(Functor t, Foldable t) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
TraverseFirstOf4 t b c d (m a) -> m (TraverseFirstOf4 t b c d a)
forall (f :: * -> *) a.
Applicative f =>
TraverseFirstOf4 t b c d (f a) -> f (TraverseFirstOf4 t b c d a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> TraverseFirstOf4 t b c d a -> m (TraverseFirstOf4 t b c d b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> TraverseFirstOf4 t b c d a -> f (TraverseFirstOf4 t b c d b)
forall (t :: * -> *) b c d.
Traversable t =>
Functor (TraverseFirstOf4 t b c d)
forall (t :: * -> *) b c d.
Traversable t =>
Foldable (TraverseFirstOf4 t b c d)
forall (t :: * -> *) b c d (m :: * -> *) a.
(Traversable t, Monad m) =>
TraverseFirstOf4 t b c d (m a) -> m (TraverseFirstOf4 t b c d a)
forall (t :: * -> *) b c d (f :: * -> *) a.
(Traversable t, Applicative f) =>
TraverseFirstOf4 t b c d (f a) -> f (TraverseFirstOf4 t b c d a)
forall (t :: * -> *) b c d (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b)
-> TraverseFirstOf4 t b c d a -> m (TraverseFirstOf4 t b c d b)
forall (t :: * -> *) b c d (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b)
-> TraverseFirstOf4 t b c d a -> f (TraverseFirstOf4 t b c d b)
$ctraverse :: forall (t :: * -> *) b c d (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b)
-> TraverseFirstOf4 t b c d a -> f (TraverseFirstOf4 t b c d b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> TraverseFirstOf4 t b c d a -> f (TraverseFirstOf4 t b c d b)
$csequenceA :: forall (t :: * -> *) b c d (f :: * -> *) a.
(Traversable t, Applicative f) =>
TraverseFirstOf4 t b c d (f a) -> f (TraverseFirstOf4 t b c d a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
TraverseFirstOf4 t b c d (f a) -> f (TraverseFirstOf4 t b c d a)
$cmapM :: forall (t :: * -> *) b c d (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b)
-> TraverseFirstOf4 t b c d a -> m (TraverseFirstOf4 t b c d b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> TraverseFirstOf4 t b c d a -> m (TraverseFirstOf4 t b c d b)
$csequence :: forall (t :: * -> *) b c d (m :: * -> *) a.
(Traversable t, Monad m) =>
TraverseFirstOf4 t b c d (m a) -> m (TraverseFirstOf4 t b c d a)
sequence :: forall (m :: * -> *) a.
Monad m =>
TraverseFirstOf4 t b c d (m a) -> m (TraverseFirstOf4 t b c d a)
Traversable)

data TraverseSecondOf4 t a c d b where
  TraverseSecondOf4 :: { forall (t :: * -> *) a b c d.
TraverseSecondOf4 t a c d b -> t (a, b, c, d)
secondOf4Traversed :: t (a,b,c,d) } -> TraverseSecondOf4 t a c d b
 deriving ((forall a b.
 (a -> b)
 -> TraverseSecondOf4 t a c d a -> TraverseSecondOf4 t a c d b)
-> (forall a b.
    a -> TraverseSecondOf4 t a c d b -> TraverseSecondOf4 t a c d a)
-> Functor (TraverseSecondOf4 t a c d)
forall a b.
a -> TraverseSecondOf4 t a c d b -> TraverseSecondOf4 t a c d a
forall a b.
(a -> b)
-> TraverseSecondOf4 t a c d a -> TraverseSecondOf4 t a c d b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
forall (t :: * -> *) a c d a b.
Functor t =>
a -> TraverseSecondOf4 t a c d b -> TraverseSecondOf4 t a c d a
forall (t :: * -> *) a c d a b.
Functor t =>
(a -> b)
-> TraverseSecondOf4 t a c d a -> TraverseSecondOf4 t a c d b
$cfmap :: forall (t :: * -> *) a c d a b.
Functor t =>
(a -> b)
-> TraverseSecondOf4 t a c d a -> TraverseSecondOf4 t a c d b
fmap :: forall a b.
(a -> b)
-> TraverseSecondOf4 t a c d a -> TraverseSecondOf4 t a c d b
$c<$ :: forall (t :: * -> *) a c d a b.
Functor t =>
a -> TraverseSecondOf4 t a c d b -> TraverseSecondOf4 t a c d a
<$ :: forall a b.
a -> TraverseSecondOf4 t a c d b -> TraverseSecondOf4 t a c d a
Functor, (forall m. Monoid m => TraverseSecondOf4 t a c d m -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> TraverseSecondOf4 t a c d a -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> TraverseSecondOf4 t a c d a -> m)
-> (forall a b.
    (a -> b -> b) -> b -> TraverseSecondOf4 t a c d a -> b)
-> (forall a b.
    (a -> b -> b) -> b -> TraverseSecondOf4 t a c d a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> TraverseSecondOf4 t a c d a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> TraverseSecondOf4 t a c d a -> b)
-> (forall a. (a -> a -> a) -> TraverseSecondOf4 t a c d a -> a)
-> (forall a. (a -> a -> a) -> TraverseSecondOf4 t a c d a -> a)
-> (forall a. TraverseSecondOf4 t a c d a -> [a])
-> (forall a. TraverseSecondOf4 t a c d a -> Bool)
-> (forall a. TraverseSecondOf4 t a c d a -> Int)
-> (forall a. Eq a => a -> TraverseSecondOf4 t a c d a -> Bool)
-> (forall a. Ord a => TraverseSecondOf4 t a c d a -> a)
-> (forall a. Ord a => TraverseSecondOf4 t a c d a -> a)
-> (forall a. Num a => TraverseSecondOf4 t a c d a -> a)
-> (forall a. Num a => TraverseSecondOf4 t a c d a -> a)
-> Foldable (TraverseSecondOf4 t a c d)
forall a. Eq a => a -> TraverseSecondOf4 t a c d a -> Bool
forall a. Num a => TraverseSecondOf4 t a c d a -> a
forall a. Ord a => TraverseSecondOf4 t a c d a -> a
forall m. Monoid m => TraverseSecondOf4 t a c d m -> m
forall a. TraverseSecondOf4 t a c d a -> Bool
forall a. TraverseSecondOf4 t a c d a -> Int
forall a. TraverseSecondOf4 t a c d a -> [a]
forall a. (a -> a -> a) -> TraverseSecondOf4 t a c d a -> a
forall m a.
Monoid m =>
(a -> m) -> TraverseSecondOf4 t a c d a -> m
forall b a. (b -> a -> b) -> b -> TraverseSecondOf4 t a c d a -> b
forall a b. (a -> b -> b) -> b -> TraverseSecondOf4 t a c d a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
forall (t :: * -> *) a c d a.
(Foldable t, Eq a) =>
a -> TraverseSecondOf4 t a c d a -> Bool
forall (t :: * -> *) a c d a.
(Foldable t, Num a) =>
TraverseSecondOf4 t a c d a -> a
forall (t :: * -> *) a c d a.
(Foldable t, Ord a) =>
TraverseSecondOf4 t a c d a -> a
forall (t :: * -> *) a c d m.
(Foldable t, Monoid m) =>
TraverseSecondOf4 t a c d m -> m
forall (t :: * -> *) a c d a.
Foldable t =>
TraverseSecondOf4 t a c d a -> Bool
forall (t :: * -> *) a c d a.
Foldable t =>
TraverseSecondOf4 t a c d a -> Int
forall (t :: * -> *) a c d a.
Foldable t =>
TraverseSecondOf4 t a c d a -> [a]
forall (t :: * -> *) a c d a.
Foldable t =>
(a -> a -> a) -> TraverseSecondOf4 t a c d a -> a
forall (t :: * -> *) a c d m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseSecondOf4 t a c d a -> m
forall (t :: * -> *) a c d b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseSecondOf4 t a c d a -> b
forall (t :: * -> *) a c d a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseSecondOf4 t a c d a -> b
$cfold :: forall (t :: * -> *) a c d m.
(Foldable t, Monoid m) =>
TraverseSecondOf4 t a c d m -> m
fold :: forall m. Monoid m => TraverseSecondOf4 t a c d m -> m
$cfoldMap :: forall (t :: * -> *) a c d m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseSecondOf4 t a c d a -> m
foldMap :: forall m a.
Monoid m =>
(a -> m) -> TraverseSecondOf4 t a c d a -> m
$cfoldMap' :: forall (t :: * -> *) a c d m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseSecondOf4 t a c d a -> m
foldMap' :: forall m a.
Monoid m =>
(a -> m) -> TraverseSecondOf4 t a c d a -> m
$cfoldr :: forall (t :: * -> *) a c d a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseSecondOf4 t a c d a -> b
foldr :: forall a b. (a -> b -> b) -> b -> TraverseSecondOf4 t a c d a -> b
$cfoldr' :: forall (t :: * -> *) a c d a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseSecondOf4 t a c d a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> TraverseSecondOf4 t a c d a -> b
$cfoldl :: forall (t :: * -> *) a c d b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseSecondOf4 t a c d a -> b
foldl :: forall b a. (b -> a -> b) -> b -> TraverseSecondOf4 t a c d a -> b
$cfoldl' :: forall (t :: * -> *) a c d b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseSecondOf4 t a c d a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> TraverseSecondOf4 t a c d a -> b
$cfoldr1 :: forall (t :: * -> *) a c d a.
Foldable t =>
(a -> a -> a) -> TraverseSecondOf4 t a c d a -> a
foldr1 :: forall a. (a -> a -> a) -> TraverseSecondOf4 t a c d a -> a
$cfoldl1 :: forall (t :: * -> *) a c d a.
Foldable t =>
(a -> a -> a) -> TraverseSecondOf4 t a c d a -> a
foldl1 :: forall a. (a -> a -> a) -> TraverseSecondOf4 t a c d a -> a
$ctoList :: forall (t :: * -> *) a c d a.
Foldable t =>
TraverseSecondOf4 t a c d a -> [a]
toList :: forall a. TraverseSecondOf4 t a c d a -> [a]
$cnull :: forall (t :: * -> *) a c d a.
Foldable t =>
TraverseSecondOf4 t a c d a -> Bool
null :: forall a. TraverseSecondOf4 t a c d a -> Bool
$clength :: forall (t :: * -> *) a c d a.
Foldable t =>
TraverseSecondOf4 t a c d a -> Int
length :: forall a. TraverseSecondOf4 t a c d a -> Int
$celem :: forall (t :: * -> *) a c d a.
(Foldable t, Eq a) =>
a -> TraverseSecondOf4 t a c d a -> Bool
elem :: forall a. Eq a => a -> TraverseSecondOf4 t a c d a -> Bool
$cmaximum :: forall (t :: * -> *) a c d a.
(Foldable t, Ord a) =>
TraverseSecondOf4 t a c d a -> a
maximum :: forall a. Ord a => TraverseSecondOf4 t a c d a -> a
$cminimum :: forall (t :: * -> *) a c d a.
(Foldable t, Ord a) =>
TraverseSecondOf4 t a c d a -> a
minimum :: forall a. Ord a => TraverseSecondOf4 t a c d a -> a
$csum :: forall (t :: * -> *) a c d a.
(Foldable t, Num a) =>
TraverseSecondOf4 t a c d a -> a
sum :: forall a. Num a => TraverseSecondOf4 t a c d a -> a
$cproduct :: forall (t :: * -> *) a c d a.
(Foldable t, Num a) =>
TraverseSecondOf4 t a c d a -> a
product :: forall a. Num a => TraverseSecondOf4 t a c d a -> a
Foldable, Functor (TraverseSecondOf4 t a c d)
Foldable (TraverseSecondOf4 t a c d)
(Functor (TraverseSecondOf4 t a c d),
 Foldable (TraverseSecondOf4 t a c d)) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b)
 -> TraverseSecondOf4 t a c d a -> f (TraverseSecondOf4 t a c d b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    TraverseSecondOf4 t a c d (f a) -> f (TraverseSecondOf4 t a c d a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> TraverseSecondOf4 t a c d a -> m (TraverseSecondOf4 t a c d b))
-> (forall (m :: * -> *) a.
    Monad m =>
    TraverseSecondOf4 t a c d (m a) -> m (TraverseSecondOf4 t a c d a))
-> Traversable (TraverseSecondOf4 t a c d)
forall (t :: * -> *).
(Functor t, Foldable t) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
TraverseSecondOf4 t a c d (m a) -> m (TraverseSecondOf4 t a c d a)
forall (f :: * -> *) a.
Applicative f =>
TraverseSecondOf4 t a c d (f a) -> f (TraverseSecondOf4 t a c d a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> TraverseSecondOf4 t a c d a -> m (TraverseSecondOf4 t a c d b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> TraverseSecondOf4 t a c d a -> f (TraverseSecondOf4 t a c d b)
forall (t :: * -> *) a c d.
Traversable t =>
Functor (TraverseSecondOf4 t a c d)
forall (t :: * -> *) a c d.
Traversable t =>
Foldable (TraverseSecondOf4 t a c d)
forall (t :: * -> *) a c d (m :: * -> *) a.
(Traversable t, Monad m) =>
TraverseSecondOf4 t a c d (m a) -> m (TraverseSecondOf4 t a c d a)
forall (t :: * -> *) a c d (f :: * -> *) a.
(Traversable t, Applicative f) =>
TraverseSecondOf4 t a c d (f a) -> f (TraverseSecondOf4 t a c d a)
forall (t :: * -> *) a c d (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b)
-> TraverseSecondOf4 t a c d a -> m (TraverseSecondOf4 t a c d b)
forall (t :: * -> *) a c d (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b)
-> TraverseSecondOf4 t a c d a -> f (TraverseSecondOf4 t a c d b)
$ctraverse :: forall (t :: * -> *) a c d (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b)
-> TraverseSecondOf4 t a c d a -> f (TraverseSecondOf4 t a c d b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> TraverseSecondOf4 t a c d a -> f (TraverseSecondOf4 t a c d b)
$csequenceA :: forall (t :: * -> *) a c d (f :: * -> *) a.
(Traversable t, Applicative f) =>
TraverseSecondOf4 t a c d (f a) -> f (TraverseSecondOf4 t a c d a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
TraverseSecondOf4 t a c d (f a) -> f (TraverseSecondOf4 t a c d a)
$cmapM :: forall (t :: * -> *) a c d (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b)
-> TraverseSecondOf4 t a c d a -> m (TraverseSecondOf4 t a c d b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> TraverseSecondOf4 t a c d a -> m (TraverseSecondOf4 t a c d b)
$csequence :: forall (t :: * -> *) a c d (m :: * -> *) a.
(Traversable t, Monad m) =>
TraverseSecondOf4 t a c d (m a) -> m (TraverseSecondOf4 t a c d a)
sequence :: forall (m :: * -> *) a.
Monad m =>
TraverseSecondOf4 t a c d (m a) -> m (TraverseSecondOf4 t a c d a)
Traversable)

data TraverseThirdOf4 t a b d c where
  TraverseThirdOf4 :: { forall (t :: * -> *) a b c d.
TraverseThirdOf4 t a b d c -> t (a, b, c, d)
thirdOf4Traversed :: t (a,b,c,d) } -> TraverseThirdOf4 t a b d c
 deriving ((forall a b.
 (a -> b)
 -> TraverseThirdOf4 t a b d a -> TraverseThirdOf4 t a b d b)
-> (forall a b.
    a -> TraverseThirdOf4 t a b d b -> TraverseThirdOf4 t a b d a)
-> Functor (TraverseThirdOf4 t a b d)
forall a b.
a -> TraverseThirdOf4 t a b d b -> TraverseThirdOf4 t a b d a
forall a b.
(a -> b)
-> TraverseThirdOf4 t a b d a -> TraverseThirdOf4 t a b d b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
forall (t :: * -> *) a b d a b.
Functor t =>
a -> TraverseThirdOf4 t a b d b -> TraverseThirdOf4 t a b d a
forall (t :: * -> *) a b d a b.
Functor t =>
(a -> b)
-> TraverseThirdOf4 t a b d a -> TraverseThirdOf4 t a b d b
$cfmap :: forall (t :: * -> *) a b d a b.
Functor t =>
(a -> b)
-> TraverseThirdOf4 t a b d a -> TraverseThirdOf4 t a b d b
fmap :: forall a b.
(a -> b)
-> TraverseThirdOf4 t a b d a -> TraverseThirdOf4 t a b d b
$c<$ :: forall (t :: * -> *) a b d a b.
Functor t =>
a -> TraverseThirdOf4 t a b d b -> TraverseThirdOf4 t a b d a
<$ :: forall a b.
a -> TraverseThirdOf4 t a b d b -> TraverseThirdOf4 t a b d a
Functor, (forall m. Monoid m => TraverseThirdOf4 t a b d m -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> TraverseThirdOf4 t a b d a -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> TraverseThirdOf4 t a b d a -> m)
-> (forall a b.
    (a -> b -> b) -> b -> TraverseThirdOf4 t a b d a -> b)
-> (forall a b.
    (a -> b -> b) -> b -> TraverseThirdOf4 t a b d a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> TraverseThirdOf4 t a b d a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> TraverseThirdOf4 t a b d a -> b)
-> (forall a. (a -> a -> a) -> TraverseThirdOf4 t a b d a -> a)
-> (forall a. (a -> a -> a) -> TraverseThirdOf4 t a b d a -> a)
-> (forall a. TraverseThirdOf4 t a b d a -> [a])
-> (forall a. TraverseThirdOf4 t a b d a -> Bool)
-> (forall a. TraverseThirdOf4 t a b d a -> Int)
-> (forall a. Eq a => a -> TraverseThirdOf4 t a b d a -> Bool)
-> (forall a. Ord a => TraverseThirdOf4 t a b d a -> a)
-> (forall a. Ord a => TraverseThirdOf4 t a b d a -> a)
-> (forall a. Num a => TraverseThirdOf4 t a b d a -> a)
-> (forall a. Num a => TraverseThirdOf4 t a b d a -> a)
-> Foldable (TraverseThirdOf4 t a b d)
forall a. Eq a => a -> TraverseThirdOf4 t a b d a -> Bool
forall a. Num a => TraverseThirdOf4 t a b d a -> a
forall a. Ord a => TraverseThirdOf4 t a b d a -> a
forall m. Monoid m => TraverseThirdOf4 t a b d m -> m
forall a. TraverseThirdOf4 t a b d a -> Bool
forall a. TraverseThirdOf4 t a b d a -> Int
forall a. TraverseThirdOf4 t a b d a -> [a]
forall a. (a -> a -> a) -> TraverseThirdOf4 t a b d a -> a
forall m a. Monoid m => (a -> m) -> TraverseThirdOf4 t a b d a -> m
forall b a. (b -> a -> b) -> b -> TraverseThirdOf4 t a b d a -> b
forall a b. (a -> b -> b) -> b -> TraverseThirdOf4 t a b d a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
forall (t :: * -> *) a b d a.
(Foldable t, Eq a) =>
a -> TraverseThirdOf4 t a b d a -> Bool
forall (t :: * -> *) a b d a.
(Foldable t, Num a) =>
TraverseThirdOf4 t a b d a -> a
forall (t :: * -> *) a b d a.
(Foldable t, Ord a) =>
TraverseThirdOf4 t a b d a -> a
forall (t :: * -> *) a b d m.
(Foldable t, Monoid m) =>
TraverseThirdOf4 t a b d m -> m
forall (t :: * -> *) a b d a.
Foldable t =>
TraverseThirdOf4 t a b d a -> Bool
forall (t :: * -> *) a b d a.
Foldable t =>
TraverseThirdOf4 t a b d a -> Int
forall (t :: * -> *) a b d a.
Foldable t =>
TraverseThirdOf4 t a b d a -> [a]
forall (t :: * -> *) a b d a.
Foldable t =>
(a -> a -> a) -> TraverseThirdOf4 t a b d a -> a
forall (t :: * -> *) a b d m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseThirdOf4 t a b d a -> m
forall (t :: * -> *) a b d b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseThirdOf4 t a b d a -> b
forall (t :: * -> *) a b d a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseThirdOf4 t a b d a -> b
$cfold :: forall (t :: * -> *) a b d m.
(Foldable t, Monoid m) =>
TraverseThirdOf4 t a b d m -> m
fold :: forall m. Monoid m => TraverseThirdOf4 t a b d m -> m
$cfoldMap :: forall (t :: * -> *) a b d m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseThirdOf4 t a b d a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> TraverseThirdOf4 t a b d a -> m
$cfoldMap' :: forall (t :: * -> *) a b d m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseThirdOf4 t a b d a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> TraverseThirdOf4 t a b d a -> m
$cfoldr :: forall (t :: * -> *) a b d a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseThirdOf4 t a b d a -> b
foldr :: forall a b. (a -> b -> b) -> b -> TraverseThirdOf4 t a b d a -> b
$cfoldr' :: forall (t :: * -> *) a b d a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseThirdOf4 t a b d a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> TraverseThirdOf4 t a b d a -> b
$cfoldl :: forall (t :: * -> *) a b d b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseThirdOf4 t a b d a -> b
foldl :: forall b a. (b -> a -> b) -> b -> TraverseThirdOf4 t a b d a -> b
$cfoldl' :: forall (t :: * -> *) a b d b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseThirdOf4 t a b d a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> TraverseThirdOf4 t a b d a -> b
$cfoldr1 :: forall (t :: * -> *) a b d a.
Foldable t =>
(a -> a -> a) -> TraverseThirdOf4 t a b d a -> a
foldr1 :: forall a. (a -> a -> a) -> TraverseThirdOf4 t a b d a -> a
$cfoldl1 :: forall (t :: * -> *) a b d a.
Foldable t =>
(a -> a -> a) -> TraverseThirdOf4 t a b d a -> a
foldl1 :: forall a. (a -> a -> a) -> TraverseThirdOf4 t a b d a -> a
$ctoList :: forall (t :: * -> *) a b d a.
Foldable t =>
TraverseThirdOf4 t a b d a -> [a]
toList :: forall a. TraverseThirdOf4 t a b d a -> [a]
$cnull :: forall (t :: * -> *) a b d a.
Foldable t =>
TraverseThirdOf4 t a b d a -> Bool
null :: forall a. TraverseThirdOf4 t a b d a -> Bool
$clength :: forall (t :: * -> *) a b d a.
Foldable t =>
TraverseThirdOf4 t a b d a -> Int
length :: forall a. TraverseThirdOf4 t a b d a -> Int
$celem :: forall (t :: * -> *) a b d a.
(Foldable t, Eq a) =>
a -> TraverseThirdOf4 t a b d a -> Bool
elem :: forall a. Eq a => a -> TraverseThirdOf4 t a b d a -> Bool
$cmaximum :: forall (t :: * -> *) a b d a.
(Foldable t, Ord a) =>
TraverseThirdOf4 t a b d a -> a
maximum :: forall a. Ord a => TraverseThirdOf4 t a b d a -> a
$cminimum :: forall (t :: * -> *) a b d a.
(Foldable t, Ord a) =>
TraverseThirdOf4 t a b d a -> a
minimum :: forall a. Ord a => TraverseThirdOf4 t a b d a -> a
$csum :: forall (t :: * -> *) a b d a.
(Foldable t, Num a) =>
TraverseThirdOf4 t a b d a -> a
sum :: forall a. Num a => TraverseThirdOf4 t a b d a -> a
$cproduct :: forall (t :: * -> *) a b d a.
(Foldable t, Num a) =>
TraverseThirdOf4 t a b d a -> a
product :: forall a. Num a => TraverseThirdOf4 t a b d a -> a
Foldable, Functor (TraverseThirdOf4 t a b d)
Foldable (TraverseThirdOf4 t a b d)
(Functor (TraverseThirdOf4 t a b d),
 Foldable (TraverseThirdOf4 t a b d)) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b)
 -> TraverseThirdOf4 t a b d a -> f (TraverseThirdOf4 t a b d b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    TraverseThirdOf4 t a b d (f a) -> f (TraverseThirdOf4 t a b d a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> TraverseThirdOf4 t a b d a -> m (TraverseThirdOf4 t a b d b))
-> (forall (m :: * -> *) a.
    Monad m =>
    TraverseThirdOf4 t a b d (m a) -> m (TraverseThirdOf4 t a b d a))
-> Traversable (TraverseThirdOf4 t a b d)
forall (t :: * -> *).
(Functor t, Foldable t) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
TraverseThirdOf4 t a b d (m a) -> m (TraverseThirdOf4 t a b d a)
forall (f :: * -> *) a.
Applicative f =>
TraverseThirdOf4 t a b d (f a) -> f (TraverseThirdOf4 t a b d a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> TraverseThirdOf4 t a b d a -> m (TraverseThirdOf4 t a b d b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> TraverseThirdOf4 t a b d a -> f (TraverseThirdOf4 t a b d b)
forall (t :: * -> *) a b d.
Traversable t =>
Functor (TraverseThirdOf4 t a b d)
forall (t :: * -> *) a b d.
Traversable t =>
Foldable (TraverseThirdOf4 t a b d)
forall (t :: * -> *) a b d (m :: * -> *) a.
(Traversable t, Monad m) =>
TraverseThirdOf4 t a b d (m a) -> m (TraverseThirdOf4 t a b d a)
forall (t :: * -> *) a b d (f :: * -> *) a.
(Traversable t, Applicative f) =>
TraverseThirdOf4 t a b d (f a) -> f (TraverseThirdOf4 t a b d a)
forall (t :: * -> *) a b d (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b)
-> TraverseThirdOf4 t a b d a -> m (TraverseThirdOf4 t a b d b)
forall (t :: * -> *) a b d (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b)
-> TraverseThirdOf4 t a b d a -> f (TraverseThirdOf4 t a b d b)
$ctraverse :: forall (t :: * -> *) a b d (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b)
-> TraverseThirdOf4 t a b d a -> f (TraverseThirdOf4 t a b d b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> TraverseThirdOf4 t a b d a -> f (TraverseThirdOf4 t a b d b)
$csequenceA :: forall (t :: * -> *) a b d (f :: * -> *) a.
(Traversable t, Applicative f) =>
TraverseThirdOf4 t a b d (f a) -> f (TraverseThirdOf4 t a b d a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
TraverseThirdOf4 t a b d (f a) -> f (TraverseThirdOf4 t a b d a)
$cmapM :: forall (t :: * -> *) a b d (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b)
-> TraverseThirdOf4 t a b d a -> m (TraverseThirdOf4 t a b d b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> TraverseThirdOf4 t a b d a -> m (TraverseThirdOf4 t a b d b)
$csequence :: forall (t :: * -> *) a b d (m :: * -> *) a.
(Traversable t, Monad m) =>
TraverseThirdOf4 t a b d (m a) -> m (TraverseThirdOf4 t a b d a)
sequence :: forall (m :: * -> *) a.
Monad m =>
TraverseThirdOf4 t a b d (m a) -> m (TraverseThirdOf4 t a b d a)
Traversable)

data TraverseFourth t a b c d where
  TraverseFourth :: { forall (t :: * -> *) a b c d.
TraverseFourth t a b c d -> t (a, b, c, d)
fourthTraversed :: t (a,b,c,d) } -> TraverseFourth t a b c d
 deriving ((forall a b.
 (a -> b) -> TraverseFourth t a b c a -> TraverseFourth t a b c b)
-> (forall a b.
    a -> TraverseFourth t a b c b -> TraverseFourth t a b c a)
-> Functor (TraverseFourth t a b c)
forall a b.
a -> TraverseFourth t a b c b -> TraverseFourth t a b c a
forall a b.
(a -> b) -> TraverseFourth t a b c a -> TraverseFourth t a b c b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
forall (t :: * -> *) a b c a b.
Functor t =>
a -> TraverseFourth t a b c b -> TraverseFourth t a b c a
forall (t :: * -> *) a b c a b.
Functor t =>
(a -> b) -> TraverseFourth t a b c a -> TraverseFourth t a b c b
$cfmap :: forall (t :: * -> *) a b c a b.
Functor t =>
(a -> b) -> TraverseFourth t a b c a -> TraverseFourth t a b c b
fmap :: forall a b.
(a -> b) -> TraverseFourth t a b c a -> TraverseFourth t a b c b
$c<$ :: forall (t :: * -> *) a b c a b.
Functor t =>
a -> TraverseFourth t a b c b -> TraverseFourth t a b c a
<$ :: forall a b.
a -> TraverseFourth t a b c b -> TraverseFourth t a b c a
Functor, (forall m. Monoid m => TraverseFourth t a b c m -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> TraverseFourth t a b c a -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> TraverseFourth t a b c a -> m)
-> (forall a b.
    (a -> b -> b) -> b -> TraverseFourth t a b c a -> b)
-> (forall a b.
    (a -> b -> b) -> b -> TraverseFourth t a b c a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> TraverseFourth t a b c a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> TraverseFourth t a b c a -> b)
-> (forall a. (a -> a -> a) -> TraverseFourth t a b c a -> a)
-> (forall a. (a -> a -> a) -> TraverseFourth t a b c a -> a)
-> (forall a. TraverseFourth t a b c a -> [a])
-> (forall a. TraverseFourth t a b c a -> Bool)
-> (forall a. TraverseFourth t a b c a -> Int)
-> (forall a. Eq a => a -> TraverseFourth t a b c a -> Bool)
-> (forall a. Ord a => TraverseFourth t a b c a -> a)
-> (forall a. Ord a => TraverseFourth t a b c a -> a)
-> (forall a. Num a => TraverseFourth t a b c a -> a)
-> (forall a. Num a => TraverseFourth t a b c a -> a)
-> Foldable (TraverseFourth t a b c)
forall a. Eq a => a -> TraverseFourth t a b c a -> Bool
forall a. Num a => TraverseFourth t a b c a -> a
forall a. Ord a => TraverseFourth t a b c a -> a
forall m. Monoid m => TraverseFourth t a b c m -> m
forall a. TraverseFourth t a b c a -> Bool
forall a. TraverseFourth t a b c a -> Int
forall a. TraverseFourth t a b c a -> [a]
forall a. (a -> a -> a) -> TraverseFourth t a b c a -> a
forall m a. Monoid m => (a -> m) -> TraverseFourth t a b c a -> m
forall b a. (b -> a -> b) -> b -> TraverseFourth t a b c a -> b
forall a b. (a -> b -> b) -> b -> TraverseFourth t a b c a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
forall (t :: * -> *) a b c a.
(Foldable t, Eq a) =>
a -> TraverseFourth t a b c a -> Bool
forall (t :: * -> *) a b c a.
(Foldable t, Num a) =>
TraverseFourth t a b c a -> a
forall (t :: * -> *) a b c a.
(Foldable t, Ord a) =>
TraverseFourth t a b c a -> a
forall (t :: * -> *) a b c m.
(Foldable t, Monoid m) =>
TraverseFourth t a b c m -> m
forall (t :: * -> *) a b c a.
Foldable t =>
TraverseFourth t a b c a -> Bool
forall (t :: * -> *) a b c a.
Foldable t =>
TraverseFourth t a b c a -> Int
forall (t :: * -> *) a b c a.
Foldable t =>
TraverseFourth t a b c a -> [a]
forall (t :: * -> *) a b c a.
Foldable t =>
(a -> a -> a) -> TraverseFourth t a b c a -> a
forall (t :: * -> *) a b c m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseFourth t a b c a -> m
forall (t :: * -> *) a b c b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseFourth t a b c a -> b
forall (t :: * -> *) a b c a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseFourth t a b c a -> b
$cfold :: forall (t :: * -> *) a b c m.
(Foldable t, Monoid m) =>
TraverseFourth t a b c m -> m
fold :: forall m. Monoid m => TraverseFourth t a b c m -> m
$cfoldMap :: forall (t :: * -> *) a b c m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseFourth t a b c a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> TraverseFourth t a b c a -> m
$cfoldMap' :: forall (t :: * -> *) a b c m a.
(Foldable t, Monoid m) =>
(a -> m) -> TraverseFourth t a b c a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> TraverseFourth t a b c a -> m
$cfoldr :: forall (t :: * -> *) a b c a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseFourth t a b c a -> b
foldr :: forall a b. (a -> b -> b) -> b -> TraverseFourth t a b c a -> b
$cfoldr' :: forall (t :: * -> *) a b c a b.
Foldable t =>
(a -> b -> b) -> b -> TraverseFourth t a b c a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> TraverseFourth t a b c a -> b
$cfoldl :: forall (t :: * -> *) a b c b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseFourth t a b c a -> b
foldl :: forall b a. (b -> a -> b) -> b -> TraverseFourth t a b c a -> b
$cfoldl' :: forall (t :: * -> *) a b c b a.
Foldable t =>
(b -> a -> b) -> b -> TraverseFourth t a b c a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> TraverseFourth t a b c a -> b
$cfoldr1 :: forall (t :: * -> *) a b c a.
Foldable t =>
(a -> a -> a) -> TraverseFourth t a b c a -> a
foldr1 :: forall a. (a -> a -> a) -> TraverseFourth t a b c a -> a
$cfoldl1 :: forall (t :: * -> *) a b c a.
Foldable t =>
(a -> a -> a) -> TraverseFourth t a b c a -> a
foldl1 :: forall a. (a -> a -> a) -> TraverseFourth t a b c a -> a
$ctoList :: forall (t :: * -> *) a b c a.
Foldable t =>
TraverseFourth t a b c a -> [a]
toList :: forall a. TraverseFourth t a b c a -> [a]
$cnull :: forall (t :: * -> *) a b c a.
Foldable t =>
TraverseFourth t a b c a -> Bool
null :: forall a. TraverseFourth t a b c a -> Bool
$clength :: forall (t :: * -> *) a b c a.
Foldable t =>
TraverseFourth t a b c a -> Int
length :: forall a. TraverseFourth t a b c a -> Int
$celem :: forall (t :: * -> *) a b c a.
(Foldable t, Eq a) =>
a -> TraverseFourth t a b c a -> Bool
elem :: forall a. Eq a => a -> TraverseFourth t a b c a -> Bool
$cmaximum :: forall (t :: * -> *) a b c a.
(Foldable t, Ord a) =>
TraverseFourth t a b c a -> a
maximum :: forall a. Ord a => TraverseFourth t a b c a -> a
$cminimum :: forall (t :: * -> *) a b c a.
(Foldable t, Ord a) =>
TraverseFourth t a b c a -> a
minimum :: forall a. Ord a => TraverseFourth t a b c a -> a
$csum :: forall (t :: * -> *) a b c a.
(Foldable t, Num a) =>
TraverseFourth t a b c a -> a
sum :: forall a. Num a => TraverseFourth t a b c a -> a
$cproduct :: forall (t :: * -> *) a b c a.
(Foldable t, Num a) =>
TraverseFourth t a b c a -> a
product :: forall a. Num a => TraverseFourth t a b c a -> a
Foldable, Functor (TraverseFourth t a b c)
Foldable (TraverseFourth t a b c)
(Functor (TraverseFourth t a b c),
 Foldable (TraverseFourth t a b c)) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b)
 -> TraverseFourth t a b c a -> f (TraverseFourth t a b c b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    TraverseFourth t a b c (f a) -> f (TraverseFourth t a b c a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> TraverseFourth t a b c a -> m (TraverseFourth t a b c b))
-> (forall (m :: * -> *) a.
    Monad m =>
    TraverseFourth t a b c (m a) -> m (TraverseFourth t a b c a))
-> Traversable (TraverseFourth t a b c)
forall (t :: * -> *).
(Functor t, Foldable t) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
TraverseFourth t a b c (m a) -> m (TraverseFourth t a b c a)
forall (f :: * -> *) a.
Applicative f =>
TraverseFourth t a b c (f a) -> f (TraverseFourth t a b c a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> TraverseFourth t a b c a -> m (TraverseFourth t a b c b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> TraverseFourth t a b c a -> f (TraverseFourth t a b c b)
forall (t :: * -> *) a b c.
Traversable t =>
Functor (TraverseFourth t a b c)
forall (t :: * -> *) a b c.
Traversable t =>
Foldable (TraverseFourth t a b c)
forall (t :: * -> *) a b c (m :: * -> *) a.
(Traversable t, Monad m) =>
TraverseFourth t a b c (m a) -> m (TraverseFourth t a b c a)
forall (t :: * -> *) a b c (f :: * -> *) a.
(Traversable t, Applicative f) =>
TraverseFourth t a b c (f a) -> f (TraverseFourth t a b c a)
forall (t :: * -> *) a b c (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b)
-> TraverseFourth t a b c a -> m (TraverseFourth t a b c b)
forall (t :: * -> *) a b c (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b)
-> TraverseFourth t a b c a -> f (TraverseFourth t a b c b)
$ctraverse :: forall (t :: * -> *) a b c (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b)
-> TraverseFourth t a b c a -> f (TraverseFourth t a b c b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> TraverseFourth t a b c a -> f (TraverseFourth t a b c b)
$csequenceA :: forall (t :: * -> *) a b c (f :: * -> *) a.
(Traversable t, Applicative f) =>
TraverseFourth t a b c (f a) -> f (TraverseFourth t a b c a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
TraverseFourth t a b c (f a) -> f (TraverseFourth t a b c a)
$cmapM :: forall (t :: * -> *) a b c (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b)
-> TraverseFourth t a b c a -> m (TraverseFourth t a b c b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> TraverseFourth t a b c a -> m (TraverseFourth t a b c b)
$csequence :: forall (t :: * -> *) a b c (m :: * -> *) a.
(Traversable t, Monad m) =>
TraverseFourth t a b c (m a) -> m (TraverseFourth t a b c a)
sequence :: forall (m :: * -> *) a.
Monad m =>
TraverseFourth t a b c (m a) -> m (TraverseFourth t a b c a)
Traversable)

instance (Show a, Show b, Show c, Show d) => Show (a,b,c,d) where
  showEach :: forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t (a, b, c, d) -> t ShowS
showEach PaddingMode
padMode Int
_
       = ((ShowS, ShowS, ShowS, ShowS) -> ShowS)
-> t (ShowS, ShowS, ShowS, ShowS) -> t ShowS
forall a b. (a -> b) -> t a -> t b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\(ShowS
sa,ShowS
sb,ShowS
sc,ShowS
sd) -> (Char
'('Char -> ShowS
forall a. a -> [a] -> [a]
:)ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.ShowS
saShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Char
','Char -> ShowS
forall a. a -> [a] -> [a]
:)ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.ShowS
sbShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Char
','Char -> ShowS
forall a. a -> [a] -> [a]
:)ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.ShowS
scShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Char
','Char -> ShowS
forall a. a -> [a] -> [a]
:)ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.ShowS
sdShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Char
')'Char -> ShowS
forall a. a -> [a] -> [a]
:))
             (t (ShowS, ShowS, ShowS, ShowS) -> t ShowS)
-> (t (a, b, c, d) -> t (ShowS, ShowS, ShowS, ShowS))
-> t (a, b, c, d)
-> t ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.  TraverseFirstOf4 t ShowS ShowS ShowS ShowS
-> t (ShowS, ShowS, ShowS, ShowS)
forall (t :: * -> *) a b c d.
TraverseFirstOf4 t b c d a -> t (a, b, c, d)
firstOf4Traversed (TraverseFirstOf4 t ShowS ShowS ShowS ShowS
 -> t (ShowS, ShowS, ShowS, ShowS))
-> (t (a, b, c, d) -> TraverseFirstOf4 t ShowS ShowS ShowS ShowS)
-> t (a, b, c, d)
-> t (ShowS, ShowS, ShowS, ShowS)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PaddingMode
-> Int
-> TraverseFirstOf4 t ShowS ShowS ShowS a
-> TraverseFirstOf4 t ShowS ShowS ShowS ShowS
forall a (t :: * -> *).
(Show a, Traversable t) =>
PaddingMode -> Int -> t a -> t ShowS
forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t a -> t ShowS
showEach PaddingMode
padMode Int
0 (TraverseFirstOf4 t ShowS ShowS ShowS a
 -> TraverseFirstOf4 t ShowS ShowS ShowS ShowS)
-> (t (a, b, c, d) -> TraverseFirstOf4 t ShowS ShowS ShowS a)
-> t (a, b, c, d)
-> TraverseFirstOf4 t ShowS ShowS ShowS ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. t (a, ShowS, ShowS, ShowS)
-> TraverseFirstOf4 t ShowS ShowS ShowS a
forall (t :: * -> *) a b c d.
t (a, b, c, d) -> TraverseFirstOf4 t b c d a
TraverseFirstOf4
             (t (a, ShowS, ShowS, ShowS)
 -> TraverseFirstOf4 t ShowS ShowS ShowS a)
-> (t (a, b, c, d) -> t (a, ShowS, ShowS, ShowS))
-> t (a, b, c, d)
-> TraverseFirstOf4 t ShowS ShowS ShowS a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TraverseSecondOf4 t a ShowS ShowS ShowS
-> t (a, ShowS, ShowS, ShowS)
forall (t :: * -> *) a b c d.
TraverseSecondOf4 t a c d b -> t (a, b, c, d)
secondOf4Traversed (TraverseSecondOf4 t a ShowS ShowS ShowS
 -> t (a, ShowS, ShowS, ShowS))
-> (t (a, b, c, d) -> TraverseSecondOf4 t a ShowS ShowS ShowS)
-> t (a, b, c, d)
-> t (a, ShowS, ShowS, ShowS)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PaddingMode
-> Int
-> TraverseSecondOf4 t a ShowS ShowS b
-> TraverseSecondOf4 t a ShowS ShowS ShowS
forall a (t :: * -> *).
(Show a, Traversable t) =>
PaddingMode -> Int -> t a -> t ShowS
forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t b -> t ShowS
showEach PaddingMode
padMode Int
0 (TraverseSecondOf4 t a ShowS ShowS b
 -> TraverseSecondOf4 t a ShowS ShowS ShowS)
-> (t (a, b, c, d) -> TraverseSecondOf4 t a ShowS ShowS b)
-> t (a, b, c, d)
-> TraverseSecondOf4 t a ShowS ShowS ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. t (a, b, ShowS, ShowS) -> TraverseSecondOf4 t a ShowS ShowS b
forall (t :: * -> *) a b c d.
t (a, b, c, d) -> TraverseSecondOf4 t a c d b
TraverseSecondOf4
             (t (a, b, ShowS, ShowS) -> TraverseSecondOf4 t a ShowS ShowS b)
-> (t (a, b, c, d) -> t (a, b, ShowS, ShowS))
-> t (a, b, c, d)
-> TraverseSecondOf4 t a ShowS ShowS b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.  TraverseThirdOf4 t a b ShowS ShowS -> t (a, b, ShowS, ShowS)
forall (t :: * -> *) a b c d.
TraverseThirdOf4 t a b d c -> t (a, b, c, d)
thirdOf4Traversed (TraverseThirdOf4 t a b ShowS ShowS -> t (a, b, ShowS, ShowS))
-> (t (a, b, c, d) -> TraverseThirdOf4 t a b ShowS ShowS)
-> t (a, b, c, d)
-> t (a, b, ShowS, ShowS)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PaddingMode
-> Int
-> TraverseThirdOf4 t a b ShowS c
-> TraverseThirdOf4 t a b ShowS ShowS
forall a (t :: * -> *).
(Show a, Traversable t) =>
PaddingMode -> Int -> t a -> t ShowS
forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t c -> t ShowS
showEach PaddingMode
padMode Int
0 (TraverseThirdOf4 t a b ShowS c
 -> TraverseThirdOf4 t a b ShowS ShowS)
-> (t (a, b, c, d) -> TraverseThirdOf4 t a b ShowS c)
-> t (a, b, c, d)
-> TraverseThirdOf4 t a b ShowS ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. t (a, b, c, ShowS) -> TraverseThirdOf4 t a b ShowS c
forall (t :: * -> *) a b c d.
t (a, b, c, d) -> TraverseThirdOf4 t a b d c
TraverseThirdOf4
             (t (a, b, c, ShowS) -> TraverseThirdOf4 t a b ShowS c)
-> (t (a, b, c, d) -> t (a, b, c, ShowS))
-> t (a, b, c, d)
-> TraverseThirdOf4 t a b ShowS c
forall b c a. (b -> c) -> (a -> b) -> a -> c
.    TraverseFourth t a b c ShowS -> t (a, b, c, ShowS)
forall (t :: * -> *) a b c d.
TraverseFourth t a b c d -> t (a, b, c, d)
fourthTraversed (TraverseFourth t a b c ShowS -> t (a, b, c, ShowS))
-> (t (a, b, c, d) -> TraverseFourth t a b c ShowS)
-> t (a, b, c, d)
-> t (a, b, c, ShowS)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PaddingMode
-> Int -> TraverseFourth t a b c d -> TraverseFourth t a b c ShowS
forall a (t :: * -> *).
(Show a, Traversable t) =>
PaddingMode -> Int -> t a -> t ShowS
forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t d -> t ShowS
showEach PaddingMode
padMode Int
0 (TraverseFourth t a b c d -> TraverseFourth t a b c ShowS)
-> (t (a, b, c, d) -> TraverseFourth t a b c d)
-> t (a, b, c, d)
-> TraverseFourth t a b c ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. t (a, b, c, d) -> TraverseFourth t a b c d
forall (t :: * -> *) a b c d.
t (a, b, c, d) -> TraverseFourth t a b c d
TraverseFourth

instance (Integral i, Show i) => Show (Ratio i) where
  showsPrec :: Int -> Ratio i -> ShowS
showsPrec Int
p Ratio i
n
   | Ratio i
nRatio i -> Ratio i -> Bool
forall a. Ord a => a -> a -> Bool
<Ratio i
0                 = Bool -> ShowS -> ShowS
showParen (Int
pInt -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>Int
5) (ShowS -> ShowS) -> ShowS -> ShowS
forall a b. (a -> b) -> a -> b
$ (Char
'-'Char -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Ratio i -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
6 (-Ratio i
n)
   | Ratio i -> i
forall a. Ratio a -> a
denominator Ratio i
n i -> i -> Bool
forall a. Eq a => a -> a -> Bool
== i
1  = i -> ShowS
forall a. Show a => a -> ShowS
shows (i -> ShowS) -> i -> ShowS
forall a b. (a -> b) -> a -> b
$ Ratio i -> i
forall a. Ratio a -> a
numerator Ratio i
n
   | Bool
otherwise           = Bool -> ShowS -> ShowS
showParen (Int
pInt -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>Int
6) (ShowS -> ShowS) -> ShowS -> ShowS
forall a b. (a -> b) -> a -> b
$ i -> ShowS
forall a. Show a => a -> ShowS
shows (Ratio i -> i
forall a. Ratio a -> a
numerator Ratio i
n)
                                              ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char
'/'Char -> ShowS
forall a. a -> [a] -> [a]
:) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. i -> ShowS
forall a. Show a => a -> ShowS
shows (Ratio i -> i
forall a. Ratio a -> a
denominator Ratio i
n)

instance Show (Complex Double) where
  showsPrec :: Int -> Complex Double -> ShowS
showsPrec = Int -> Int -> Complex Double -> ShowS
forall r.
(RealFloat r, ShowMagnitudeRangeLimited r) =>
Int -> Int -> Complex r -> ShowS
ltdPrecShowsPrecComplex Int
10
  showEach :: forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t (Complex Double) -> t ShowS
showEach = (Complex Double -> Double)
-> Int -> PaddingMode -> Int -> t (Complex Double) -> t ShowS
forall n (list :: * -> *) sn.
(ShowMagnitudeRangeLimited n, RealFloat sn, Traversable list) =>
(n -> sn) -> Int -> PaddingMode -> Int -> list n -> list ShowS
showsPrecWithSharedPrecision Complex Double -> Double
forall a. RealFloat a => Complex a -> a
magnitude Int
10
instance Show (Complex Float) where
  showsPrec :: Int -> Complex Float -> ShowS
showsPrec = Int -> Int -> Complex Float -> ShowS
forall r.
(RealFloat r, ShowMagnitudeRangeLimited r) =>
Int -> Int -> Complex r -> ShowS
ltdPrecShowsPrecComplex Int
7
  showEach :: forall (t :: * -> *).
Traversable t =>
PaddingMode -> Int -> t (Complex Float) -> t ShowS
showEach = (Complex Float -> Float)
-> Int -> PaddingMode -> Int -> t (Complex Float) -> t ShowS
forall n (list :: * -> *) sn.
(ShowMagnitudeRangeLimited n, RealFloat sn, Traversable list) =>
(n -> sn) -> Int -> PaddingMode -> Int -> list n -> list ShowS
showsPrecWithSharedPrecision Complex Float -> Float
forall a. RealFloat a => Complex a -> a
magnitude Int
7
instance (RealFloat a, Show (Complex a), ShowMagnitudeRangeLimited a)
    => ShowMagnitudeRangeLimited (Complex a) where
  showsPrecMagnitudeRangeLimited :: Int -> Int -> Complex a -> ShowS
showsPrecMagnitudeRangeLimited = Int -> Int -> Complex a -> ShowS
forall r.
(RealFloat r, ShowMagnitudeRangeLimited r) =>
Int -> Int -> Complex r -> ShowS
ltdPrecShowsPrecComplex

ltdPrecShowsPrecComplex :: (RealFloat r, ShowMagnitudeRangeLimited r)
                           => Int -> Int -> Complex r -> ShowS
ltdPrecShowsPrecComplex :: forall r.
(RealFloat r, ShowMagnitudeRangeLimited r) =>
Int -> Int -> Complex r -> ShowS
ltdPrecShowsPrecComplex Int
precision Int
p (r
r:+r
i)
 | r -> r
forall a. Num a => a -> a
abs r
r r -> r -> Bool
forall a. Ord a => a -> a -> Bool
> r -> r
forall a. Num a => a -> a
abs r
i r -> r -> r
forall a. Num a => a -> a -> a
* r
10r -> Int -> r
forall a b. (Num a, Integral b) => a -> b -> a
^Int
precision
    = Int -> Int -> r -> ShowS
forall n. RealFloat n => Int -> Int -> n -> ShowS
ltdPrecShowsPrec Int
precision Int
p r
r
 | Bool
otherwise
    = case (ShowS -> ShowS
forall a b. (a -> b) -> a -> b
$ String
"")(ShowS -> String) -> [ShowS] -> [String]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>(r -> r) -> Int -> PaddingMode -> Int -> [r] -> [ShowS]
forall n (list :: * -> *) sn.
(ShowMagnitudeRangeLimited n, RealFloat sn, Traversable list) =>
(n -> sn) -> Int -> PaddingMode -> Int -> list n -> list ShowS
showsPrecWithSharedPrecision r -> r
forall a. a -> a
id Int
precision PaddingMode
NoPadding Int
6 [r
r,r
i] of
           [String
sr,String
"0"] -> Bool -> ShowS -> ShowS
showParen (Int
pInt -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>Int
7) (ShowS -> ShowS) -> ShowS -> ShowS
forall a b. (a -> b) -> a -> b
$ (String
srString -> ShowS
forall a. [a] -> [a] -> [a]
++)
           [String
sr,String
si] -> Bool -> ShowS -> ShowS
showParen (Int
pInt -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>Int
6) (ShowS -> ShowS) -> ShowS -> ShowS
forall a b. (a -> b) -> a -> b
$ (String
srString -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String
":+"String -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String
siString -> ShowS
forall a. [a] -> [a] -> [a]
++)

-- | Drop-in for the standard screen-displaying function. This is useful as a GHCi
--   evaluation action; invoke with
-- @
-- $ ghci -interactive-print=Text.Show.Pragmatic.print
-- @
--   to get more concise output from the REPL.
print :: Show a => a -> IO ()
print :: forall a. Show a => a -> IO ()
print = String -> IO ()
putStrLn (String -> IO ()) -> (a -> String) -> a -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> String
forall a. Show a => a -> String
show