/usr/share/doc/libghc-semigroupoids-doc/html/semigroupoids.txt is in libghc-semigroupoids-doc 5.2.1-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 | -- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Semigroupoids: Category sans id
--
-- Provides a wide array of (semi)groupoids and operations for working
-- with them.
--
-- A <a>Semigroupoid</a> is a <a>Category</a> without the requirement of
-- identity arrows for every object in the category.
--
-- A <a>Category</a> is any <a>Semigroupoid</a> for which the Yoneda
-- lemma holds.
--
-- When working with comonads you often have the <tt><*></tt>
-- portion of an <tt>Applicative</tt>, but not the <tt>pure</tt>. This
-- was captured in Uustalu and Vene's "Essence of Dataflow Programming"
-- in the form of the <tt>ComonadZip</tt> class in the days before
-- <tt>Applicative</tt>. Apply provides a weaker invariant, but for the
-- comonads used for data flow programming (found in the streams
-- package), this invariant is preserved. Applicative function
-- composition forms a semigroupoid.
--
-- Similarly many structures are nearly a comonad, but not quite, for
-- instance lists provide a reasonable <a>extend</a> operation in the
-- form of <a>tails</a>, but do not always contain a value.
--
-- Ideally the following relationships would hold:
--
-- <pre>
-- Foldable ----> Traversable <--- Functor ------> Alt ---------> Plus Semigroupoid
-- | | | | |
-- v v v v v
-- Foldable1 ---> Traversable1 Apply --------> Applicative -> Alternative Category
-- | | | |
-- v v v v
-- Bind ---------> Monad -------> MonadPlus Arrow
-- </pre>
--
-- Apply, Bind, and Extend (not shown) give rise the Static, Kleisli and
-- Cokleisli semigroupoids respectively.
--
-- This lets us remove many of the restrictions from various monad
-- transformers as in many cases the binding operation or
-- <tt><*></tt> operation does not require them.
--
-- Finally, to work with these weaker structures it is beneficial to have
-- containers that can provide stronger guarantees about their contents,
-- so versions of <a>Traversable</a> and <a>Foldable</a> that can be
-- folded with just a <a>Semigroup</a> are added.
@package semigroupoids
@version 5.2.1
-- | Re-exports from the `base-orphans` and `transformers-compat` packages.
module Data.Traversable.Instances
module Data.Semigroup.Foldable.Class
class Foldable t => Foldable1 t where foldMap1 f = maybe (error "foldMap1") id . getOption . foldMap (Option . Just . f) fold1 = foldMap1 id toNonEmpty = foldMap1 (:| [])
fold1 :: (Foldable1 t, Semigroup m) => t m -> m
foldMap1 :: (Foldable1 t, Semigroup m) => (a -> m) -> t a -> m
toNonEmpty :: Foldable1 t => t a -> NonEmpty a
class Bifoldable t => Bifoldable1 t where bifold1 = bifoldMap1 id id bifoldMap1 f g = maybe (error "bifoldMap1") id . getOption . bifoldMap (Option . Just . f) (Option . Just . g)
bifold1 :: (Bifoldable1 t, Semigroup m) => t m m -> m
bifoldMap1 :: (Bifoldable1 t, Semigroup m) => (a -> m) -> (b -> m) -> t a b -> m
instance Data.Semigroup.Foldable.Class.Foldable1 f => Data.Semigroup.Foldable.Class.Foldable1 (GHC.Generics.Rec1 f)
instance Data.Semigroup.Foldable.Class.Foldable1 f => Data.Semigroup.Foldable.Class.Foldable1 (GHC.Generics.M1 i c f)
instance Data.Semigroup.Foldable.Class.Foldable1 GHC.Generics.Par1
instance (Data.Semigroup.Foldable.Class.Foldable1 f, Data.Semigroup.Foldable.Class.Foldable1 g) => Data.Semigroup.Foldable.Class.Foldable1 (f GHC.Generics.:*: g)
instance (Data.Semigroup.Foldable.Class.Foldable1 f, Data.Semigroup.Foldable.Class.Foldable1 g) => Data.Semigroup.Foldable.Class.Foldable1 (f GHC.Generics.:+: g)
instance Data.Semigroup.Foldable.Class.Foldable1 GHC.Generics.V1
instance (Data.Semigroup.Foldable.Class.Foldable1 f, Data.Semigroup.Foldable.Class.Foldable1 g) => Data.Semigroup.Foldable.Class.Foldable1 (f GHC.Generics.:.: g)
instance Data.Semigroup.Foldable.Class.Bifoldable1 Data.Semigroup.Arg
instance Data.Semigroup.Foldable.Class.Bifoldable1 Data.Either.Either
instance Data.Semigroup.Foldable.Class.Bifoldable1 (,)
instance Data.Semigroup.Foldable.Class.Bifoldable1 ((,,) x)
instance Data.Semigroup.Foldable.Class.Bifoldable1 ((,,,) x y)
instance Data.Semigroup.Foldable.Class.Bifoldable1 ((,,,,) x y z)
instance Data.Semigroup.Foldable.Class.Bifoldable1 Data.Functor.Const.Const
instance Data.Semigroup.Foldable.Class.Bifoldable1 Data.Tagged.Tagged
instance (Data.Semigroup.Foldable.Class.Bifoldable1 p, Data.Semigroup.Foldable.Class.Foldable1 f, Data.Semigroup.Foldable.Class.Foldable1 g) => Data.Semigroup.Foldable.Class.Bifoldable1 (Data.Bifunctor.Biff.Biff p f g)
instance Data.Semigroup.Foldable.Class.Foldable1 f => Data.Semigroup.Foldable.Class.Bifoldable1 (Data.Bifunctor.Clown.Clown f)
instance Data.Semigroup.Foldable.Class.Bifoldable1 p => Data.Semigroup.Foldable.Class.Bifoldable1 (Data.Bifunctor.Flip.Flip p)
instance Data.Semigroup.Foldable.Class.Bifoldable1 p => Data.Semigroup.Foldable.Class.Foldable1 (Data.Bifunctor.Join.Join p)
instance Data.Semigroup.Foldable.Class.Foldable1 g => Data.Semigroup.Foldable.Class.Bifoldable1 (Data.Bifunctor.Joker.Joker g)
instance (Data.Semigroup.Foldable.Class.Bifoldable1 f, Data.Semigroup.Foldable.Class.Bifoldable1 g) => Data.Semigroup.Foldable.Class.Bifoldable1 (Data.Bifunctor.Product.Product f g)
instance (Data.Semigroup.Foldable.Class.Foldable1 f, Data.Semigroup.Foldable.Class.Bifoldable1 p) => Data.Semigroup.Foldable.Class.Bifoldable1 (Data.Bifunctor.Tannen.Tannen f p)
instance Data.Semigroup.Foldable.Class.Bifoldable1 p => Data.Semigroup.Foldable.Class.Bifoldable1 (Data.Bifunctor.Wrapped.WrappedBifunctor p)
instance Data.Semigroup.Foldable.Class.Foldable1 Data.Complex.Complex
instance Data.Semigroup.Foldable.Class.Foldable1 Data.Tree.Tree
instance Data.Semigroup.Foldable.Class.Foldable1 Data.Functor.Identity.Identity
instance Data.Semigroup.Foldable.Class.Foldable1 (Data.Tagged.Tagged a)
instance Data.Semigroup.Foldable.Class.Foldable1 m => Data.Semigroup.Foldable.Class.Foldable1 (Control.Monad.Trans.Identity.IdentityT m)
instance Data.Semigroup.Foldable.Class.Foldable1 f => Data.Semigroup.Foldable.Class.Foldable1 (Control.Applicative.Backwards.Backwards f)
instance (Data.Semigroup.Foldable.Class.Foldable1 f, Data.Semigroup.Foldable.Class.Foldable1 g) => Data.Semigroup.Foldable.Class.Foldable1 (Data.Functor.Compose.Compose f g)
instance Data.Semigroup.Foldable.Class.Foldable1 f => Data.Semigroup.Foldable.Class.Foldable1 (Control.Applicative.Lift.Lift f)
instance (Data.Semigroup.Foldable.Class.Foldable1 f, Data.Semigroup.Foldable.Class.Foldable1 g) => Data.Semigroup.Foldable.Class.Foldable1 (Data.Functor.Product.Product f g)
instance Data.Semigroup.Foldable.Class.Foldable1 f => Data.Semigroup.Foldable.Class.Foldable1 (Data.Functor.Reverse.Reverse f)
instance (Data.Semigroup.Foldable.Class.Foldable1 f, Data.Semigroup.Foldable.Class.Foldable1 g) => Data.Semigroup.Foldable.Class.Foldable1 (Data.Functor.Sum.Sum f g)
instance Data.Semigroup.Foldable.Class.Foldable1 Data.List.NonEmpty.NonEmpty
instance Data.Semigroup.Foldable.Class.Foldable1 ((,) a)
instance Data.Semigroup.Foldable.Class.Foldable1 g => Data.Semigroup.Foldable.Class.Foldable1 (Data.Bifunctor.Joker.Joker g a)
module Data.Functor.Extend
class Functor w => Extend w where extended f = fmap f . duplicated duplicated = extended id
-- | <pre>
-- duplicated = extended id
-- fmap (fmap f) . duplicated = duplicated . fmap f
-- </pre>
duplicated :: Extend w => w a -> w (w a)
-- | <pre>
-- extended f = fmap f . duplicated
-- </pre>
extended :: Extend w => (w a -> b) -> w a -> w b
instance Data.Functor.Extend.Extend []
instance Data.Functor.Extend.Extend (Data.Tagged.Tagged a)
instance Data.Functor.Extend.Extend Data.Proxy.Proxy
instance Data.Functor.Extend.Extend GHC.Base.Maybe
instance Data.Functor.Extend.Extend (Data.Either.Either a)
instance Data.Functor.Extend.Extend ((,) e)
instance Data.Semigroup.Semigroup m => Data.Functor.Extend.Extend ((->) m)
instance Data.Functor.Extend.Extend Data.Sequence.Seq
instance Data.Functor.Extend.Extend Data.Tree.Tree
instance Data.Functor.Extend.Extend w => Data.Functor.Extend.Extend (Control.Comonad.Trans.Env.EnvT e w)
instance Data.Functor.Extend.Extend w => Data.Functor.Extend.Extend (Control.Comonad.Trans.Store.StoreT s w)
instance (Data.Functor.Extend.Extend w, Data.Semigroup.Semigroup m) => Data.Functor.Extend.Extend (Control.Comonad.Trans.Traced.TracedT m w)
instance Data.Functor.Extend.Extend Data.Functor.Identity.Identity
instance Data.Functor.Extend.Extend w => Data.Functor.Extend.Extend (Control.Monad.Trans.Identity.IdentityT w)
instance Data.Functor.Extend.Extend Data.List.NonEmpty.NonEmpty
instance (Data.Functor.Extend.Extend f, Data.Functor.Extend.Extend g) => Data.Functor.Extend.Extend (Data.Functor.Sum.Sum f g)
-- | This module is used to resolve the cyclic we get from defining these
-- classes here rather than in a package upstream. Otherwise we'd get
-- orphaned heads for many instances on the types in
-- <tt>transformers</tt> and <tt>bifunctors</tt>.
module Data.Functor.Bind.Class
-- | A strong lax semi-monoidal endofunctor. This is equivalent to an
-- <a>Applicative</a> without <a>pure</a>.
--
-- Laws:
--
-- <pre>
-- (<a>.</a>) <a><$></a> u <a><.></a> v <a><.></a> w = u <a><.></a> (v <a><.></a> w)
-- x <a><.></a> (f <a><$></a> y) = (<a>.</a> f) <a><$></a> x <a><.></a> y
-- f <a><$></a> (x <a><.></a> y) = (f <a>.</a>) <a><$></a> x <a><.></a> y
-- </pre>
--
-- The laws imply that <a>.></a> and <a><.</a> really ignore their
-- left and right results, respectively, and really return their right
-- and left results, respectively. Specifically,
--
-- <pre>
-- (mf <a><$></a> m) <a>.></a> (nf <a><$></a> n) = nf <a><$></a> (m <a>.></a> n)
-- (mf <a><$></a> m) <a><.</a> (nf <a><$></a> n) = mf <a><$></a> (m <a><.</a> n)
-- </pre>
class Functor f => Apply f where a .> b = const id <$> a <.> b a <. b = const <$> a <.> b
(<.>) :: Apply f => f (a -> b) -> f a -> f b
-- | <pre>
-- a <a>.></a> b = <a>const</a> <a>id</a> <a><$></a> a <a><.></a> b
-- </pre>
(.>) :: Apply f => f a -> f b -> f b
-- | <pre>
-- a <a><.</a> b = <a>const</a> <a><$></a> a <a><.></a> b
-- </pre>
(<.) :: Apply f => f a -> f b -> f a
-- | Wrap an <a>Applicative</a> to be used as a member of <a>Apply</a>
newtype WrappedApplicative f a
WrapApplicative :: f a -> WrappedApplicative f a
[unwrapApplicative] :: WrappedApplicative f a -> f a
-- | Transform a Apply into an Applicative by adding a unit.
newtype MaybeApply f a
MaybeApply :: Either (f a) a -> MaybeApply f a
[runMaybeApply] :: MaybeApply f a -> Either (f a) a
-- | A <a>Monad</a> sans <a>return</a>.
--
-- Minimal definition: Either <a>join</a> or <a>>>-</a>
--
-- If defining both, then the following laws (the default definitions)
-- must hold:
--
-- <pre>
-- join = (>>- id)
-- m >>- f = join (fmap f m)
-- </pre>
--
-- Laws:
--
-- <pre>
-- induced definition of <.>: f <.> x = f >>- (<$> x)
-- </pre>
--
-- Finally, there are two associativity conditions:
--
-- <pre>
-- associativity of (>>-): (m >>- f) >>- g == m >>- (\x -> f x >>- g)
-- associativity of join: join . join = join . fmap join
-- </pre>
--
-- These can both be seen as special cases of the constraint that
--
-- <pre>
-- associativity of (->-): (f ->- g) ->- h = f ->- (g ->- h)
-- </pre>
class Apply m => Bind m where m >>- f = join (fmap f m) join = (>>- id)
(>>-) :: Bind m => m a -> (a -> m b) -> m b
join :: Bind m => m (m a) -> m a
apDefault :: Bind f => f (a -> b) -> f a -> f b
returning :: Functor f => f a -> (a -> b) -> f b
class Bifunctor p => Biapply p where a .>> b = bimap (const id) (const id) <<$>> a <<.>> b a <<. b = bimap const const <<$>> a <<.>> b
(<<.>>) :: Biapply p => p (a -> b) (c -> d) -> p a c -> p b d
-- | <pre>
-- a <a>.></a> b ≡ <a>const</a> <a>id</a> <a><$></a> a <a><.></a> b
-- </pre>
(.>>) :: Biapply p => p a b -> p c d -> p c d
-- | <pre>
-- a <a><.</a> b ≡ <a>const</a> <a><$></a> a <a><.></a> b
-- </pre>
(<<.) :: Biapply p => p a b -> p c d -> p a b
instance Data.Functor.Bind.Class.Apply (Data.Tagged.Tagged a)
instance Data.Functor.Bind.Class.Apply Data.Proxy.Proxy
instance Data.Functor.Bind.Class.Apply f => Data.Functor.Bind.Class.Apply (Control.Applicative.Backwards.Backwards f)
instance (Data.Functor.Bind.Class.Apply f, Data.Functor.Bind.Class.Apply g) => Data.Functor.Bind.Class.Apply (Data.Functor.Compose.Compose f g)
instance Data.Semigroup.Semigroup f => Data.Functor.Bind.Class.Apply (Data.Functor.Constant.Constant f)
instance Data.Functor.Bind.Class.Apply f => Data.Functor.Bind.Class.Apply (Control.Applicative.Lift.Lift f)
instance (Data.Functor.Bind.Class.Apply f, Data.Functor.Bind.Class.Apply g) => Data.Functor.Bind.Class.Apply (Data.Functor.Product.Product f g)
instance Data.Functor.Bind.Class.Apply f => Data.Functor.Bind.Class.Apply (Data.Functor.Reverse.Reverse f)
instance Data.Semigroup.Semigroup m => Data.Functor.Bind.Class.Apply ((,) m)
instance Data.Functor.Bind.Class.Apply Data.List.NonEmpty.NonEmpty
instance Data.Functor.Bind.Class.Apply (Data.Either.Either a)
instance Data.Semigroup.Semigroup m => Data.Functor.Bind.Class.Apply (Data.Functor.Const.Const m)
instance Data.Functor.Bind.Class.Apply ((->) m)
instance Data.Functor.Bind.Class.Apply Control.Applicative.ZipList
instance Data.Functor.Bind.Class.Apply []
instance Data.Functor.Bind.Class.Apply GHC.Types.IO
instance Data.Functor.Bind.Class.Apply GHC.Base.Maybe
instance Data.Functor.Bind.Class.Apply Data.Semigroup.Option
instance Data.Functor.Bind.Class.Apply Data.Functor.Identity.Identity
instance Data.Functor.Bind.Class.Apply w => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.Identity.IdentityT w)
instance GHC.Base.Monad m => Data.Functor.Bind.Class.Apply (Control.Applicative.WrappedMonad m)
instance Control.Arrow.Arrow a => Data.Functor.Bind.Class.Apply (Control.Applicative.WrappedArrow a b)
instance Data.Functor.Bind.Class.Apply Data.Complex.Complex
instance GHC.Classes.Ord k => Data.Functor.Bind.Class.Apply (Data.Map.Base.Map k)
instance Data.Functor.Bind.Class.Apply Data.IntMap.Base.IntMap
instance Data.Functor.Bind.Class.Apply Data.Sequence.Seq
instance Data.Functor.Bind.Class.Apply Data.Tree.Tree
instance (Data.Hashable.Class.Hashable k, GHC.Classes.Eq k) => Data.Functor.Bind.Class.Apply (Data.HashMap.Base.HashMap k)
instance (GHC.Base.Functor m, GHC.Base.Monad m) => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.Maybe.MaybeT m)
instance (GHC.Base.Functor m, GHC.Base.Monad m) => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.Error.ErrorT e m)
instance (GHC.Base.Functor m, GHC.Base.Monad m) => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.Except.ExceptT e m)
instance Data.Functor.Bind.Class.Apply m => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.Reader.ReaderT e m)
instance Data.Functor.Bind.Class.Apply m => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.List.ListT m)
instance (Data.Functor.Bind.Class.Apply m, Data.Semigroup.Semigroup w) => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.Writer.Strict.WriterT w m)
instance (Data.Functor.Bind.Class.Apply m, Data.Semigroup.Semigroup w) => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.Writer.Lazy.WriterT w m)
instance Data.Functor.Bind.Class.Bind m => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.State.Strict.StateT s m)
instance Data.Functor.Bind.Class.Bind m => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.State.Lazy.StateT s m)
instance (Data.Functor.Bind.Class.Bind m, Data.Semigroup.Semigroup w) => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance (Data.Functor.Bind.Class.Bind m, Data.Semigroup.Semigroup w) => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance Data.Functor.Bind.Class.Apply (Control.Monad.Trans.Cont.ContT r m)
instance (Data.Semigroup.Semigroup e, Data.Functor.Bind.Class.Apply w) => Data.Functor.Bind.Class.Apply (Control.Comonad.Trans.Env.EnvT e w)
instance (Data.Functor.Bind.Class.Apply w, Data.Semigroup.Semigroup s) => Data.Functor.Bind.Class.Apply (Control.Comonad.Trans.Store.StoreT s w)
instance Data.Functor.Bind.Class.Apply w => Data.Functor.Bind.Class.Apply (Control.Comonad.Trans.Traced.TracedT m w)
instance GHC.Base.Functor f => GHC.Base.Functor (Data.Functor.Bind.Class.WrappedApplicative f)
instance GHC.Base.Applicative f => Data.Functor.Bind.Class.Apply (Data.Functor.Bind.Class.WrappedApplicative f)
instance GHC.Base.Applicative f => GHC.Base.Applicative (Data.Functor.Bind.Class.WrappedApplicative f)
instance GHC.Base.Alternative f => GHC.Base.Alternative (Data.Functor.Bind.Class.WrappedApplicative f)
instance GHC.Base.Functor f => GHC.Base.Functor (Data.Functor.Bind.Class.MaybeApply f)
instance Data.Functor.Bind.Class.Apply f => Data.Functor.Bind.Class.Apply (Data.Functor.Bind.Class.MaybeApply f)
instance Data.Functor.Bind.Class.Apply f => GHC.Base.Applicative (Data.Functor.Bind.Class.MaybeApply f)
instance Data.Functor.Extend.Extend f => Data.Functor.Extend.Extend (Data.Functor.Bind.Class.MaybeApply f)
instance Control.Comonad.Comonad f => Control.Comonad.Comonad (Data.Functor.Bind.Class.MaybeApply f)
instance Data.Functor.Bind.Class.Apply (Control.Comonad.Cokleisli w a)
instance Data.Semigroup.Semigroup m => Data.Functor.Bind.Class.Bind ((,) m)
instance Data.Functor.Bind.Class.Bind (Data.Tagged.Tagged a)
instance Data.Functor.Bind.Class.Bind Data.Proxy.Proxy
instance Data.Functor.Bind.Class.Bind (Data.Either.Either a)
instance (Data.Functor.Bind.Class.Bind f, Data.Functor.Bind.Class.Bind g) => Data.Functor.Bind.Class.Bind (Data.Functor.Product.Product f g)
instance Data.Functor.Bind.Class.Bind ((->) m)
instance Data.Functor.Bind.Class.Bind []
instance Data.Functor.Bind.Class.Bind Data.List.NonEmpty.NonEmpty
instance Data.Functor.Bind.Class.Bind GHC.Types.IO
instance Data.Functor.Bind.Class.Bind GHC.Base.Maybe
instance Data.Functor.Bind.Class.Bind Data.Semigroup.Option
instance Data.Functor.Bind.Class.Bind Data.Functor.Identity.Identity
instance Data.Functor.Bind.Class.Bind m => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.Identity.IdentityT m)
instance GHC.Base.Monad m => Data.Functor.Bind.Class.Bind (Control.Applicative.WrappedMonad m)
instance (GHC.Base.Functor m, GHC.Base.Monad m) => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.Maybe.MaybeT m)
instance (Data.Functor.Bind.Class.Apply m, GHC.Base.Monad m) => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.List.ListT m)
instance (GHC.Base.Functor m, GHC.Base.Monad m) => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.Error.ErrorT e m)
instance (GHC.Base.Functor m, GHC.Base.Monad m) => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.Except.ExceptT e m)
instance Data.Functor.Bind.Class.Bind m => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.Reader.ReaderT e m)
instance (Data.Functor.Bind.Class.Bind m, Data.Semigroup.Semigroup w) => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.Writer.Lazy.WriterT w m)
instance (Data.Functor.Bind.Class.Bind m, Data.Semigroup.Semigroup w) => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.Writer.Strict.WriterT w m)
instance Data.Functor.Bind.Class.Bind m => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.State.Lazy.StateT s m)
instance Data.Functor.Bind.Class.Bind m => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.State.Strict.StateT s m)
instance (Data.Functor.Bind.Class.Bind m, Data.Semigroup.Semigroup w) => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance (Data.Functor.Bind.Class.Bind m, Data.Semigroup.Semigroup w) => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance Data.Functor.Bind.Class.Bind (Control.Monad.Trans.Cont.ContT r m)
instance Data.Functor.Bind.Class.Bind Data.Complex.Complex
instance GHC.Classes.Ord k => Data.Functor.Bind.Class.Bind (Data.Map.Base.Map k)
instance Data.Functor.Bind.Class.Bind Data.IntMap.Base.IntMap
instance Data.Functor.Bind.Class.Bind Data.Sequence.Seq
instance Data.Functor.Bind.Class.Bind Data.Tree.Tree
instance (Data.Hashable.Class.Hashable k, GHC.Classes.Eq k) => Data.Functor.Bind.Class.Bind (Data.HashMap.Base.HashMap k)
instance Data.Functor.Bind.Class.Biapply (,)
instance Data.Functor.Bind.Class.Biapply Data.Semigroup.Arg
instance Data.Semigroup.Semigroup x => Data.Functor.Bind.Class.Biapply ((,,) x)
instance (Data.Semigroup.Semigroup x, Data.Semigroup.Semigroup y) => Data.Functor.Bind.Class.Biapply ((,,,) x y)
instance (Data.Semigroup.Semigroup x, Data.Semigroup.Semigroup y, Data.Semigroup.Semigroup z) => Data.Functor.Bind.Class.Biapply ((,,,,) x y z)
instance Data.Functor.Bind.Class.Biapply Data.Functor.Const.Const
instance Data.Functor.Bind.Class.Biapply Data.Tagged.Tagged
instance (Data.Functor.Bind.Class.Biapply p, Data.Functor.Bind.Class.Apply f, Data.Functor.Bind.Class.Apply g) => Data.Functor.Bind.Class.Biapply (Data.Bifunctor.Biff.Biff p f g)
instance Data.Functor.Bind.Class.Apply f => Data.Functor.Bind.Class.Biapply (Data.Bifunctor.Clown.Clown f)
instance Data.Functor.Bind.Class.Biapply p => Data.Functor.Bind.Class.Biapply (Data.Bifunctor.Flip.Flip p)
instance Data.Functor.Bind.Class.Apply g => Data.Functor.Bind.Class.Biapply (Data.Bifunctor.Joker.Joker g)
instance Data.Functor.Bind.Class.Biapply p => Data.Functor.Bind.Class.Apply (Data.Bifunctor.Join.Join p)
instance (Data.Functor.Bind.Class.Biapply p, Data.Functor.Bind.Class.Biapply q) => Data.Functor.Bind.Class.Biapply (Data.Bifunctor.Product.Product p q)
instance (Data.Functor.Bind.Class.Apply f, Data.Functor.Bind.Class.Biapply p) => Data.Functor.Bind.Class.Biapply (Data.Bifunctor.Tannen.Tannen f p)
instance Data.Functor.Bind.Class.Biapply p => Data.Functor.Bind.Class.Biapply (Data.Bifunctor.Wrapped.WrappedBifunctor p)
module Data.Functor.Apply
-- | The <a>Functor</a> class is used for types that can be mapped over.
-- Instances of <a>Functor</a> should satisfy the following laws:
--
-- <pre>
-- fmap id == id
-- fmap (f . g) == fmap f . fmap g
-- </pre>
--
-- The instances of <a>Functor</a> for lists, <a>Maybe</a> and <a>IO</a>
-- satisfy these laws.
class Functor (f :: * -> *)
fmap :: Functor f => (a -> b) -> f a -> f b
-- | Replace all locations in the input with the same value. The default
-- definition is <tt><a>fmap</a> . <a>const</a></tt>, but this may be
-- overridden with a more efficient version.
(<$) :: Functor f => a -> f b -> f a
-- | An infix synonym for <a>fmap</a>.
--
-- The name of this operator is an allusion to <tt>$</tt>. Note the
-- similarities between their types:
--
-- <pre>
-- ($) :: (a -> b) -> a -> b
-- (<$>) :: Functor f => (a -> b) -> f a -> f b
-- </pre>
--
-- Whereas <tt>$</tt> is function application, <a><$></a> is
-- function application lifted over a <a>Functor</a>.
--
-- <h4><b>Examples</b></h4>
--
-- Convert from a <tt><tt>Maybe</tt> <tt>Int</tt></tt> to a
-- <tt><tt>Maybe</tt> <tt>String</tt></tt> using <tt>show</tt>:
--
-- <pre>
-- >>> show <$> Nothing
-- Nothing
--
-- >>> show <$> Just 3
-- Just "3"
-- </pre>
--
-- Convert from an <tt><tt>Either</tt> <tt>Int</tt> <tt>Int</tt></tt> to
-- an <tt><tt>Either</tt> <tt>Int</tt></tt> <tt>String</tt> using
-- <tt>show</tt>:
--
-- <pre>
-- >>> show <$> Left 17
-- Left 17
--
-- >>> show <$> Right 17
-- Right "17"
-- </pre>
--
-- Double each element of a list:
--
-- <pre>
-- >>> (*2) <$> [1,2,3]
-- [2,4,6]
-- </pre>
--
-- Apply <tt>even</tt> to the second element of a pair:
--
-- <pre>
-- >>> even <$> (2,2)
-- (2,True)
-- </pre>
(<$>) :: Functor f => (a -> b) -> f a -> f b
infixl 4 <$>
-- | Flipped version of <a><$</a>.
--
-- <h4><b>Examples</b></h4>
--
-- Replace the contents of a <tt><tt>Maybe</tt> <tt>Int</tt></tt> with a
-- constant <tt>String</tt>:
--
-- <pre>
-- >>> Nothing $> "foo"
-- Nothing
--
-- >>> Just 90210 $> "foo"
-- Just "foo"
-- </pre>
--
-- Replace the contents of an <tt><tt>Either</tt> <tt>Int</tt>
-- <tt>Int</tt></tt> with a constant <tt>String</tt>, resulting in an
-- <tt><tt>Either</tt> <tt>Int</tt> <tt>String</tt></tt>:
--
-- <pre>
-- >>> Left 8675309 $> "foo"
-- Left 8675309
--
-- >>> Right 8675309 $> "foo"
-- Right "foo"
-- </pre>
--
-- Replace each element of a list with a constant <tt>String</tt>:
--
-- <pre>
-- >>> [1,2,3] $> "foo"
-- ["foo","foo","foo"]
-- </pre>
--
-- Replace the second element of a pair with a constant <tt>String</tt>:
--
-- <pre>
-- >>> (1,2) $> "foo"
-- (1,"foo")
-- </pre>
($>) :: Functor f => f a -> b -> f b
infixl 4 $>
-- | A strong lax semi-monoidal endofunctor. This is equivalent to an
-- <a>Applicative</a> without <a>pure</a>.
--
-- Laws:
--
-- <pre>
-- (<a>.</a>) <a><$></a> u <a><.></a> v <a><.></a> w = u <a><.></a> (v <a><.></a> w)
-- x <a><.></a> (f <a><$></a> y) = (<a>.</a> f) <a><$></a> x <a><.></a> y
-- f <a><$></a> (x <a><.></a> y) = (f <a>.</a>) <a><$></a> x <a><.></a> y
-- </pre>
--
-- The laws imply that <a>.></a> and <a><.</a> really ignore their
-- left and right results, respectively, and really return their right
-- and left results, respectively. Specifically,
--
-- <pre>
-- (mf <a><$></a> m) <a>.></a> (nf <a><$></a> n) = nf <a><$></a> (m <a>.></a> n)
-- (mf <a><$></a> m) <a><.</a> (nf <a><$></a> n) = mf <a><$></a> (m <a><.</a> n)
-- </pre>
class Functor f => Apply f where a .> b = const id <$> a <.> b a <. b = const <$> a <.> b
(<.>) :: Apply f => f (a -> b) -> f a -> f b
-- | <pre>
-- a <a>.></a> b = <a>const</a> <a>id</a> <a><$></a> a <a><.></a> b
-- </pre>
(.>) :: Apply f => f a -> f b -> f b
-- | <pre>
-- a <a><.</a> b = <a>const</a> <a><$></a> a <a><.></a> b
-- </pre>
(<.) :: Apply f => f a -> f b -> f a
-- | A variant of <a><.></a> with the arguments reversed.
(<..>) :: Apply w => w a -> w (a -> b) -> w b
infixl 4 <..>
-- | Lift a binary function into a comonad with zipping
liftF2 :: Apply w => (a -> b -> c) -> w a -> w b -> w c
-- | Lift a ternary function into a comonad with zipping
liftF3 :: Apply w => (a -> b -> c -> d) -> w a -> w b -> w c -> w d
-- | Wrap an <a>Applicative</a> to be used as a member of <a>Apply</a>
newtype WrappedApplicative f a
WrapApplicative :: f a -> WrappedApplicative f a
[unwrapApplicative] :: WrappedApplicative f a -> f a
-- | Transform a Apply into an Applicative by adding a unit.
newtype MaybeApply f a
MaybeApply :: Either (f a) a -> MaybeApply f a
[runMaybeApply] :: MaybeApply f a -> Either (f a) a
module Data.Functor.Bind
-- | The <a>Functor</a> class is used for types that can be mapped over.
-- Instances of <a>Functor</a> should satisfy the following laws:
--
-- <pre>
-- fmap id == id
-- fmap (f . g) == fmap f . fmap g
-- </pre>
--
-- The instances of <a>Functor</a> for lists, <a>Maybe</a> and <a>IO</a>
-- satisfy these laws.
class Functor (f :: * -> *)
fmap :: Functor f => (a -> b) -> f a -> f b
-- | Replace all locations in the input with the same value. The default
-- definition is <tt><a>fmap</a> . <a>const</a></tt>, but this may be
-- overridden with a more efficient version.
(<$) :: Functor f => a -> f b -> f a
-- | An infix synonym for <a>fmap</a>.
--
-- The name of this operator is an allusion to <tt>$</tt>. Note the
-- similarities between their types:
--
-- <pre>
-- ($) :: (a -> b) -> a -> b
-- (<$>) :: Functor f => (a -> b) -> f a -> f b
-- </pre>
--
-- Whereas <tt>$</tt> is function application, <a><$></a> is
-- function application lifted over a <a>Functor</a>.
--
-- <h4><b>Examples</b></h4>
--
-- Convert from a <tt><tt>Maybe</tt> <tt>Int</tt></tt> to a
-- <tt><tt>Maybe</tt> <tt>String</tt></tt> using <tt>show</tt>:
--
-- <pre>
-- >>> show <$> Nothing
-- Nothing
--
-- >>> show <$> Just 3
-- Just "3"
-- </pre>
--
-- Convert from an <tt><tt>Either</tt> <tt>Int</tt> <tt>Int</tt></tt> to
-- an <tt><tt>Either</tt> <tt>Int</tt></tt> <tt>String</tt> using
-- <tt>show</tt>:
--
-- <pre>
-- >>> show <$> Left 17
-- Left 17
--
-- >>> show <$> Right 17
-- Right "17"
-- </pre>
--
-- Double each element of a list:
--
-- <pre>
-- >>> (*2) <$> [1,2,3]
-- [2,4,6]
-- </pre>
--
-- Apply <tt>even</tt> to the second element of a pair:
--
-- <pre>
-- >>> even <$> (2,2)
-- (2,True)
-- </pre>
(<$>) :: Functor f => (a -> b) -> f a -> f b
infixl 4 <$>
-- | Flipped version of <a><$</a>.
--
-- <h4><b>Examples</b></h4>
--
-- Replace the contents of a <tt><tt>Maybe</tt> <tt>Int</tt></tt> with a
-- constant <tt>String</tt>:
--
-- <pre>
-- >>> Nothing $> "foo"
-- Nothing
--
-- >>> Just 90210 $> "foo"
-- Just "foo"
-- </pre>
--
-- Replace the contents of an <tt><tt>Either</tt> <tt>Int</tt>
-- <tt>Int</tt></tt> with a constant <tt>String</tt>, resulting in an
-- <tt><tt>Either</tt> <tt>Int</tt> <tt>String</tt></tt>:
--
-- <pre>
-- >>> Left 8675309 $> "foo"
-- Left 8675309
--
-- >>> Right 8675309 $> "foo"
-- Right "foo"
-- </pre>
--
-- Replace each element of a list with a constant <tt>String</tt>:
--
-- <pre>
-- >>> [1,2,3] $> "foo"
-- ["foo","foo","foo"]
-- </pre>
--
-- Replace the second element of a pair with a constant <tt>String</tt>:
--
-- <pre>
-- >>> (1,2) $> "foo"
-- (1,"foo")
-- </pre>
($>) :: Functor f => f a -> b -> f b
infixl 4 $>
-- | A strong lax semi-monoidal endofunctor. This is equivalent to an
-- <a>Applicative</a> without <a>pure</a>.
--
-- Laws:
--
-- <pre>
-- (<a>.</a>) <a><$></a> u <a><.></a> v <a><.></a> w = u <a><.></a> (v <a><.></a> w)
-- x <a><.></a> (f <a><$></a> y) = (<a>.</a> f) <a><$></a> x <a><.></a> y
-- f <a><$></a> (x <a><.></a> y) = (f <a>.</a>) <a><$></a> x <a><.></a> y
-- </pre>
--
-- The laws imply that <a>.></a> and <a><.</a> really ignore their
-- left and right results, respectively, and really return their right
-- and left results, respectively. Specifically,
--
-- <pre>
-- (mf <a><$></a> m) <a>.></a> (nf <a><$></a> n) = nf <a><$></a> (m <a>.></a> n)
-- (mf <a><$></a> m) <a><.</a> (nf <a><$></a> n) = mf <a><$></a> (m <a><.</a> n)
-- </pre>
class Functor f => Apply f where a .> b = const id <$> a <.> b a <. b = const <$> a <.> b
(<.>) :: Apply f => f (a -> b) -> f a -> f b
-- | <pre>
-- a <a>.></a> b = <a>const</a> <a>id</a> <a><$></a> a <a><.></a> b
-- </pre>
(.>) :: Apply f => f a -> f b -> f b
-- | <pre>
-- a <a><.</a> b = <a>const</a> <a><$></a> a <a><.></a> b
-- </pre>
(<.) :: Apply f => f a -> f b -> f a
-- | A variant of <a><.></a> with the arguments reversed.
(<..>) :: Apply w => w a -> w (a -> b) -> w b
infixl 4 <..>
-- | Lift a binary function into a comonad with zipping
liftF2 :: Apply w => (a -> b -> c) -> w a -> w b -> w c
-- | Lift a ternary function into a comonad with zipping
liftF3 :: Apply w => (a -> b -> c -> d) -> w a -> w b -> w c -> w d
-- | Wrap an <a>Applicative</a> to be used as a member of <a>Apply</a>
newtype WrappedApplicative f a
WrapApplicative :: f a -> WrappedApplicative f a
[unwrapApplicative] :: WrappedApplicative f a -> f a
-- | Transform a Apply into an Applicative by adding a unit.
newtype MaybeApply f a
MaybeApply :: Either (f a) a -> MaybeApply f a
[runMaybeApply] :: MaybeApply f a -> Either (f a) a
-- | A <a>Monad</a> sans <a>return</a>.
--
-- Minimal definition: Either <a>join</a> or <a>>>-</a>
--
-- If defining both, then the following laws (the default definitions)
-- must hold:
--
-- <pre>
-- join = (>>- id)
-- m >>- f = join (fmap f m)
-- </pre>
--
-- Laws:
--
-- <pre>
-- induced definition of <.>: f <.> x = f >>- (<$> x)
-- </pre>
--
-- Finally, there are two associativity conditions:
--
-- <pre>
-- associativity of (>>-): (m >>- f) >>- g == m >>- (\x -> f x >>- g)
-- associativity of join: join . join = join . fmap join
-- </pre>
--
-- These can both be seen as special cases of the constraint that
--
-- <pre>
-- associativity of (->-): (f ->- g) ->- h = f ->- (g ->- h)
-- </pre>
class Apply m => Bind m where m >>- f = join (fmap f m) join = (>>- id)
(>>-) :: Bind m => m a -> (a -> m b) -> m b
join :: Bind m => m (m a) -> m a
(-<<) :: Bind m => (a -> m b) -> m a -> m b
infixr 1 -<<
(-<-) :: Bind m => (b -> m c) -> (a -> m b) -> a -> m c
infixr 1 -<-
(->-) :: Bind m => (a -> m b) -> (b -> m c) -> a -> m c
infixr 1 ->-
apDefault :: Bind f => f (a -> b) -> f a -> f b
returning :: Functor f => f a -> (a -> b) -> f b
module Data.Functor.Bind.Trans
-- | A subset of monad transformers can transform any <a>Bind</a> as well.
class MonadTrans t => BindTrans t
liftB :: (BindTrans t, Bind b) => b a -> t b a
instance Data.Functor.Bind.Trans.BindTrans Control.Monad.Trans.Identity.IdentityT
instance Data.Functor.Bind.Trans.BindTrans (Control.Monad.Trans.Reader.ReaderT e)
instance GHC.Base.Monoid w => Data.Functor.Bind.Trans.BindTrans (Control.Monad.Trans.Writer.Lazy.WriterT w)
instance GHC.Base.Monoid w => Data.Functor.Bind.Trans.BindTrans (Control.Monad.Trans.Writer.Strict.WriterT w)
instance Data.Functor.Bind.Trans.BindTrans (Control.Monad.Trans.State.Lazy.StateT s)
instance Data.Functor.Bind.Trans.BindTrans (Control.Monad.Trans.State.Strict.StateT s)
instance GHC.Base.Monoid w => Data.Functor.Bind.Trans.BindTrans (Control.Monad.Trans.RWS.Lazy.RWST r w s)
instance GHC.Base.Monoid w => Data.Functor.Bind.Trans.BindTrans (Control.Monad.Trans.RWS.Strict.RWST r w s)
instance Data.Functor.Bind.Trans.BindTrans (Control.Monad.Trans.Cont.ContT r)
-- | A semigroupoid satisfies all of the requirements to be a Category
-- except for the existence of identity arrows.
module Data.Semigroupoid
-- | <a>Category</a> sans <a>id</a>
class Semigroupoid c
o :: Semigroupoid c => c j k -> c i j -> c i k
newtype WrappedCategory k a b
WrapCategory :: k a b -> WrappedCategory k a b
[unwrapCategory] :: WrappedCategory k a b -> k a b
newtype Semi m a b
Semi :: m -> Semi m a b
[getSemi] :: Semi m a b -> m
instance Data.Semigroupoid.Semigroupoid (->)
instance Data.Semigroupoid.Semigroupoid (,)
instance Data.Functor.Bind.Class.Bind m => Data.Semigroupoid.Semigroupoid (Control.Arrow.Kleisli m)
instance Data.Functor.Extend.Extend w => Data.Semigroupoid.Semigroupoid (Control.Comonad.Cokleisli w)
instance Data.Semigroupoid.Semigroupoid Data.Functor.Contravariant.Op
instance forall k (k1 :: k -> k -> *). Control.Category.Category k1 => Data.Semigroupoid.Semigroupoid (Data.Semigroupoid.WrappedCategory k1)
instance forall k (k1 :: k -> k -> *). Control.Category.Category k1 => Control.Category.Category (Data.Semigroupoid.WrappedCategory k1)
instance Data.Semigroup.Semigroup m => Data.Semigroupoid.Semigroupoid (Data.Semigroupoid.Semi m)
instance GHC.Base.Monoid m => Control.Category.Category (Data.Semigroupoid.Semi m)
instance Data.Semigroupoid.Semigroupoid Data.Functor.Const.Const
instance Data.Semigroupoid.Semigroupoid Data.Tagged.Tagged
-- | A semigroupoid satisfies all of the requirements to be a Category
-- except for the existence of identity arrows.
module Data.Semigroupoid.Dual
newtype Dual k a b
Dual :: k b a -> Dual k a b
[getDual] :: Dual k a b -> k b a
instance forall k (k1 :: k -> k -> *). Data.Semigroupoid.Semigroupoid k1 => Data.Semigroupoid.Semigroupoid (Data.Semigroupoid.Dual.Dual k1)
instance forall k (k1 :: k -> k -> *). Control.Category.Category k1 => Control.Category.Category (Data.Semigroupoid.Dual.Dual k1)
module Data.Groupoid
-- | semigroupoid with inverses. This technically should be a category with
-- inverses, except we need to use Ob to define the valid objects for the
-- category
class Semigroupoid k => Groupoid k
inv :: Groupoid k => k a b -> k b a
instance forall k (k1 :: k -> k -> *). Data.Groupoid.Groupoid k1 => Data.Groupoid.Groupoid (Data.Semigroupoid.Dual.Dual k1)
module Data.Isomorphism
data Iso k a b
Iso :: k a b -> k b a -> Iso k a b
[embed] :: Iso k a b -> k a b
[project] :: Iso k a b -> k b a
instance forall k (k1 :: k -> k -> *). Data.Semigroupoid.Semigroupoid k1 => Data.Semigroupoid.Semigroupoid (Data.Isomorphism.Iso k1)
instance forall k (k1 :: k -> k -> *). Data.Semigroupoid.Semigroupoid k1 => Data.Groupoid.Groupoid (Data.Isomorphism.Iso k1)
instance forall k (k1 :: k -> k -> *). Control.Category.Category k1 => Control.Category.Category (Data.Isomorphism.Iso k1)
module Data.Semigroupoid.Ob
class Semigroupoid k => Ob k a
semiid :: Ob k a => k a a
instance (Data.Functor.Bind.Class.Bind m, GHC.Base.Monad m) => Data.Semigroupoid.Ob.Ob (Control.Arrow.Kleisli m) a
instance (Data.Functor.Extend.Extend w, Control.Comonad.Comonad w) => Data.Semigroupoid.Ob.Ob (Control.Comonad.Cokleisli w) a
instance Data.Semigroupoid.Ob.Ob (->) a
module Data.Semigroup.Bifoldable
class Bifoldable t => Bifoldable1 t where bifold1 = bifoldMap1 id id bifoldMap1 f g = maybe (error "bifoldMap1") id . getOption . bifoldMap (Option . Just . f) (Option . Just . g)
bifold1 :: (Bifoldable1 t, Semigroup m) => t m m -> m
bifoldMap1 :: (Bifoldable1 t, Semigroup m) => (a -> m) -> (b -> m) -> t a b -> m
bitraverse1_ :: (Bifoldable1 t, Apply f) => (a -> f b) -> (c -> f d) -> t a c -> f ()
bifor1_ :: (Bifoldable1 t, Apply f) => t a c -> (a -> f b) -> (c -> f d) -> f ()
bisequenceA1_ :: (Bifoldable1 t, Apply f) => t (f a) (f b) -> f ()
-- | Usable default for foldMap, but only if you define bifoldMap1 yourself
bifoldMapDefault1 :: (Bifoldable1 t, Monoid m) => (a -> m) -> (b -> m) -> t a b -> m
instance Data.Functor.Bind.Class.Apply f => Data.Semigroup.Semigroup (Data.Semigroup.Bifoldable.Act f a)
instance GHC.Base.Functor f => GHC.Base.Functor (Data.Semigroup.Bifoldable.Act f)
module Data.Functor.Alt
-- | Laws:
--
-- <pre>
-- <!> is associative: (a <!> b) <!> c = a <!> (b <!> c)
-- <$> left-distributes over <!>: f <$> (a <!> b) = (f <$> a) <!> (f <$> b)
-- </pre>
--
-- If extended to an <a>Alternative</a> then <a><!></a> should
-- equal <a><|></a>.
--
-- Ideally, an instance of <a>Alt</a> also satisfies the "left
-- distributon" law of MonadPlus with respect to <a><.></a>:
--
-- <pre>
-- <.> right-distributes over <!>: (a <!> b) <.> c = (a <.> c) <!> (b <.> c)
-- </pre>
--
-- But <a>Maybe</a>, <a>IO</a>, <tt><a>Either</a> a</tt>,
-- <tt><a>ErrorT</a> e m</tt>, and <tt>STM</tt> satisfy the alternative
-- "left catch" law instead:
--
-- <pre>
-- pure a <!> b = pure a
-- </pre>
--
-- However, this variation cannot be stated purely in terms of the
-- dependencies of <a>Alt</a>.
--
-- When and if MonadPlus is successfully refactored, this class should
-- also be refactored to remove these instances.
--
-- The right distributive law should extend in the cases where the a
-- <a>Bind</a> or <a>Monad</a> is provided to yield variations of the
-- right distributive law:
--
-- <pre>
-- (m <!> n) >>- f = (m >>- f) <!> (m >>- f)
-- (m <!> n) >>= f = (m >>= f) <!> (m >>= f)
-- </pre>
class Functor f => Alt f where some v = some_v where many_v = some_v <!> pure [] some_v = (:) <$> v <*> many_v many v = many_v where many_v = some_v <!> pure [] some_v = (:) <$> v <*> many_v
-- | <a><|></a> without a required <tt>empty</tt>
(<!>) :: Alt f => f a -> f a -> f a
some :: (Alt f, Applicative f) => f a -> f [a]
many :: (Alt f, Applicative f) => f a -> f [a]
instance (Data.Functor.Alt.Alt f, Data.Functor.Alt.Alt g) => Data.Functor.Alt.Alt (f GHC.Generics.:*: g)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (GHC.Generics.M1 i c f)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (GHC.Generics.Rec1 f)
instance Data.Functor.Alt.Alt GHC.Generics.U1
instance Data.Functor.Alt.Alt GHC.Generics.V1
instance Data.Functor.Alt.Alt Data.Proxy.Proxy
instance Data.Functor.Alt.Alt (Data.Either.Either a)
instance Data.Functor.Alt.Alt GHC.Types.IO
instance Data.Functor.Alt.Alt []
instance Data.Functor.Alt.Alt GHC.Base.Maybe
instance Data.Functor.Alt.Alt Data.Semigroup.Option
instance GHC.Base.MonadPlus m => Data.Functor.Alt.Alt (Control.Applicative.WrappedMonad m)
instance Control.Arrow.ArrowPlus a => Data.Functor.Alt.Alt (Control.Applicative.WrappedArrow a b)
instance GHC.Classes.Ord k => Data.Functor.Alt.Alt (Data.Map.Base.Map k)
instance Data.Functor.Alt.Alt Data.IntMap.Base.IntMap
instance Data.Functor.Alt.Alt Data.Sequence.Seq
instance Data.Functor.Alt.Alt Data.List.NonEmpty.NonEmpty
instance GHC.Base.Alternative f => Data.Functor.Alt.Alt (Data.Functor.Bind.Class.WrappedApplicative f)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Monad.Trans.Identity.IdentityT f)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Monad.Trans.Reader.ReaderT e f)
instance (Data.Functor.Bind.Class.Bind f, GHC.Base.Monad f) => Data.Functor.Alt.Alt (Control.Monad.Trans.Maybe.MaybeT f)
instance (Data.Functor.Bind.Class.Bind f, GHC.Base.Monad f) => Data.Functor.Alt.Alt (Control.Monad.Trans.Error.ErrorT e f)
instance (Data.Functor.Bind.Class.Bind f, GHC.Base.Monad f, Data.Semigroup.Semigroup e) => Data.Functor.Alt.Alt (Control.Monad.Trans.Except.ExceptT e f)
instance Data.Functor.Bind.Class.Apply f => Data.Functor.Alt.Alt (Control.Monad.Trans.List.ListT f)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Monad.Trans.State.Strict.StateT e f)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Monad.Trans.State.Lazy.StateT e f)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Monad.Trans.Writer.Strict.WriterT w f)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Monad.Trans.Writer.Lazy.WriterT w f)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Monad.Trans.RWS.Strict.RWST r w s f)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Monad.Trans.RWS.Lazy.RWST r w s f)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Applicative.Backwards.Backwards f)
instance (Data.Functor.Alt.Alt f, GHC.Base.Functor g) => Data.Functor.Alt.Alt (Data.Functor.Compose.Compose f g)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Applicative.Lift.Lift f)
instance (Data.Functor.Alt.Alt f, Data.Functor.Alt.Alt g) => Data.Functor.Alt.Alt (Data.Functor.Product.Product f g)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Data.Functor.Reverse.Reverse f)
module Data.Functor.Plus
-- | Laws:
--
-- <pre>
-- zero <!> m = m
-- m <!> zero = m
-- </pre>
--
-- If extended to an <a>Alternative</a> then <a>zero</a> should equal
-- <a>empty</a>.
class Alt f => Plus f
zero :: Plus f => f a
instance Data.Functor.Plus.Plus Data.Proxy.Proxy
instance Data.Functor.Plus.Plus GHC.Generics.U1
instance (Data.Functor.Plus.Plus f, Data.Functor.Plus.Plus g) => Data.Functor.Plus.Plus (f GHC.Generics.:*: g)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (GHC.Generics.M1 i c f)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (GHC.Generics.Rec1 f)
instance Data.Functor.Plus.Plus GHC.Types.IO
instance Data.Functor.Plus.Plus []
instance Data.Functor.Plus.Plus GHC.Base.Maybe
instance Data.Functor.Plus.Plus Data.Semigroup.Option
instance GHC.Base.MonadPlus m => Data.Functor.Plus.Plus (Control.Applicative.WrappedMonad m)
instance Control.Arrow.ArrowPlus a => Data.Functor.Plus.Plus (Control.Applicative.WrappedArrow a b)
instance GHC.Classes.Ord k => Data.Functor.Plus.Plus (Data.Map.Base.Map k)
instance Data.Functor.Plus.Plus Data.IntMap.Base.IntMap
instance Data.Functor.Plus.Plus Data.Sequence.Seq
instance GHC.Base.Alternative f => Data.Functor.Plus.Plus (Data.Functor.Bind.Class.WrappedApplicative f)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Monad.Trans.Identity.IdentityT f)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Monad.Trans.Reader.ReaderT e f)
instance (Data.Functor.Bind.Class.Bind f, GHC.Base.Monad f) => Data.Functor.Plus.Plus (Control.Monad.Trans.Maybe.MaybeT f)
instance (Data.Functor.Bind.Class.Bind f, GHC.Base.Monad f, Control.Monad.Trans.Error.Error e) => Data.Functor.Plus.Plus (Control.Monad.Trans.Error.ErrorT e f)
instance (Data.Functor.Bind.Class.Bind f, GHC.Base.Monad f, Data.Semigroup.Semigroup e, GHC.Base.Monoid e) => Data.Functor.Plus.Plus (Control.Monad.Trans.Except.ExceptT e f)
instance (Data.Functor.Bind.Class.Apply f, GHC.Base.Applicative f) => Data.Functor.Plus.Plus (Control.Monad.Trans.List.ListT f)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Monad.Trans.State.Strict.StateT e f)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Monad.Trans.State.Lazy.StateT e f)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Monad.Trans.Writer.Strict.WriterT w f)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Monad.Trans.Writer.Lazy.WriterT w f)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Monad.Trans.RWS.Strict.RWST r w s f)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Monad.Trans.RWS.Lazy.RWST r w s f)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Applicative.Backwards.Backwards f)
instance (Data.Functor.Plus.Plus f, GHC.Base.Functor g) => Data.Functor.Plus.Plus (Data.Functor.Compose.Compose f g)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Applicative.Lift.Lift f)
instance (Data.Functor.Plus.Plus f, Data.Functor.Plus.Plus g) => Data.Functor.Plus.Plus (Data.Functor.Product.Product f g)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Data.Functor.Reverse.Reverse f)
module Data.Semigroupoid.Static
newtype Static f a b
Static :: f (a -> b) -> Static f a b
[runStatic] :: Static f a b -> f (a -> b)
instance GHC.Base.Functor f => GHC.Base.Functor (Data.Semigroupoid.Static.Static f a)
instance Data.Functor.Bind.Class.Apply f => Data.Functor.Bind.Class.Apply (Data.Semigroupoid.Static.Static f a)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Data.Semigroupoid.Static.Static f a)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Data.Semigroupoid.Static.Static f a)
instance GHC.Base.Applicative f => GHC.Base.Applicative (Data.Semigroupoid.Static.Static f a)
instance (Data.Functor.Extend.Extend f, Data.Semigroup.Semigroup a) => Data.Functor.Extend.Extend (Data.Semigroupoid.Static.Static f a)
instance (Control.Comonad.Comonad f, GHC.Base.Monoid a) => Control.Comonad.Comonad (Data.Semigroupoid.Static.Static f a)
instance Data.Functor.Bind.Class.Apply f => Data.Semigroupoid.Semigroupoid (Data.Semigroupoid.Static.Static f)
instance GHC.Base.Applicative f => Control.Category.Category (Data.Semigroupoid.Static.Static f)
instance GHC.Base.Applicative f => Control.Arrow.Arrow (Data.Semigroupoid.Static.Static f)
instance GHC.Base.Alternative f => Control.Arrow.ArrowZero (Data.Semigroupoid.Static.Static f)
instance GHC.Base.Alternative f => Control.Arrow.ArrowPlus (Data.Semigroupoid.Static.Static f)
instance GHC.Base.Applicative f => Control.Arrow.ArrowChoice (Data.Semigroupoid.Static.Static f)
module Data.Semigroup.Foldable
class Foldable t => Foldable1 t where foldMap1 f = maybe (error "foldMap1") id . getOption . foldMap (Option . Just . f) fold1 = foldMap1 id toNonEmpty = foldMap1 (:| [])
fold1 :: (Foldable1 t, Semigroup m) => t m -> m
foldMap1 :: (Foldable1 t, Semigroup m) => (a -> m) -> t a -> m
toNonEmpty :: Foldable1 t => t a -> NonEmpty a
-- | Insert an <tt>m</tt> between each pair of 't m'. Equivalent to
-- <a>intercalateMap1</a> with <a>id</a> as the second argument.
--
-- <pre>
-- >>> intercalate1 ", " $ "hello" :| ["how", "are", "you"]
-- "hello, how, are, you"
-- </pre>
--
-- <pre>
-- >>> intercalate1 ", " $ "hello" :| []
-- "hello"
-- </pre>
--
-- <pre>
-- >>> intercalate1 mempty $ "I" :| ["Am", "Fine", "You?"]
-- "IAmFineYou?"
-- </pre>
intercalate1 :: (Foldable1 t, Semigroup m) => m -> t m -> m
-- | Insert <tt>m</tt> between each pair of <tt>m</tt> derived from
-- <tt>a</tt>.
--
-- <pre>
-- >>> intercalateMap1 " " show $ True :| [False, True]
-- "True False True"
-- </pre>
--
-- <pre>
-- >>> intercalateMap1 " " show $ True :| []
-- "True"
-- </pre>
intercalateMap1 :: (Foldable1 t, Semigroup m) => m -> (a -> m) -> t a -> m
traverse1_ :: (Foldable1 t, Apply f) => (a -> f b) -> t a -> f ()
for1_ :: (Foldable1 t, Apply f) => t a -> (a -> f b) -> f ()
sequenceA1_ :: (Foldable1 t, Apply f) => t (f a) -> f ()
-- | Usable default for foldMap, but only if you define foldMap1 yourself
foldMapDefault1 :: (Foldable1 t, Monoid m) => (a -> m) -> t a -> m
asum1 :: (Foldable1 t, Alt m) => t (m a) -> m a
-- | Monadic fold over the elements of a non-empty structure, associating
-- to the right, i.e. from right to left.
--
-- <pre>
-- let g = (=<<) . f
-- in foldrM1 f (x1 :| [x2, ..., xn]) == x1 `g` (x2 `g` ... (xn-1 `f` xn)...)
-- </pre>
foldrM1 :: (Foldable1 t, Monad m) => (a -> a -> m a) -> t a -> m a
-- | Monadic fold over the elements of a non-empty structure, associating
-- to the left, i.e. from left to right.
--
-- <pre>
-- let g = flip $ (=<<) . f
-- in foldlM1 f (x1 :| [x2, ..., xn]) == (...((x1 `f` x2) `g` x2) `g`...) `g` xn
-- </pre>
foldlM1 :: (Foldable1 t, Monad m) => (a -> a -> m a) -> t a -> m a
instance Data.Semigroup.Semigroup a => Data.Semigroup.Semigroup (Data.Semigroup.Foldable.JoinWith a)
instance Data.Functor.Bind.Class.Apply f => Data.Semigroup.Semigroup (Data.Semigroup.Foldable.Act f a)
instance GHC.Base.Functor f => GHC.Base.Functor (Data.Semigroup.Foldable.Act f)
instance Data.Functor.Alt.Alt f => Data.Semigroup.Semigroup (Data.Semigroup.Foldable.Alt_ f a)
module Data.Semigroup.Traversable.Class
class (Bifoldable1 t, Bitraversable t) => Bitraversable1 t where bitraverse1 f g = bisequence1 . bimap f g bisequence1 = bitraverse1 id id
bitraverse1 :: (Bitraversable1 t, Apply f) => (a -> f b) -> (c -> f d) -> t a c -> f (t b d)
bisequence1 :: (Bitraversable1 t, Apply f) => t (f a) (f b) -> f (t a b)
class (Foldable1 t, Traversable t) => Traversable1 t where sequence1 = traverse1 id traverse1 f = sequence1 . fmap f
traverse1 :: (Traversable1 t, Apply f) => (a -> f b) -> t a -> f (t b)
sequence1 :: (Traversable1 t, Apply f) => t (f b) -> f (t b)
instance Data.Semigroup.Traversable.Class.Bitraversable1 Data.Semigroup.Arg
instance Data.Semigroup.Traversable.Class.Bitraversable1 Data.Either.Either
instance Data.Semigroup.Traversable.Class.Bitraversable1 (,)
instance Data.Semigroup.Traversable.Class.Bitraversable1 ((,,) x)
instance Data.Semigroup.Traversable.Class.Bitraversable1 ((,,,) x y)
instance Data.Semigroup.Traversable.Class.Bitraversable1 ((,,,,) x y z)
instance Data.Semigroup.Traversable.Class.Bitraversable1 Data.Functor.Const.Const
instance Data.Semigroup.Traversable.Class.Bitraversable1 Data.Tagged.Tagged
instance (Data.Semigroup.Traversable.Class.Bitraversable1 p, Data.Semigroup.Traversable.Class.Traversable1 f, Data.Semigroup.Traversable.Class.Traversable1 g) => Data.Semigroup.Traversable.Class.Bitraversable1 (Data.Bifunctor.Biff.Biff p f g)
instance Data.Semigroup.Traversable.Class.Traversable1 f => Data.Semigroup.Traversable.Class.Bitraversable1 (Data.Bifunctor.Clown.Clown f)
instance Data.Semigroup.Traversable.Class.Bitraversable1 p => Data.Semigroup.Traversable.Class.Bitraversable1 (Data.Bifunctor.Flip.Flip p)
instance Data.Semigroup.Traversable.Class.Bitraversable1 p => Data.Semigroup.Traversable.Class.Traversable1 (Data.Bifunctor.Join.Join p)
instance Data.Semigroup.Traversable.Class.Traversable1 g => Data.Semigroup.Traversable.Class.Bitraversable1 (Data.Bifunctor.Joker.Joker g)
instance (Data.Semigroup.Traversable.Class.Bitraversable1 f, Data.Semigroup.Traversable.Class.Bitraversable1 g) => Data.Semigroup.Traversable.Class.Bitraversable1 (Data.Bifunctor.Product.Product f g)
instance (Data.Semigroup.Traversable.Class.Traversable1 f, Data.Semigroup.Traversable.Class.Bitraversable1 p) => Data.Semigroup.Traversable.Class.Bitraversable1 (Data.Bifunctor.Tannen.Tannen f p)
instance Data.Semigroup.Traversable.Class.Bitraversable1 p => Data.Semigroup.Traversable.Class.Bitraversable1 (Data.Bifunctor.Wrapped.WrappedBifunctor p)
instance Data.Semigroup.Traversable.Class.Traversable1 f => Data.Semigroup.Traversable.Class.Traversable1 (GHC.Generics.Rec1 f)
instance Data.Semigroup.Traversable.Class.Traversable1 f => Data.Semigroup.Traversable.Class.Traversable1 (GHC.Generics.M1 i c f)
instance Data.Semigroup.Traversable.Class.Traversable1 GHC.Generics.Par1
instance Data.Semigroup.Traversable.Class.Traversable1 GHC.Generics.V1
instance (Data.Semigroup.Traversable.Class.Traversable1 f, Data.Semigroup.Traversable.Class.Traversable1 g) => Data.Semigroup.Traversable.Class.Traversable1 (f GHC.Generics.:*: g)
instance (Data.Semigroup.Traversable.Class.Traversable1 f, Data.Semigroup.Traversable.Class.Traversable1 g) => Data.Semigroup.Traversable.Class.Traversable1 (f GHC.Generics.:+: g)
instance (Data.Semigroup.Traversable.Class.Traversable1 f, Data.Semigroup.Traversable.Class.Traversable1 g) => Data.Semigroup.Traversable.Class.Traversable1 (f GHC.Generics.:.: g)
instance Data.Semigroup.Traversable.Class.Traversable1 Data.Functor.Identity.Identity
instance Data.Semigroup.Traversable.Class.Traversable1 f => Data.Semigroup.Traversable.Class.Traversable1 (Control.Monad.Trans.Identity.IdentityT f)
instance Data.Semigroup.Traversable.Class.Traversable1 f => Data.Semigroup.Traversable.Class.Traversable1 (Control.Applicative.Backwards.Backwards f)
instance (Data.Semigroup.Traversable.Class.Traversable1 f, Data.Semigroup.Traversable.Class.Traversable1 g) => Data.Semigroup.Traversable.Class.Traversable1 (Data.Functor.Compose.Compose f g)
instance Data.Semigroup.Traversable.Class.Traversable1 f => Data.Semigroup.Traversable.Class.Traversable1 (Control.Applicative.Lift.Lift f)
instance (Data.Semigroup.Traversable.Class.Traversable1 f, Data.Semigroup.Traversable.Class.Traversable1 g) => Data.Semigroup.Traversable.Class.Traversable1 (Data.Functor.Product.Product f g)
instance Data.Semigroup.Traversable.Class.Traversable1 f => Data.Semigroup.Traversable.Class.Traversable1 (Data.Functor.Reverse.Reverse f)
instance (Data.Semigroup.Traversable.Class.Traversable1 f, Data.Semigroup.Traversable.Class.Traversable1 g) => Data.Semigroup.Traversable.Class.Traversable1 (Data.Functor.Sum.Sum f g)
instance Data.Semigroup.Traversable.Class.Traversable1 Data.Complex.Complex
instance Data.Semigroup.Traversable.Class.Traversable1 (Data.Tagged.Tagged a)
instance Data.Semigroup.Traversable.Class.Traversable1 Data.Tree.Tree
instance Data.Semigroup.Traversable.Class.Traversable1 Data.List.NonEmpty.NonEmpty
instance Data.Semigroup.Traversable.Class.Traversable1 ((,) a)
instance Data.Semigroup.Traversable.Class.Traversable1 g => Data.Semigroup.Traversable.Class.Traversable1 (Data.Bifunctor.Joker.Joker g a)
module Data.Semigroup.Bitraversable
class (Bifoldable1 t, Bitraversable t) => Bitraversable1 t where bitraverse1 f g = bisequence1 . bimap f g bisequence1 = bitraverse1 id id
bitraverse1 :: (Bitraversable1 t, Apply f) => (a -> f b) -> (c -> f d) -> t a c -> f (t b d)
bisequence1 :: (Bitraversable1 t, Apply f) => t (f a) (f b) -> f (t a b)
bifoldMap1Default :: (Bitraversable1 t, Semigroup m) => (a -> m) -> (b -> m) -> t a b -> m
module Data.Semigroup.Traversable
class (Foldable1 t, Traversable t) => Traversable1 t where sequence1 = traverse1 id traverse1 f = sequence1 . fmap f
traverse1 :: (Traversable1 t, Apply f) => (a -> f b) -> t a -> f (t b)
sequence1 :: (Traversable1 t, Apply f) => t (f b) -> f (t b)
foldMap1Default :: (Traversable1 f, Semigroup m) => (a -> m) -> f a -> m
module Data.Bifunctor.Apply
-- | Formally, the class <a>Bifunctor</a> represents a bifunctor from
-- <tt>Hask</tt> -> <tt>Hask</tt>.
--
-- Intuitively it is a bifunctor where both the first and second
-- arguments are covariant.
--
-- You can define a <a>Bifunctor</a> by either defining <a>bimap</a> or
-- by defining both <a>first</a> and <a>second</a>.
--
-- If you supply <a>bimap</a>, you should ensure that:
--
-- <pre>
-- <a>bimap</a> <a>id</a> <a>id</a> ≡ <a>id</a>
-- </pre>
--
-- If you supply <a>first</a> and <a>second</a>, ensure:
--
-- <pre>
-- <a>first</a> <a>id</a> ≡ <a>id</a>
-- <a>second</a> <a>id</a> ≡ <a>id</a>
-- </pre>
--
-- If you supply both, you should also ensure:
--
-- <pre>
-- <a>bimap</a> f g ≡ <a>first</a> f <a>.</a> <a>second</a> g
-- </pre>
--
-- These ensure by parametricity:
--
-- <pre>
-- <a>bimap</a> (f <a>.</a> g) (h <a>.</a> i) ≡ <a>bimap</a> f h <a>.</a> <a>bimap</a> g i
-- <a>first</a> (f <a>.</a> g) ≡ <a>first</a> f <a>.</a> <a>first</a> g
-- <a>second</a> (f <a>.</a> g) ≡ <a>second</a> f <a>.</a> <a>second</a> g
-- </pre>
class Bifunctor (p :: * -> * -> *)
-- | Map over both arguments at the same time.
--
-- <pre>
-- <a>bimap</a> f g ≡ <a>first</a> f <a>.</a> <a>second</a> g
-- </pre>
bimap :: Bifunctor p => (a -> b) -> (c -> d) -> p a c -> p b d
-- | Map covariantly over the first argument.
--
-- <pre>
-- <a>first</a> f ≡ <a>bimap</a> f <a>id</a>
-- </pre>
first :: Bifunctor p => (a -> b) -> p a c -> p b c
-- | Map covariantly over the second argument.
--
-- <pre>
-- <a>second</a> ≡ <a>bimap</a> <a>id</a>
-- </pre>
second :: Bifunctor p => (b -> c) -> p a b -> p a c
class Bifunctor p => Biapply p where a .>> b = bimap (const id) (const id) <<$>> a <<.>> b a <<. b = bimap const const <<$>> a <<.>> b
(<<.>>) :: Biapply p => p (a -> b) (c -> d) -> p a c -> p b d
-- | <pre>
-- a <a>.></a> b ≡ <a>const</a> <a>id</a> <a><$></a> a <a><.></a> b
-- </pre>
(.>>) :: Biapply p => p a b -> p c d -> p c d
-- | <pre>
-- a <a><.</a> b ≡ <a>const</a> <a><$></a> a <a><.></a> b
-- </pre>
(<<.) :: Biapply p => p a b -> p c d -> p a b
(<<$>>) :: (a -> b) -> a -> b
infixl 4 <<$>>
(<<..>>) :: Biapply p => p a c -> p (a -> b) (c -> d) -> p b d
infixl 4 <<..>>
-- | Lift binary functions
bilift2 :: Biapply w => (a -> b -> c) -> (d -> e -> f) -> w a d -> w b e -> w c f
-- | Lift ternary functions
bilift3 :: Biapply w => (a -> b -> c -> d) -> (e -> f -> g -> h) -> w a e -> w b f -> w c g -> w d h
|