module Show where import DataTypes import Prec import ArrowClasses(Arrow(arr,(<<<)), (<**), ArrowChoice((|||)), ArrowSymbol(showSymbol), ArrowPrec(mayShowParen,setPrec), ArrowReadShow) pshow_f0 :: ArrowReadShow a => a b () -> a [b] () pshow_f0 p = (\f -> asTypeOf ((fshowSum_f0 (f undefined) p (pshow_f0 p)) <<< (arr out_f0)) (arr ((const ()) . f))) constructorNamesAndArities_f0 pshow_f1A :: ArrowReadShow a => a b () -> a (A b) () pshow_f1A p = (\f -> asTypeOf ((fshowSum_f1A (f undefined) p (pshow_f1A p)) <<< (arr out_f1A)) (arr ((const ()) . f))) constructorNamesAndArities_f1A pshow_f4Tree :: ArrowReadShow a => a b () -> a (Tree b) () pshow_f4Tree p = (\f -> asTypeOf ((fshowSum_f4Tree (f undefined) p (pshow_f4Tree p)) <<< (arr out_f4Tree)) (arr ((const ()) . f))) constructorNamesAndArities_f4Tree pshow_f4Rose :: ArrowReadShow a => a b () -> a (Rose b) () pshow_f4Rose p = (\f -> asTypeOf ((fshowSum_f4Rose (f undefined) p (pshow_f4Rose p)) <<< (arr out_f4Rose)) (arr ((const ()) . f))) constructorNamesAndArities_f4Rose pshow_f4List :: ArrowReadShow a => a b () -> a (List b) () pshow_f4List p = (\f -> asTypeOf ((fshowSum_f4List (f undefined) p (pshow_f4List p)) <<< (arr out_f4List)) (arr ((const ()) . f))) constructorNamesAndArities_f4List pshow_f10TreeOfList :: ArrowReadShow a => a b () -> a (TreeOfList b) () pshow_f10TreeOfList p = (\f -> asTypeOf ((fshowSum_f10TreeOfList (f undefined) p (pshow_f10TreeOfList p)) <<< (arr out_f10TreeOfList)) (arr ((const ()) . f))) constructorNamesAndArities_f10TreeOfList pshow_f8RoseTree :: ArrowReadShow a => a b () -> a (RoseTree b) () pshow_f8RoseTree p = (\f -> asTypeOf ((fshowSum_f8RoseTree (f undefined) p (pshow_f8RoseTree p)) <<< (arr out_f8RoseTree)) (arr ((const ()) . f))) constructorNamesAndArities_f8RoseTree pshow_f5Maybe :: ArrowReadShow a => a b () -> a (Maybe b) () pshow_f5Maybe p = (\f -> asTypeOf ((fshowSum_f5Maybe (f undefined) p (pshow_f5Maybe p)) <<< (arr out_f5Maybe)) (arr ((const ()) . f))) constructorNamesAndArities_f5Maybe fshowSum_f0 :: ArrowReadShow a => [([Char], Int)] -> a b () -> a c () -> a (Either () (b, c)) () fshowSum_f0 = \(s : ss) p r -> (fshowSum_e (s : []) p r) ||| (fshowSum_Ppr ss p r) out_f0 :: [a] -> Either () (a, [a]) out_f0 x = case x of [] -> Left () (a : b) -> Right (a, b) constructorNamesAndArities_f0 :: [a] -> [([Char], Int)] constructorNamesAndArities_f0 = fconstructorNamesAndArities_f0 . out_f0 fshowSum_f1A :: ArrowReadShow a => [([Char], Int)] -> a b () -> a c () -> a (Either () (Either c (c, (b, c)))) () fshowSum_f1A = \(s : ss) p r -> (fshowSum_e (s : []) p r) ||| (fshowSum_SrPrPpr ss p r) out_f1A :: A a -> Either () (Either (A a) (A a, (a, A a))) out_f1A x = case x of B -> Left () (C a) -> Right (Left a) (D a b c) -> Right (Right (a, (b, c))) constructorNamesAndArities_f1A :: A a -> [([Char], Int)] constructorNamesAndArities_f1A = fconstructorNamesAndArities_f1A . out_f1A fshowSum_f4Tree :: ArrowReadShow a => [([Char], Int)] -> a b () -> a c () -> a (Either b (c, c)) () fshowSum_f4Tree = \(s : ss) p r -> (fshowSum_p (s : []) p r) ||| (fshowSum_Prr ss p r) out_f4Tree :: Tree a -> Either a (Tree a, Tree a) out_f4Tree x = case x of (Leaf a) -> Left a (Bin a b) -> Right (a, b) constructorNamesAndArities_f4Tree :: Tree a -> [([Char], Int)] constructorNamesAndArities_f4Tree = fconstructorNamesAndArities_f4Tree . out_f4Tree fshowSum_f4Rose :: ArrowReadShow a => [([Char], Int)] -> a b () -> a c () -> a (b, [c]) () fshowSum_f4Rose = \(s : ss) p r -> mayShowParen (prec s) ((showSymbol (fst s)) <<< (fshowProd_PpA0r p r)) out_f4Rose :: Rose a -> (a, [Rose a]) out_f4Rose x = case x of (Fork a b) -> (a, b) constructorNamesAndArities_f4Rose :: Rose a -> [([Char], Int)] constructorNamesAndArities_f4Rose = fconstructorNamesAndArities_f4Rose . out_f4Rose fshowSum_f4List :: ArrowReadShow a => [([Char], Int)] -> a b () -> a c () -> a (Either () (b, c)) () fshowSum_f4List = \(s : ss) p r -> (fshowSum_e (s : []) p r) ||| (fshowSum_Ppr ss p r) out_f4List :: List a -> Either () (a, List a) out_f4List x = case x of Nil -> Left () (Cons a b) -> Right (a, b) constructorNamesAndArities_f4List :: List a -> [([Char], Int)] constructorNamesAndArities_f4List = fconstructorNamesAndArities_f4List . out_f4List fshowSum_f10TreeOfList :: ArrowReadShow a => [([Char], Int)] -> a b () -> a c () -> a (Tree (List b)) () fshowSum_f10TreeOfList = \(s : ss) p r -> mayShowParen (prec s) ((showSymbol (fst s)) <<< (fshowProd_A4TreeA4Listp p r)) out_f10TreeOfList :: TreeOfList a -> Tree (List a) out_f10TreeOfList x = case x of (TL a) -> a constructorNamesAndArities_f10TreeOfList :: TreeOfList a -> [([Char], Int)] constructorNamesAndArities_f10TreeOfList = fconstructorNamesAndArities_f10TreeOfList . out_f10TreeOfList fshowSum_f8RoseTree :: ArrowReadShow a => [([Char], Int)] -> a b () -> a c () -> a (b, List c) () fshowSum_f8RoseTree = \(s : ss) p r -> mayShowParen (prec s) ((showSymbol (fst s)) <<< (fshowProd_PpA4Listr p r)) out_f8RoseTree :: RoseTree a -> (a, List (RoseTree a)) out_f8RoseTree x = case x of (Fork2 a b) -> (a, b) constructorNamesAndArities_f8RoseTree :: RoseTree a -> [([Char], Int)] constructorNamesAndArities_f8RoseTree = fconstructorNamesAndArities_f8RoseTree . out_f8RoseTree fshowSum_f5Maybe :: ArrowReadShow a => [([Char], Int)] -> a b () -> a c () -> a (Either () b) () fshowSum_f5Maybe = \(s : ss) p r -> (fshowSum_e (s : []) p r) ||| (fshowSum_p ss p r) out_f5Maybe :: Maybe a -> Either () a out_f5Maybe x = case x of Nothing -> Left () (Just a) -> Right a constructorNamesAndArities_f5Maybe :: Maybe a -> [([Char], Int)] constructorNamesAndArities_f5Maybe = fconstructorNamesAndArities_f5Maybe . out_f5Maybe fshowSum_e :: ArrowReadShow a => [([Char], Int)] -> a b () -> a c () -> a () () fshowSum_e = \(s : ss) p r -> mayShowParen (prec s) ((showSymbol (fst s)) <<< (fshowProd_e p r)) fshowSum_Ppr :: ArrowReadShow a => [([Char], Int)] -> a b () -> a c () -> a (b, c) () fshowSum_Ppr = \(s : ss) p r -> mayShowParen (prec s) ((showSymbol (fst s)) <<< (fshowProd_Ppr p r)) fconstructorNamesAndArities_f0 :: Either () (a, b) -> [([Char], Int)] fconstructorNamesAndArities_f0 x = map (mapFst fconstructorName_f0) (asTypeOf fconstructorsAndArities_f0 ((x, undefined) : [])) fshowSum_SrPrPpr :: ArrowReadShow a => [([Char], Int)] -> a b () -> a c () -> a (Either c (c, (b, c))) () fshowSum_SrPrPpr = \(s : ss) p r -> (fshowSum_r (s : []) p r) ||| (fshowSum_PrPpr ss p r) fconstructorNamesAndArities_f1A :: Either () (Either a (a, (b, a))) -> [([Char], Int)] fconstructorNamesAndArities_f1A x = map (mapFst fconstructorName_f1A) (asTypeOf fconstructorsAndArities_f1A ((x, undefined) : [])) fshowSum_p :: ArrowReadShow a => [([Char], Int)] -> a b () -> a c () -> a b () fshowSum_p = \(s : ss) p r -> mayShowParen (prec s) ((showSymbol (fst s)) <<< (fshowProd_p p r)) fshowSum_Prr :: ArrowReadShow a => [([Char], Int)] -> a b () -> a c () -> a (c, c) () fshowSum_Prr = \(s : ss) p r -> mayShowParen (prec s) ((showSymbol (fst s)) <<< (fshowProd_Prr p r)) fconstructorNamesAndArities_f4Tree :: Either a (b, b) -> [([Char], Int)] fconstructorNamesAndArities_f4Tree x = map (mapFst fconstructorName_f4Tree) (asTypeOf fconstructorsAndArities_f4Tree ((x, undefined) : [])) prec :: ([Char], Int) -> Int prec p = case (snd p) == 0 of True -> high _ -> high - 1 fshowProd_PpA0r :: ArrowReadShow a => a b () -> a c () -> a (b, [c]) () fshowProd_PpA0r = \p r -> (arr (\((), ()) -> ())) <<< ((fshowProd_p p r) <** (fshowProd_A0r p r)) fconstructorNamesAndArities_f4Rose :: (a, [b]) -> [([Char], Int)] fconstructorNamesAndArities_f4Rose x = map (mapFst fconstructorName_f4Rose) (asTypeOf fconstructorsAndArities_f4Rose ((x, undefined) : [])) fconstructorNamesAndArities_f4List :: Either () (a, b) -> [([Char], Int)] fconstructorNamesAndArities_f4List x = map (mapFst fconstructorName_f4List) (asTypeOf fconstructorsAndArities_f4List ((x, undefined) : [])) fshowProd_A4TreeA4Listp :: ArrowReadShow a => a b () -> a c () -> a (Tree (List b)) () fshowProd_A4TreeA4Listp = \p r -> (showSymbol " ") <<< (setPrec high (fshowRest_A4TreeA4Listp p r)) fconstructorNamesAndArities_f10TreeOfList :: Tree (List a) -> [([Char], Int)] fconstructorNamesAndArities_f10TreeOfList x = map (mapFst fconstructorName_f10TreeOfList) (asTypeOf fconstructorsAndArities_f10TreeOfList ((x, undefined) : [])) fshowProd_PpA4Listr :: ArrowReadShow a => a b () -> a c () -> a (b, List c) () fshowProd_PpA4Listr = \p r -> (arr (\((), ()) -> ())) <<< ((fshowProd_p p r) <** (fshowProd_A4Listr p r)) fconstructorNamesAndArities_f8RoseTree :: (a, List b) -> [([Char], Int)] fconstructorNamesAndArities_f8RoseTree x = map (mapFst fconstructorName_f8RoseTree) (asTypeOf fconstructorsAndArities_f8RoseTree ((x, undefined) : [])) fconstructorNamesAndArities_f5Maybe :: Either () a -> [([Char], Int)] fconstructorNamesAndArities_f5Maybe x = map (mapFst fconstructorName_f5Maybe) (asTypeOf fconstructorsAndArities_f5Maybe ((x, undefined) : [])) fshowProd_e :: ArrowReadShow a => a b () -> a c () -> a () () fshowProd_e = \p r -> arr id fshowProd_Ppr :: ArrowReadShow a => a b () -> a c () -> a (b, c) () fshowProd_Ppr = \p r -> (arr (\((), ()) -> ())) <<< ((fshowProd_p p r) <** (fshowProd_r p r)) mapFst :: (a -> b) -> (a, c) -> (b, c) mapFst f p = (f (fst p), snd p) fconstructorName_f0 :: Either () (a, b) -> [Char] fconstructorName_f0 = either (\_ -> "[]") (\_ -> ":") fconstructorsAndArities_f0 :: [(Either () (a, b), Int)] fconstructorsAndArities_f0 = (map (mapFst Left) fconstructorsAndArities_e) ++ (map (mapFst Right) fconstructorsAndArities_Ppr) fshowSum_r :: ArrowReadShow a => [([Char], Int)] -> a b () -> a c () -> a c () fshowSum_r = \(s : ss) p r -> mayShowParen (prec s) ((showSymbol (fst s)) <<< (fshowProd_r p r)) fshowSum_PrPpr :: ArrowReadShow a => [([Char], Int)] -> a b () -> a c () -> a (c, (b, c)) () fshowSum_PrPpr = \(s : ss) p r -> mayShowParen (prec s) ((showSymbol (fst s)) <<< (fshowProd_PrPpr p r)) fconstructorName_f1A :: Either () (Either a (a, (b, a))) -> [Char] fconstructorName_f1A = either (\_ -> "B") (either (\_ -> "C") (\_ -> "D")) fconstructorsAndArities_f1A :: [(Either () (Either a (a, (b, a))), Int)] fconstructorsAndArities_f1A = (map (mapFst Left) fconstructorsAndArities_e) ++ (map (mapFst Right) fconstructorsAndArities_SrPrPpr) fshowProd_p :: ArrowReadShow a => a b () -> a c () -> a b () fshowProd_p = \p r -> (showSymbol " ") <<< (setPrec high (fshowRest_p p r)) fshowProd_Prr :: ArrowReadShow a => a b () -> a c () -> a (c, c) () fshowProd_Prr = \p r -> (arr (\((), ()) -> ())) <<< ((fshowProd_r p r) <** (fshowProd_r p r)) fconstructorName_f4Tree :: Either a (b, b) -> [Char] fconstructorName_f4Tree = either (\_ -> "Leaf") (\_ -> "Bin") fconstructorsAndArities_f4Tree :: [(Either a (b, b), Int)] fconstructorsAndArities_f4Tree = (map (mapFst Left) fconstructorsAndArities_p) ++ (map (mapFst Right) fconstructorsAndArities_Prr) fshowProd_A0r :: ArrowReadShow a => a b () -> a c () -> a [c] () fshowProd_A0r = \p r -> (showSymbol " ") <<< (setPrec high (fshowRest_A0r p r)) fconstructorName_f4Rose :: (a, [b]) -> [Char] fconstructorName_f4Rose = \_ -> "Fork" fconstructorsAndArities_f4Rose :: [((a, [b]), Int)] fconstructorsAndArities_f4Rose = (\x -> (x, fconstructorArity_PpA0r x) : []) undefined fconstructorName_f4List :: Either () (a, b) -> [Char] fconstructorName_f4List = either (\_ -> "Nil") (\_ -> "Cons") fconstructorsAndArities_f4List :: [(Either () (a, b), Int)] fconstructorsAndArities_f4List = (map (mapFst Left) fconstructorsAndArities_e) ++ (map (mapFst Right) fconstructorsAndArities_Ppr) fshowRest_A4TreeA4Listp :: ArrowReadShow a => a b () -> a c () -> a (Tree (List b)) () fshowRest_A4TreeA4Listp = \p r -> pshow_f4Tree (fshowRest_A4Listp p r) fconstructorName_f10TreeOfList :: Tree (List a) -> [Char] fconstructorName_f10TreeOfList = \_ -> "TL" fconstructorsAndArities_f10TreeOfList :: [(Tree (List a), Int)] fconstructorsAndArities_f10TreeOfList = (\x -> (x, fconstructorArity_A4TreeA4Listp x) : []) undefined fshowProd_A4Listr :: ArrowReadShow a => a b () -> a c () -> a (List c) () fshowProd_A4Listr = \p r -> (showSymbol " ") <<< (setPrec high (fshowRest_A4Listr p r)) fconstructorName_f8RoseTree :: (a, List b) -> [Char] fconstructorName_f8RoseTree = \_ -> "Fork2" fconstructorsAndArities_f8RoseTree :: [((a, List b), Int)] fconstructorsAndArities_f8RoseTree = (\x -> (x, fconstructorArity_PpA4Listr x) : []) undefined fconstructorName_f5Maybe :: Either () a -> [Char] fconstructorName_f5Maybe = either (\_ -> "Nothing") (\_ -> "Just") fconstructorsAndArities_f5Maybe :: [(Either () a, Int)] fconstructorsAndArities_f5Maybe = (map (mapFst Left) fconstructorsAndArities_e) ++ (map (mapFst Right) fconstructorsAndArities_p) fshowProd_r :: ArrowReadShow a => a b () -> a c () -> a c () fshowProd_r = \p r -> (showSymbol " ") <<< (setPrec high (fshowRest_r p r)) fconstructorsAndArities_e :: [((), Int)] fconstructorsAndArities_e = (\x -> (x, fconstructorArity_e x) : []) undefined fconstructorsAndArities_Ppr :: [((a, b), Int)] fconstructorsAndArities_Ppr = (\x -> (x, fconstructorArity_Ppr x) : []) undefined fshowProd_PrPpr :: ArrowReadShow a => a b () -> a c () -> a (c, (b, c)) () fshowProd_PrPpr = \p r -> (arr (\((), ()) -> ())) <<< ((fshowProd_r p r) <** (fshowProd_Ppr p r)) fconstructorsAndArities_SrPrPpr :: [(Either a (a, (b, a)), Int)] fconstructorsAndArities_SrPrPpr = (map (mapFst Left) fconstructorsAndArities_r) ++ (map (mapFst Right) fconstructorsAndArities_PrPpr) fshowRest_p :: ArrowReadShow a => a b () -> a c () -> a b () fshowRest_p = \p r -> p fconstructorsAndArities_p :: [(a, Int)] fconstructorsAndArities_p = (\x -> (x, fconstructorArity_p x) : []) undefined fconstructorsAndArities_Prr :: [((a, a), Int)] fconstructorsAndArities_Prr = (\x -> (x, fconstructorArity_Prr x) : []) undefined fshowRest_A0r :: ArrowReadShow a => a b () -> a c () -> a [c] () fshowRest_A0r = \p r -> pshow_f0 (fshowRest_r p r) fconstructorArity_PpA0r :: (a, [b]) -> Int fconstructorArity_PpA0r = \p -> (fconstructorArity_p (fst p)) + (fconstructorArity_A0r (snd p)) fshowRest_A4Listp :: ArrowReadShow a => a b () -> a c () -> a (List b) () fshowRest_A4Listp = \p r -> pshow_f4List (fshowRest_p p r) fconstructorArity_A4TreeA4Listp :: Tree (List a) -> Int fconstructorArity_A4TreeA4Listp = const 1 fshowRest_A4Listr :: ArrowReadShow a => a b () -> a c () -> a (List c) () fshowRest_A4Listr = \p r -> pshow_f4List (fshowRest_r p r) fconstructorArity_PpA4Listr :: (a, List b) -> Int fconstructorArity_PpA4Listr = \p -> (fconstructorArity_p (fst p)) + (fconstructorArity_A4Listr (snd p)) fshowRest_r :: ArrowReadShow a => a b () -> a c () -> a c () fshowRest_r = \p r -> r fconstructorArity_e :: () -> Int fconstructorArity_e = const 0 fconstructorArity_Ppr :: (a, b) -> Int fconstructorArity_Ppr = \p -> (fconstructorArity_p (fst p)) + (fconstructorArity_r (snd p)) fconstructorsAndArities_r :: [(a, Int)] fconstructorsAndArities_r = (\x -> (x, fconstructorArity_r x) : []) undefined fconstructorsAndArities_PrPpr :: [((a, (b, a)), Int)] fconstructorsAndArities_PrPpr = (\x -> (x, fconstructorArity_PrPpr x) : []) undefined fconstructorArity_p :: a -> Int fconstructorArity_p = const 1 fconstructorArity_Prr :: (a, a) -> Int fconstructorArity_Prr = \p -> (fconstructorArity_r (fst p)) + (fconstructorArity_r (snd p)) fconstructorArity_A0r :: [a] -> Int fconstructorArity_A0r = const 1 fconstructorArity_A4Listr :: List a -> Int fconstructorArity_A4Listr = const 1 fconstructorArity_r :: a -> Int fconstructorArity_r = const 1 fconstructorArity_PrPpr :: (a, (b, a)) -> Int fconstructorArity_PrPpr = \p -> (fconstructorArity_r (fst p)) + (fconstructorArity_Ppr (snd p))