/usr/share/doc/libghc-conduit-combinators-doc/html/conduit-combinators.txt is in libghc-conduit-combinators-doc 0.2.8.2-1.
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 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 | -- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Commonly used conduit functions, for both chunked and unchunked data
--
-- Provides a replacement for Data.Conduit.List, as well as a convenient
-- Conduit module.
@package conduit-combinators
@version 0.2.8.2
-- | Internal helper functions, usually used for rewrite rules.
module Data.Conduit.Combinators.Internal
-- | Acquire the seed value and perform the given action with it n times,
-- yielding each result.
--
-- Since 0.2.1
initReplicate :: Monad m => m seed -> (seed -> m a) -> Int -> Producer m a
-- | Optimized version of initReplicate for the special case of connecting
-- with a <tt>Sink</tt>.
--
-- Since 0.2.1
initReplicateConnect :: Monad m => m seed -> (seed -> m a) -> Int -> Sink a m b -> m b
-- | Acquire the seed value and perform the given action with it forever,
-- yielding each result.
--
-- Since 0.2.1
initRepeat :: Monad m => m seed -> (seed -> m a) -> Producer m a
-- | Optimized version of initRepeat for the special case of connecting
-- with a <tt>Sink</tt>.
--
-- Since 0.2.1
initRepeatConnect :: Monad m => m seed -> (seed -> m a) -> Sink a m b -> m b
-- | This module is meant as a replacement for Data.Conduit.List. That
-- module follows a naming scheme which was originally inspired by its
-- enumerator roots. This module is meant to introduce a naming scheme
-- which encourages conduit best practices.
--
-- There are two versions of functions in this module. Those with a
-- trailing E work in the individual elements of a chunk of data, e.g.,
-- the bytes of a ByteString, the Chars of a Text, or the Ints of a
-- Vector Int. Those without a trailing E work on unchunked streams.
--
-- FIXME: discuss overall naming, usage of mono-traversable, etc
--
-- Mention take (Conduit) vs drop (Consumer)
module Data.Conduit.Combinators
-- | Yield each of the values contained by the given <tt>MonoFoldable</tt>.
--
-- This will work on many data structures, including lists,
-- <tt>ByteString</tt>s, and <tt>Vector</tt>s.
--
-- Since 1.0.0
yieldMany :: (Monad m, MonoFoldable mono) => mono -> Producer m (Element mono)
-- | Generate a producer from a seed value.
--
-- Since 1.0.0
unfold :: Monad m => (b -> Maybe (a, b)) -> b -> Producer m a
-- | Enumerate from a value to a final value, inclusive, via <a>succ</a>.
--
-- This is generally more efficient than using <tt>Prelude</tt>'s
-- <tt>enumFromTo</tt> and combining with <tt>sourceList</tt> since this
-- avoids any intermediate data structures.
--
-- Since 1.0.0
enumFromTo :: (Monad m, Enum a, Eq a) => a -> a -> Producer m a
-- | Produces an infinite stream of repeated applications of f to x.
--
-- Since 1.0.0
iterate :: Monad m => (a -> a) -> a -> Producer m a
-- | Produce an infinite stream consisting entirely of the given value.
--
-- Since 1.0.0
repeat :: Monad m => a -> Producer m a
-- | Produce a finite stream consisting of n copies of the given value.
--
-- Since 1.0.0
replicate :: Monad m => Int -> a -> Producer m a
-- | Generate a producer by yielding each of the strict chunks in a
-- <tt>LazySequence</tt>.
--
-- For more information, see <a>toChunks</a>.
--
-- Since 1.0.0
sourceLazy :: (Monad m, LazySequence lazy strict) => lazy -> Producer m strict
-- | Repeatedly run the given action and yield all values it produces.
--
-- Since 1.0.0
repeatM :: Monad m => m a -> Producer m a
-- | Repeatedly run the given action and yield all values it produces,
-- until the provided predicate returns <tt>False</tt>.
--
-- Since 1.0.0
repeatWhileM :: Monad m => m a -> (a -> Bool) -> Producer m a
-- | Perform the given action n times, yielding each result.
--
-- Since 1.0.0
replicateM :: Monad m => Int -> m a -> Producer m a
sourceFile :: (MonadResource m, IOData a) => FilePath -> Producer m a
-- | Read all data from the given <tt>Handle</tt>.
--
-- Does not close the <tt>Handle</tt> at any point.
--
-- Since 1.0.0
sourceHandle :: (MonadIO m, IOData a) => Handle -> Producer m a
-- | Open a <tt>Handle</tt> using the given function and stream data from
-- it.
--
-- Automatically closes the file at completion.
--
-- Since 1.0.0
sourceIOHandle :: (MonadResource m, IOData a) => IO Handle -> Producer m a
-- | <tt>sourceHandle</tt> applied to <tt>stdin</tt>.
--
-- Since 1.0.0
stdin :: (MonadIO m, IOData a) => Producer m a
-- | Create an infinite stream of random values, seeding from the system
-- random number.
--
-- Since 1.0.0
sourceRandom :: (Variate a, MonadIO m) => Producer m a
-- | Create a stream of random values of length n, seeding from the system
-- random number.
--
-- Since 1.0.0
sourceRandomN :: (Variate a, MonadIO m) => Int -> Producer m a
-- | Create an infinite stream of random values, using the given random
-- number generator.
--
-- Since 1.0.0
sourceRandomGen :: (Variate a, MonadBase base m, PrimMonad base) => Gen (PrimState base) -> Producer m a
-- | Create a stream of random values of length n, seeding from the system
-- random number.
--
-- Since 1.0.0
sourceRandomNGen :: (Variate a, MonadBase base m, PrimMonad base) => Gen (PrimState base) -> Int -> Producer m a
-- | Stream the contents of the given directory, without traversing deeply.
--
-- This function will return <i>all</i> of the contents of the directory,
-- whether they be files, directories, etc.
--
-- Note that the generated filepaths will be the complete path, not just
-- the filename. In other words, if you have a directory <tt>foo</tt>
-- containing files <tt>bar</tt> and <tt>baz</tt>, and you use
-- <tt>sourceDirectory</tt> on <tt>foo</tt>, the results will be
-- <tt>foo<i>bar@ and @foo</i>baz</tt>.
--
-- Since 1.0.0
sourceDirectory :: MonadResource m => FilePath -> Producer m FilePath
-- | Deeply stream the contents of the given directory.
--
-- This works the same as <tt>sourceDirectory</tt>, but will not return
-- directories at all. This function also takes an extra parameter to
-- indicate whether symlinks will be followed.
--
-- Since 1.0.0
sourceDirectoryDeep :: MonadResource m => Bool -> FilePath -> Producer m FilePath
-- | Ignore a certain number of values in the stream.
--
-- Since 1.0.0
drop :: Monad m => Int -> Consumer a m ()
-- | Drop a certain number of elements from a chunked stream.
--
-- Since 1.0.0
dropE :: (Monad m, IsSequence seq) => Index seq -> Consumer seq m ()
-- | Drop all values which match the given predicate.
--
-- Since 1.0.0
dropWhile :: Monad m => (a -> Bool) -> Consumer a m ()
-- | Drop all elements in the chunked stream which match the given
-- predicate.
--
-- Since 1.0.0
dropWhileE :: (Monad m, IsSequence seq) => (Element seq -> Bool) -> Consumer seq m ()
-- | Monoidally combine all values in the stream.
--
-- Since 1.0.0
fold :: (Monad m, Monoid a) => Consumer a m a
-- | Monoidally combine all elements in the chunked stream.
--
-- Since 1.0.0
foldE :: (Monad m, MonoFoldable mono, Monoid (Element mono)) => Consumer mono m (Element mono)
-- | A strict left fold.
--
-- Since 1.0.0
foldl :: Monad m => (a -> b -> a) -> a -> Consumer b m a
-- | A strict left fold on a chunked stream.
--
-- Since 1.0.0
foldlE :: (Monad m, MonoFoldable mono) => (a -> Element mono -> a) -> a -> Consumer mono m a
-- | Apply the provided mapping function and monoidal combine all values.
--
-- Since 1.0.0
foldMap :: (Monad m, Monoid b) => (a -> b) -> Consumer a m b
-- | Apply the provided mapping function and monoidal combine all elements
-- of the chunked stream.
--
-- Since 1.0.0
foldMapE :: (Monad m, MonoFoldable mono, Monoid w) => (Element mono -> w) -> Consumer mono m w
-- | Check that all values in the stream return True.
--
-- Subject to shortcut logic: at the first False, consumption of the
-- stream will stop.
--
-- Since 1.0.0
all :: Monad m => (a -> Bool) -> Consumer a m Bool
-- | Check that all elements in the chunked stream return True.
--
-- Subject to shortcut logic: at the first False, consumption of the
-- stream will stop.
--
-- Since 1.0.0
allE :: (Monad m, MonoFoldable mono) => (Element mono -> Bool) -> Consumer mono m Bool
-- | Check that at least one value in the stream returns True.
--
-- Subject to shortcut logic: at the first True, consumption of the
-- stream will stop.
--
-- Since 1.0.0
any :: Monad m => (a -> Bool) -> Consumer a m Bool
-- | Check that at least one element in the chunked stream returns True.
--
-- Subject to shortcut logic: at the first True, consumption of the
-- stream will stop.
--
-- Since 1.0.0
anyE :: (Monad m, MonoFoldable mono) => (Element mono -> Bool) -> Consumer mono m Bool
-- | Are all values in the stream True?
--
-- Consumption stops once the first False is encountered.
--
-- Since 1.0.0
and :: Monad m => Consumer Bool m Bool
-- | Are all elements in the chunked stream True?
--
-- Consumption stops once the first False is encountered.
--
-- Since 1.0.0
andE :: (Monad m, MonoFoldable mono, Element mono ~ Bool) => Consumer mono m Bool
-- | Are any values in the stream True?
--
-- Consumption stops once the first True is encountered.
--
-- Since 1.0.0
or :: Monad m => Consumer Bool m Bool
-- | Are any elements in the chunked stream True?
--
-- Consumption stops once the first True is encountered.
--
-- Since 1.0.0
orE :: (Monad m, MonoFoldable mono, Element mono ~ Bool) => Consumer mono m Bool
-- | Are any values in the stream equal to the given value?
--
-- Stops consuming as soon as a match is found.
--
-- Since 1.0.0
elem :: (Monad m, Eq a) => a -> Consumer a m Bool
-- | Are any elements in the chunked stream equal to the given element?
--
-- Stops consuming as soon as a match is found.
--
-- Since 1.0.0
elemE :: (Monad m, EqSequence seq) => Element seq -> Consumer seq m Bool
-- | Are no values in the stream equal to the given value?
--
-- Stops consuming as soon as a match is found.
--
-- Since 1.0.0
notElem :: (Monad m, Eq a) => a -> Consumer a m Bool
-- | Are no elements in the chunked stream equal to the given element?
--
-- Stops consuming as soon as a match is found.
--
-- Since 1.0.0
notElemE :: (Monad m, EqSequence seq) => Element seq -> Consumer seq m Bool
-- | Consume all incoming strict chunks into a lazy sequence. Note that the
-- entirety of the sequence will be resident at memory.
--
-- This can be used to consume a stream of strict ByteStrings into a lazy
-- ByteString, for example.
--
-- Since 1.0.0
sinkLazy :: (Monad m, LazySequence lazy strict) => Consumer strict m lazy
-- | Consume all values from the stream and return as a list. Note that
-- this will pull all values into memory.
--
-- Since 1.0.0
sinkList :: Monad m => Consumer a m [a]
-- | Sink incoming values into a vector, growing the vector as necessary to
-- fit more elements.
--
-- Note that using this function is more memory efficient than
-- <tt>sinkList</tt> and then converting to a <tt>Vector</tt>, as it
-- avoids intermediate list constructors.
--
-- Since 1.0.0
sinkVector :: (MonadBase base m, Vector v a, PrimMonad base) => Consumer a m (v a)
-- | Sink incoming values into a vector, up until size <tt>maxSize</tt>.
-- Subsequent values will be left in the stream. If there are less than
-- <tt>maxSize</tt> values present, returns a <tt>Vector</tt> of smaller
-- size.
--
-- Note that using this function is more memory efficient than
-- <tt>sinkList</tt> and then converting to a <tt>Vector</tt>, as it
-- avoids intermediate list constructors.
--
-- Since 1.0.0
sinkVectorN :: (MonadBase base m, Vector v a, PrimMonad base) => Int -> Consumer a m (v a)
-- | Convert incoming values to a builder and fold together all builder
-- values.
--
-- Defined as: <tt>foldMap toBuilder</tt>.
--
-- Since 1.0.0
sinkBuilder :: (Monad m, Monoid builder, ToBuilder a builder) => Consumer a m builder
-- | Same as <tt>sinkBuilder</tt>, but afterwards convert the builder to
-- its lazy representation.
--
-- Alternatively, this could be considered an alternative to
-- <tt>sinkLazy</tt>, with the following differences:
--
-- <ul>
-- <li>This function will allow multiple input types, not just the strict
-- version of the lazy structure.</li>
-- <li>Some buffer copying may occur in this version.</li>
-- </ul>
--
-- Since 1.0.0
sinkLazyBuilder :: (Monad m, Monoid builder, ToBuilder a builder, Builder builder lazy) => Consumer a m lazy
-- | Consume and discard all remaining values in the stream.
--
-- Since 1.0.0
sinkNull :: Monad m => Consumer a m ()
-- | Same as <tt>await</tt>, but discards any leading <a>onull</a> values.
--
-- Since 1.0.0
awaitNonNull :: (Monad m, MonoFoldable a) => Consumer a m (Maybe (NonNull a))
-- | Get the next element in the chunked stream.
--
-- Since 1.0.0
headE :: (Monad m, IsSequence seq) => Consumer seq m (Maybe (Element seq))
-- | View the next value in the stream without consuming it.
--
-- Since 1.0.0
peek :: Monad m => Consumer a m (Maybe a)
-- | View the next element in the chunked stream without consuming it.
--
-- Since 1.0.0
peekE :: (Monad m, MonoFoldable mono) => Consumer mono m (Maybe (Element mono))
-- | Retrieve the last value in the stream, if present.
--
-- Since 1.0.0
last :: Monad m => Consumer a m (Maybe a)
-- | Retrieve the last element in the chunked stream, if present.
--
-- Since 1.0.0
lastE :: (Monad m, IsSequence seq) => Consumer seq m (Maybe (Element seq))
-- | Count how many values are in the stream.
--
-- Since 1.0.0
length :: (Monad m, Num len) => Consumer a m len
-- | Count how many elements are in the chunked stream.
--
-- Since 1.0.0
lengthE :: (Monad m, Num len, MonoFoldable mono) => Consumer mono m len
-- | Count how many values in the stream pass the given predicate.
--
-- Since 1.0.0
lengthIf :: (Monad m, Num len) => (a -> Bool) -> Consumer a m len
-- | Count how many elements in the chunked stream pass the given
-- predicate.
--
-- Since 1.0.0
lengthIfE :: (Monad m, Num len, MonoFoldable mono) => (Element mono -> Bool) -> Consumer mono m len
-- | Get the largest value in the stream, if present.
--
-- Since 1.0.0
maximum :: (Monad m, Ord a) => Consumer a m (Maybe a)
-- | Get the largest element in the chunked stream, if present.
--
-- Since 1.0.0
maximumE :: (Monad m, OrdSequence seq) => Consumer seq m (Maybe (Element seq))
-- | Get the smallest value in the stream, if present.
--
-- Since 1.0.0
minimum :: (Monad m, Ord a) => Consumer a m (Maybe a)
-- | Get the smallest element in the chunked stream, if present.
--
-- Since 1.0.0
minimumE :: (Monad m, OrdSequence seq) => Consumer seq m (Maybe (Element seq))
-- | True if there are no values in the stream.
--
-- This function does not modify the stream.
--
-- Since 1.0.0
null :: Monad m => Consumer a m Bool
-- | True if there are no elements in the chunked stream.
--
-- This function may remove empty leading chunks from the stream, but
-- otherwise will not modify it.
--
-- Since 1.0.0
nullE :: (Monad m, MonoFoldable mono) => Consumer mono m Bool
-- | Get the sum of all values in the stream.
--
-- Since 1.0.0
sum :: (Monad m, Num a) => Consumer a m a
-- | Get the sum of all elements in the chunked stream.
--
-- Since 1.0.0
sumE :: (Monad m, MonoFoldable mono, Num (Element mono)) => Consumer mono m (Element mono)
-- | Get the product of all values in the stream.
--
-- Since 1.0.0
product :: (Monad m, Num a) => Consumer a m a
-- | Get the product of all elements in the chunked stream.
--
-- Since 1.0.0
productE :: (Monad m, MonoFoldable mono, Num (Element mono)) => Consumer mono m (Element mono)
-- | Find the first matching value.
--
-- Since 1.0.0
find :: Monad m => (a -> Bool) -> Consumer a m (Maybe a)
-- | Apply the action to all values in the stream.
--
-- Since 1.0.0
mapM_ :: Monad m => (a -> m ()) -> Consumer a m ()
-- | Apply the action to all elements in the chunked stream.
--
-- Since 1.0.0
mapM_E :: (Monad m, MonoFoldable mono) => (Element mono -> m ()) -> Consumer mono m ()
-- | A monadic strict left fold.
--
-- Since 1.0.0
foldM :: Monad m => (a -> b -> m a) -> a -> Consumer b m a
-- | A monadic strict left fold on a chunked stream.
--
-- Since 1.0.0
foldME :: (Monad m, MonoFoldable mono) => (a -> Element mono -> m a) -> a -> Consumer mono m a
-- | Apply the provided monadic mapping function and monoidal combine all
-- values.
--
-- Since 1.0.0
foldMapM :: (Monad m, Monoid w) => (a -> m w) -> Consumer a m w
-- | Apply the provided monadic mapping function and monoidal combine all
-- elements in the chunked stream.
--
-- Since 1.0.0
foldMapME :: (Monad m, MonoFoldable mono, Monoid w) => (Element mono -> m w) -> Consumer mono m w
sinkFile :: (MonadResource m, IOData a) => FilePath -> Consumer a m ()
-- | Write all data to the given <tt>Handle</tt>.
--
-- Does not close the <tt>Handle</tt> at any point.
--
-- Since 1.0.0
sinkHandle :: (MonadIO m, IOData a) => Handle -> Consumer a m ()
-- | Open a <tt>Handle</tt> using the given function and stream data to it.
--
-- Automatically closes the file at completion.
--
-- Since 1.0.0
sinkIOHandle :: (MonadResource m, IOData a) => IO Handle -> Consumer a m ()
-- | Print all incoming values to stdout.
--
-- Since 1.0.0
print :: (Show a, MonadIO m) => Consumer a m ()
-- | <tt>sinkHandle</tt> applied to <tt>stdout</tt>.
--
-- Since 1.0.0
stdout :: (MonadIO m, IOData a) => Consumer a m ()
-- | <tt>sinkHandle</tt> applied to <tt>stderr</tt>.
--
-- Since 1.0.0
stderr :: (MonadIO m, IOData a) => Consumer a m ()
-- | Apply a transformation to all values in a stream.
--
-- Since 1.0.0
map :: Monad m => (a -> b) -> Conduit a m b
-- | Apply a transformation to all elements in a chunked stream.
--
-- Since 1.0.0
mapE :: (Monad m, Functor f) => (a -> b) -> Conduit (f a) m (f b)
-- | Apply a monomorphic transformation to all elements in a chunked
-- stream.
--
-- Unlike <tt>mapE</tt>, this will work on types like <tt>ByteString</tt>
-- and <tt>Text</tt> which are <tt>MonoFunctor</tt> but not
-- <tt>Functor</tt>.
--
-- Since 1.0.0
omapE :: (Monad m, MonoFunctor mono) => (Element mono -> Element mono) -> Conduit mono m mono
-- | Apply the function to each value in the stream, resulting in a
-- foldable value (e.g., a list). Then yield each of the individual
-- values in that foldable value separately.
--
-- Generalizes concatMap, mapMaybe, and mapFoldable.
--
-- Since 1.0.0
concatMap :: (Monad m, MonoFoldable mono) => (a -> mono) -> Conduit a m (Element mono)
-- | Apply the function to each element in the chunked stream, resulting in
-- a foldable value (e.g., a list). Then yield each of the individual
-- values in that foldable value separately.
--
-- Generalizes concatMap, mapMaybe, and mapFoldable.
--
-- Since 1.0.0
concatMapE :: (Monad m, MonoFoldable mono, Monoid w) => (Element mono -> w) -> Conduit mono m w
-- | Stream up to n number of values downstream.
--
-- Note that, if downstream terminates early, not all values will be
-- consumed. If you want to force <i>exactly</i> the given number of
-- values to be consumed, see <a>takeExactly</a>.
--
-- Since 1.0.0
take :: Monad m => Int -> Conduit a m a
-- | Stream up to n number of elements downstream in a chunked stream.
--
-- Note that, if downstream terminates early, not all values will be
-- consumed. If you want to force <i>exactly</i> the given number of
-- values to be consumed, see <a>takeExactlyE</a>.
--
-- Since 1.0.0
takeE :: (Monad m, IsSequence seq) => Index seq -> Conduit seq m seq
-- | Stream all values downstream that match the given predicate.
--
-- Same caveats regarding downstream termination apply as with
-- <a>take</a>.
--
-- Since 1.0.0
takeWhile :: Monad m => (a -> Bool) -> Conduit a m a
-- | Stream all elements downstream that match the given predicate in a
-- chunked stream.
--
-- Same caveats regarding downstream termination apply as with
-- <a>takeE</a>.
--
-- Since 1.0.0
takeWhileE :: (Monad m, IsSequence seq) => (Element seq -> Bool) -> Conduit seq m seq
-- | Consume precisely the given number of values and feed them downstream.
--
-- This function is in contrast to <a>take</a>, which will only consume
-- up to the given number of values, and will terminate early if
-- downstream terminates early. This function will discard any additional
-- values in the stream if they are unconsumed.
--
-- Note that this function takes a downstream <tt>ConduitM</tt> as a
-- parameter, as opposed to working with normal fusion. For more
-- information, see
-- <a>http://www.yesodweb.com/blog/2013/10/core-flaw-pipes-conduit</a>,
-- the section titled "pipes and conduit: isolate".
--
-- Since 1.0.0
takeExactly :: Monad m => Int -> ConduitM a b m r -> ConduitM a b m r
-- | Same as <a>takeExactly</a>, but for chunked streams.
--
-- Since 1.0.0
takeExactlyE :: (Monad m, IsSequence a) => Index a -> ConduitM a b m r -> ConduitM a b m r
-- | Flatten out a stream by yielding the values contained in an incoming
-- <tt>MonoFoldable</tt> as individually yielded values.
--
-- Since 1.0.0
concat :: (Monad m, MonoFoldable mono) => Conduit mono m (Element mono)
-- | Keep only values in the stream passing a given predicate.
--
-- Since 1.0.0
filter :: Monad m => (a -> Bool) -> Conduit a m a
-- | Keep only elements in the chunked stream passing a given predicate.
--
-- Since 1.0.0
filterE :: (IsSequence seq, Monad m) => (Element seq -> Bool) -> Conduit seq m seq
-- | Map values as long as the result is <tt>Just</tt>.
--
-- Since 1.0.0
mapWhile :: Monad m => (a -> Maybe b) -> Conduit a m b
-- | Break up a stream of values into vectors of size n. The final vector
-- may be smaller than n if the total number of values is not a strict
-- multiple of n. No empty vectors will be yielded.
--
-- Since 1.0.0
conduitVector :: (MonadBase base m, Vector v a, PrimMonad base) => Int -> Conduit a m (v a)
-- | Analog of <a>scanl</a> for lists.
--
-- Since 1.0.6
scanl :: Monad m => (a -> b -> a) -> a -> Conduit b m a
-- | <a>concatMap</a> with an accumulator.
--
-- Since 1.0.0
concatMapAccum :: Monad m => (a -> accum -> (accum, [b])) -> accum -> Conduit a m b
-- | Insert the given value between each two values in the stream.
--
-- Since 1.0.0
intersperse :: Monad m => a -> Conduit a m a
-- | Sliding window of values 1,2,3,4,5 with window size 2 gives
-- [1,2],[2,3],[3,4],[4,5]
--
-- Best used with structures that support O(1) snoc.
--
-- Since 1.0.0
slidingWindow :: (Monad m, IsSequence seq, Element seq ~ a) => Int -> Conduit a m seq
-- | Apply base64-encoding to the stream.
--
-- Since 1.0.0
encodeBase64 :: Monad m => Conduit ByteString m ByteString
-- | Apply base64-decoding to the stream. Will stop decoding on the first
-- invalid chunk.
--
-- Since 1.0.0
decodeBase64 :: Monad m => Conduit ByteString m ByteString
-- | Apply URL-encoding to the stream.
--
-- Since 1.0.0
encodeBase64URL :: Monad m => Conduit ByteString m ByteString
-- | Apply lenient base64URL-decoding to the stream. Will stop decoding on
-- the first invalid chunk.
--
-- Since 1.0.0
decodeBase64URL :: Monad m => Conduit ByteString m ByteString
-- | Apply base16-encoding to the stream.
--
-- Since 1.0.0
encodeBase16 :: Monad m => Conduit ByteString m ByteString
-- | Apply base16-decoding to the stream. Will stop decoding on the first
-- invalid chunk.
--
-- Since 1.0.0
decodeBase16 :: Monad m => Conduit ByteString m ByteString
-- | Apply a monadic transformation to all values in a stream.
--
-- If you do not need the transformed values, and instead just want the
-- monadic side-effects of running the action, see <a>mapM_</a>.
--
-- Since 1.0.0
mapM :: Monad m => (a -> m b) -> Conduit a m b
-- | Apply a monadic transformation to all elements in a chunked stream.
--
-- Since 1.0.0
mapME :: (Monad m, Traversable f) => (a -> m b) -> Conduit (f a) m (f b)
-- | Apply a monadic monomorphic transformation to all elements in a
-- chunked stream.
--
-- Unlike <tt>mapME</tt>, this will work on types like
-- <tt>ByteString</tt> and <tt>Text</tt> which are <tt>MonoFunctor</tt>
-- but not <tt>Functor</tt>.
--
-- Since 1.0.0
omapME :: (Monad m, MonoTraversable mono) => (Element mono -> m (Element mono)) -> Conduit mono m mono
-- | Apply the monadic function to each value in the stream, resulting in a
-- foldable value (e.g., a list). Then yield each of the individual
-- values in that foldable value separately.
--
-- Generalizes concatMapM, mapMaybeM, and mapFoldableM.
--
-- Since 1.0.0
concatMapM :: (Monad m, MonoFoldable mono) => (a -> m mono) -> Conduit a m (Element mono)
-- | Keep only values in the stream passing a given monadic predicate.
--
-- Since 1.0.0
filterM :: Monad m => (a -> m Bool) -> Conduit a m a
-- | Keep only elements in the chunked stream passing a given monadic
-- predicate.
--
-- Since 1.0.0
filterME :: (Monad m, IsSequence seq) => (Element seq -> m Bool) -> Conduit seq m seq
-- | Apply a monadic action on all values in a stream.
--
-- This <tt>Conduit</tt> can be used to perform a monadic side-effect for
-- every value, whilst passing the value through the <tt>Conduit</tt>
-- as-is.
--
-- <pre>
-- iterM f = mapM (\a -> f a >>= \() -> return a)
-- </pre>
--
-- Since 1.0.0
iterM :: Monad m => (a -> m ()) -> Conduit a m a
-- | Analog of <a>scanl</a> for lists, monadic.
--
-- Since 1.0.6
scanlM :: Monad m => (a -> b -> m a) -> a -> Conduit b m a
-- | <a>concatMapM</a> with an accumulator.
--
-- Since 1.0.0
concatMapAccumM :: Monad m => (a -> accum -> m (accum, [b])) -> accum -> Conduit a m b
-- | Encode a stream of text as UTF8.
--
-- Since 1.0.0
encodeUtf8 :: (Monad m, Utf8 text binary) => Conduit text m binary
-- | Decode a stream of binary data as UTF8.
--
-- Since 1.0.0
decodeUtf8 :: MonadThrow m => Conduit ByteString m Text
-- | Decode a stream of binary data as UTF8, replacing any invalid bytes
-- with the Unicode replacement character.
--
-- Since 1.0.0
decodeUtf8Lenient :: MonadThrow m => Conduit ByteString m Text
-- | Stream in the entirety of a single line.
--
-- Like <tt>takeExactly</tt>, this will consume the entirety of the line
-- regardless of the behavior of the inner Conduit.
--
-- Since 1.0.0
line :: (Monad m, IsSequence seq, Element seq ~ Char) => ConduitM seq o m r -> ConduitM seq o m r
-- | Same as <a>line</a>, but operates on ASCII/binary data.
--
-- Since 1.0.0
lineAscii :: (Monad m, IsSequence seq, Element seq ~ Word8) => ConduitM seq o m r -> ConduitM seq o m r
-- | Insert a newline character after each incoming chunk of data.
--
-- Since 1.0.0
unlines :: (Monad m, IsSequence seq, Element seq ~ Char) => Conduit seq m seq
-- | Same as <a>unlines</a>, but operates on ASCII/binary data.
--
-- Since 1.0.0
unlinesAscii :: (Monad m, IsSequence seq, Element seq ~ Word8) => Conduit seq m seq
-- | Convert a stream of arbitrarily-chunked textual data into a stream of
-- data where each chunk represents a single line. Note that, if you have
-- unknown<i>untrusted input, this function is </i>unsafe/, since it
-- would allow an attacker to form lines of massive length and exhaust
-- memory.
--
-- Since 1.0.0
linesUnbounded :: (Monad m, IsSequence seq, Element seq ~ Char) => Conduit seq m seq
-- | Same as <a>linesUnbounded</a>, but for ASCII/binary data.
--
-- Since 1.0.0
linesUnboundedAscii :: (Monad m, IsSequence seq, Element seq ~ Word8) => Conduit seq m seq
-- | Generally speaking, yielding values from inside a Conduit requires
-- some allocation for constructors. This can introduce an overhead,
-- similar to the overhead needed to represent a list of values instead
-- of a vector. This overhead is even more severe when talking about
-- unboxed values.
--
-- This combinator allows you to overcome this overhead, and efficiently
-- fill up vectors. It takes two parameters. The first is the size of
-- each mutable vector to be allocated. The second is a function. The
-- function takes an argument which will yield the next value into a
-- mutable vector.
--
-- Under the surface, this function uses a number of tricks to get high
-- performance. For more information on both usage and implementation,
-- please see:
-- <a>https://www.fpcomplete.com/user/snoyberg/library-documentation/vectorbuilder</a>
--
-- Since 1.0.0
vectorBuilder :: (PrimMonad base, MonadBase base m, Vector v e, MonadBase base n) => Int -> ((e -> n ()) -> Sink i m r) -> ConduitM i (v e) m r
-- | Your intended one-stop-shop for conduit functionality. This re-exports
-- functions from many commonly used modules. When there is a conflict
-- with standard functions, functions in this module are disambiguated by
-- adding a trailing C (or for chunked functions, replacing a trailing E
-- with CE). This means that the Conduit module can be imported
-- unqualified without causing naming conflicts.
--
-- For more information on the naming scheme and intended usages of the
-- combinators, please see the <a>Data.Conduit.Combinators</a>
-- documentation.
module Conduit
-- | Yield each of the values contained by the given <tt>MonoFoldable</tt>.
--
-- This will work on many data structures, including lists,
-- <tt>ByteString</tt>s, and <tt>Vector</tt>s.
--
-- Since 1.0.0
yieldMany :: (Monad m, MonoFoldable mono) => mono -> Producer m (Element mono)
-- | Generate a producer from a seed value.
--
-- Since 1.0.0
unfoldC :: Monad m => (b -> Maybe (a, b)) -> b -> Producer m a
-- | Enumerate from a value to a final value, inclusive, via <a>succ</a>.
--
-- This is generally more efficient than using <tt>Prelude</tt>'s
-- <tt>enumFromTo</tt> and combining with <tt>sourceList</tt> since this
-- avoids any intermediate data structures.
--
-- Since 1.0.0
enumFromToC :: (Monad m, Enum a, Eq a) => a -> a -> Producer m a
-- | Produces an infinite stream of repeated applications of f to x.
--
-- Since 1.0.0
iterateC :: Monad m => (a -> a) -> a -> Producer m a
-- | Produce an infinite stream consisting entirely of the given value.
--
-- Since 1.0.0
repeatC :: Monad m => a -> Producer m a
-- | Produce a finite stream consisting of n copies of the given value.
--
-- Since 1.0.0
replicateC :: Monad m => Int -> a -> Producer m a
-- | Generate a producer by yielding each of the strict chunks in a
-- <tt>LazySequence</tt>.
--
-- For more information, see <a>toChunks</a>.
--
-- Since 1.0.0
sourceLazy :: (Monad m, LazySequence lazy strict) => lazy -> Producer m strict
-- | Repeatedly run the given action and yield all values it produces.
--
-- Since 1.0.0
repeatMC :: Monad m => m a -> Producer m a
-- | Repeatedly run the given action and yield all values it produces,
-- until the provided predicate returns <tt>False</tt>.
--
-- Since 1.0.0
repeatWhileMC :: Monad m => m a -> (a -> Bool) -> Producer m a
-- | Perform the given action n times, yielding each result.
--
-- Since 1.0.0
replicateMC :: Monad m => Int -> m a -> Producer m a
sourceFile :: (MonadResource m, IOData a) => FilePath -> Producer m a
-- | Read all data from the given <tt>Handle</tt>.
--
-- Does not close the <tt>Handle</tt> at any point.
--
-- Since 1.0.0
sourceHandle :: (MonadIO m, IOData a) => Handle -> Producer m a
-- | Open a <tt>Handle</tt> using the given function and stream data from
-- it.
--
-- Automatically closes the file at completion.
--
-- Since 1.0.0
sourceIOHandle :: (MonadResource m, IOData a) => IO Handle -> Producer m a
-- | <tt>sourceHandle</tt> applied to <tt>stdin</tt>.
--
-- Since 1.0.0
stdinC :: (MonadIO m, IOData a) => Producer m a
-- | Create an infinite stream of random values, seeding from the system
-- random number.
--
-- Since 1.0.0
sourceRandom :: (Variate a, MonadIO m) => Producer m a
-- | Create a stream of random values of length n, seeding from the system
-- random number.
--
-- Since 1.0.0
sourceRandomN :: (Variate a, MonadIO m) => Int -> Producer m a
-- | Create an infinite stream of random values, using the given random
-- number generator.
--
-- Since 1.0.0
sourceRandomGen :: (Variate a, MonadBase base m, PrimMonad base) => Gen (PrimState base) -> Producer m a
-- | Create a stream of random values of length n, seeding from the system
-- random number.
--
-- Since 1.0.0
sourceRandomNGen :: (Variate a, MonadBase base m, PrimMonad base) => Gen (PrimState base) -> Int -> Producer m a
-- | Stream the contents of the given directory, without traversing deeply.
--
-- This function will return <i>all</i> of the contents of the directory,
-- whether they be files, directories, etc.
--
-- Note that the generated filepaths will be the complete path, not just
-- the filename. In other words, if you have a directory <tt>foo</tt>
-- containing files <tt>bar</tt> and <tt>baz</tt>, and you use
-- <tt>sourceDirectory</tt> on <tt>foo</tt>, the results will be
-- <tt>foo<i>bar@ and @foo</i>baz</tt>.
--
-- Since 1.0.0
sourceDirectory :: MonadResource m => FilePath -> Producer m FilePath
-- | Deeply stream the contents of the given directory.
--
-- This works the same as <tt>sourceDirectory</tt>, but will not return
-- directories at all. This function also takes an extra parameter to
-- indicate whether symlinks will be followed.
--
-- Since 1.0.0
sourceDirectoryDeep :: MonadResource m => Bool -> FilePath -> Producer m FilePath
-- | Ignore a certain number of values in the stream.
--
-- Since 1.0.0
dropC :: Monad m => Int -> Consumer a m ()
-- | Drop a certain number of elements from a chunked stream.
--
-- Since 1.0.0
dropCE :: (Monad m, IsSequence seq) => Index seq -> Consumer seq m ()
-- | Drop all values which match the given predicate.
--
-- Since 1.0.0
dropWhileC :: Monad m => (a -> Bool) -> Consumer a m ()
-- | Drop all elements in the chunked stream which match the given
-- predicate.
--
-- Since 1.0.0
dropWhileCE :: (Monad m, IsSequence seq) => (Element seq -> Bool) -> Consumer seq m ()
-- | Monoidally combine all values in the stream.
--
-- Since 1.0.0
foldC :: (Monad m, Monoid a) => Consumer a m a
-- | Monoidally combine all elements in the chunked stream.
--
-- Since 1.0.0
foldCE :: (Monad m, MonoFoldable mono, Monoid (Element mono)) => Consumer mono m (Element mono)
-- | A strict left fold.
--
-- Since 1.0.0
foldlC :: Monad m => (a -> b -> a) -> a -> Consumer b m a
-- | A strict left fold on a chunked stream.
--
-- Since 1.0.0
foldlCE :: (Monad m, MonoFoldable mono) => (a -> Element mono -> a) -> a -> Consumer mono m a
-- | Apply the provided mapping function and monoidal combine all values.
--
-- Since 1.0.0
foldMapC :: (Monad m, Monoid b) => (a -> b) -> Consumer a m b
-- | Apply the provided mapping function and monoidal combine all elements
-- of the chunked stream.
--
-- Since 1.0.0
foldMapCE :: (Monad m, MonoFoldable mono, Monoid w) => (Element mono -> w) -> Consumer mono m w
-- | Check that all values in the stream return True.
--
-- Subject to shortcut logic: at the first False, consumption of the
-- stream will stop.
--
-- Since 1.0.0
allC :: Monad m => (a -> Bool) -> Consumer a m Bool
-- | Check that all elements in the chunked stream return True.
--
-- Subject to shortcut logic: at the first False, consumption of the
-- stream will stop.
--
-- Since 1.0.0
allCE :: (Monad m, MonoFoldable mono) => (Element mono -> Bool) -> Consumer mono m Bool
-- | Check that at least one value in the stream returns True.
--
-- Subject to shortcut logic: at the first True, consumption of the
-- stream will stop.
--
-- Since 1.0.0
anyC :: Monad m => (a -> Bool) -> Consumer a m Bool
-- | Check that at least one element in the chunked stream returns True.
--
-- Subject to shortcut logic: at the first True, consumption of the
-- stream will stop.
--
-- Since 1.0.0
anyCE :: (Monad m, MonoFoldable mono) => (Element mono -> Bool) -> Consumer mono m Bool
-- | Are all values in the stream True?
--
-- Consumption stops once the first False is encountered.
--
-- Since 1.0.0
andC :: Monad m => Consumer Bool m Bool
-- | Are all elements in the chunked stream True?
--
-- Consumption stops once the first False is encountered.
--
-- Since 1.0.0
andCE :: (Monad m, MonoFoldable mono, Element mono ~ Bool) => Consumer mono m Bool
-- | Are any values in the stream True?
--
-- Consumption stops once the first True is encountered.
--
-- Since 1.0.0
orC :: Monad m => Consumer Bool m Bool
-- | Are any elements in the chunked stream True?
--
-- Consumption stops once the first True is encountered.
--
-- Since 1.0.0
orCE :: (Monad m, MonoFoldable mono, Element mono ~ Bool) => Consumer mono m Bool
-- | Are any values in the stream equal to the given value?
--
-- Stops consuming as soon as a match is found.
--
-- Since 1.0.0
elemC :: (Monad m, Eq a) => a -> Consumer a m Bool
-- | Are any elements in the chunked stream equal to the given element?
--
-- Stops consuming as soon as a match is found.
--
-- Since 1.0.0
elemCE :: (Monad m, EqSequence seq) => Element seq -> Consumer seq m Bool
-- | Are no values in the stream equal to the given value?
--
-- Stops consuming as soon as a match is found.
--
-- Since 1.0.0
notElemC :: (Monad m, Eq a) => a -> Consumer a m Bool
-- | Are no elements in the chunked stream equal to the given element?
--
-- Stops consuming as soon as a match is found.
--
-- Since 1.0.0
notElemCE :: (Monad m, EqSequence seq) => Element seq -> Consumer seq m Bool
-- | Consume all incoming strict chunks into a lazy sequence. Note that the
-- entirety of the sequence will be resident at memory.
--
-- This can be used to consume a stream of strict ByteStrings into a lazy
-- ByteString, for example.
--
-- Since 1.0.0
sinkLazy :: (Monad m, LazySequence lazy strict) => Consumer strict m lazy
-- | Consume all values from the stream and return as a list. Note that
-- this will pull all values into memory.
--
-- Since 1.0.0
sinkList :: Monad m => Consumer a m [a]
-- | Sink incoming values into a vector, growing the vector as necessary to
-- fit more elements.
--
-- Note that using this function is more memory efficient than
-- <tt>sinkList</tt> and then converting to a <tt>Vector</tt>, as it
-- avoids intermediate list constructors.
--
-- Since 1.0.0
sinkVector :: (MonadBase base m, Vector v a, PrimMonad base) => Consumer a m (v a)
-- | Sink incoming values into a vector, up until size <tt>maxSize</tt>.
-- Subsequent values will be left in the stream. If there are less than
-- <tt>maxSize</tt> values present, returns a <tt>Vector</tt> of smaller
-- size.
--
-- Note that using this function is more memory efficient than
-- <tt>sinkList</tt> and then converting to a <tt>Vector</tt>, as it
-- avoids intermediate list constructors.
--
-- Since 1.0.0
sinkVectorN :: (MonadBase base m, Vector v a, PrimMonad base) => Int -> Consumer a m (v a)
-- | Convert incoming values to a builder and fold together all builder
-- values.
--
-- Defined as: <tt>foldMap toBuilder</tt>.
--
-- Since 1.0.0
sinkBuilder :: (Monad m, Monoid builder, ToBuilder a builder) => Consumer a m builder
-- | Same as <tt>sinkBuilder</tt>, but afterwards convert the builder to
-- its lazy representation.
--
-- Alternatively, this could be considered an alternative to
-- <tt>sinkLazy</tt>, with the following differences:
--
-- <ul>
-- <li>This function will allow multiple input types, not just the strict
-- version of the lazy structure.</li>
-- <li>Some buffer copying may occur in this version.</li>
-- </ul>
--
-- Since 1.0.0
sinkLazyBuilder :: (Monad m, Monoid builder, ToBuilder a builder, Builder builder lazy) => Consumer a m lazy
-- | Consume and discard all remaining values in the stream.
--
-- Since 1.0.0
sinkNull :: Monad m => Consumer a m ()
-- | Same as <tt>await</tt>, but discards any leading <a>onull</a> values.
--
-- Since 1.0.0
awaitNonNull :: (Monad m, MonoFoldable a) => Consumer a m (Maybe (NonNull a))
-- | Get the next element in the chunked stream.
--
-- Since 1.0.0
headCE :: (Monad m, IsSequence seq) => Consumer seq m (Maybe (Element seq))
-- | View the next value in the stream without consuming it.
--
-- Since 1.0.0
peekC :: Monad m => Consumer a m (Maybe a)
-- | View the next element in the chunked stream without consuming it.
--
-- Since 1.0.0
peekCE :: (Monad m, MonoFoldable mono) => Consumer mono m (Maybe (Element mono))
-- | Retrieve the last value in the stream, if present.
--
-- Since 1.0.0
lastC :: Monad m => Consumer a m (Maybe a)
-- | Retrieve the last element in the chunked stream, if present.
--
-- Since 1.0.0
lastCE :: (Monad m, IsSequence seq) => Consumer seq m (Maybe (Element seq))
-- | Count how many values are in the stream.
--
-- Since 1.0.0
lengthC :: (Monad m, Num len) => Consumer a m len
-- | Count how many elements are in the chunked stream.
--
-- Since 1.0.0
lengthCE :: (Monad m, Num len, MonoFoldable mono) => Consumer mono m len
-- | Count how many values in the stream pass the given predicate.
--
-- Since 1.0.0
lengthIfC :: (Monad m, Num len) => (a -> Bool) -> Consumer a m len
-- | Count how many elements in the chunked stream pass the given
-- predicate.
--
-- Since 1.0.0
lengthIfCE :: (Monad m, Num len, MonoFoldable mono) => (Element mono -> Bool) -> Consumer mono m len
-- | Get the largest value in the stream, if present.
--
-- Since 1.0.0
maximumC :: (Monad m, Ord a) => Consumer a m (Maybe a)
-- | Get the largest element in the chunked stream, if present.
--
-- Since 1.0.0
maximumCE :: (Monad m, OrdSequence seq) => Consumer seq m (Maybe (Element seq))
-- | Get the smallest value in the stream, if present.
--
-- Since 1.0.0
minimumC :: (Monad m, Ord a) => Consumer a m (Maybe a)
-- | Get the smallest element in the chunked stream, if present.
--
-- Since 1.0.0
minimumCE :: (Monad m, OrdSequence seq) => Consumer seq m (Maybe (Element seq))
-- | True if there are no values in the stream.
--
-- This function does not modify the stream.
--
-- Since 1.0.0
nullC :: Monad m => Consumer a m Bool
-- | True if there are no elements in the chunked stream.
--
-- This function may remove empty leading chunks from the stream, but
-- otherwise will not modify it.
--
-- Since 1.0.0
nullCE :: (Monad m, MonoFoldable mono) => Consumer mono m Bool
-- | Get the sum of all values in the stream.
--
-- Since 1.0.0
sumC :: (Monad m, Num a) => Consumer a m a
-- | Get the sum of all elements in the chunked stream.
--
-- Since 1.0.0
sumCE :: (Monad m, MonoFoldable mono, Num (Element mono)) => Consumer mono m (Element mono)
-- | Get the product of all values in the stream.
--
-- Since 1.0.0
productC :: (Monad m, Num a) => Consumer a m a
-- | Get the product of all elements in the chunked stream.
--
-- Since 1.0.0
productCE :: (Monad m, MonoFoldable mono, Num (Element mono)) => Consumer mono m (Element mono)
-- | Find the first matching value.
--
-- Since 1.0.0
findC :: Monad m => (a -> Bool) -> Consumer a m (Maybe a)
-- | Apply the action to all values in the stream.
--
-- Since 1.0.0
mapM_C :: Monad m => (a -> m ()) -> Consumer a m ()
-- | Apply the action to all elements in the chunked stream.
--
-- Since 1.0.0
mapM_CE :: (Monad m, MonoFoldable mono) => (Element mono -> m ()) -> Consumer mono m ()
-- | A monadic strict left fold.
--
-- Since 1.0.0
foldMC :: Monad m => (a -> b -> m a) -> a -> Consumer b m a
-- | A monadic strict left fold on a chunked stream.
--
-- Since 1.0.0
foldMCE :: (Monad m, MonoFoldable mono) => (a -> Element mono -> m a) -> a -> Consumer mono m a
-- | Apply the provided monadic mapping function and monoidal combine all
-- values.
--
-- Since 1.0.0
foldMapMC :: (Monad m, Monoid w) => (a -> m w) -> Consumer a m w
-- | Apply the provided monadic mapping function and monoidal combine all
-- elements in the chunked stream.
--
-- Since 1.0.0
foldMapMCE :: (Monad m, MonoFoldable mono, Monoid w) => (Element mono -> m w) -> Consumer mono m w
sinkFile :: (MonadResource m, IOData a) => FilePath -> Consumer a m ()
-- | Write all data to the given <tt>Handle</tt>.
--
-- Does not close the <tt>Handle</tt> at any point.
--
-- Since 1.0.0
sinkHandle :: (MonadIO m, IOData a) => Handle -> Consumer a m ()
-- | Open a <tt>Handle</tt> using the given function and stream data to it.
--
-- Automatically closes the file at completion.
--
-- Since 1.0.0
sinkIOHandle :: (MonadResource m, IOData a) => IO Handle -> Consumer a m ()
-- | Print all incoming values to stdout.
--
-- Since 1.0.0
printC :: (Show a, MonadIO m) => Consumer a m ()
-- | <tt>sinkHandle</tt> applied to <tt>stdout</tt>.
--
-- Since 1.0.0
stdoutC :: (MonadIO m, IOData a) => Consumer a m ()
-- | <tt>sinkHandle</tt> applied to <tt>stderr</tt>.
--
-- Since 1.0.0
stderrC :: (MonadIO m, IOData a) => Consumer a m ()
-- | Apply a transformation to all values in a stream.
--
-- Since 1.0.0
mapC :: Monad m => (a -> b) -> Conduit a m b
-- | Apply a transformation to all elements in a chunked stream.
--
-- Since 1.0.0
mapCE :: (Monad m, Functor f) => (a -> b) -> Conduit (f a) m (f b)
-- | Apply a monomorphic transformation to all elements in a chunked
-- stream.
--
-- Unlike <tt>mapE</tt>, this will work on types like <tt>ByteString</tt>
-- and <tt>Text</tt> which are <tt>MonoFunctor</tt> but not
-- <tt>Functor</tt>.
--
-- Since 1.0.0
omapCE :: (Monad m, MonoFunctor mono) => (Element mono -> Element mono) -> Conduit mono m mono
-- | Apply the function to each value in the stream, resulting in a
-- foldable value (e.g., a list). Then yield each of the individual
-- values in that foldable value separately.
--
-- Generalizes concatMap, mapMaybe, and mapFoldable.
--
-- Since 1.0.0
concatMapC :: (Monad m, MonoFoldable mono) => (a -> mono) -> Conduit a m (Element mono)
-- | Apply the function to each element in the chunked stream, resulting in
-- a foldable value (e.g., a list). Then yield each of the individual
-- values in that foldable value separately.
--
-- Generalizes concatMap, mapMaybe, and mapFoldable.
--
-- Since 1.0.0
concatMapCE :: (Monad m, MonoFoldable mono, Monoid w) => (Element mono -> w) -> Conduit mono m w
-- | Stream up to n number of values downstream.
--
-- Note that, if downstream terminates early, not all values will be
-- consumed. If you want to force <i>exactly</i> the given number of
-- values to be consumed, see <tt>takeExactly</tt>.
--
-- Since 1.0.0
takeC :: Monad m => Int -> Conduit a m a
-- | Stream up to n number of elements downstream in a chunked stream.
--
-- Note that, if downstream terminates early, not all values will be
-- consumed. If you want to force <i>exactly</i> the given number of
-- values to be consumed, see <tt>takeExactlyE</tt>.
--
-- Since 1.0.0
takeCE :: (Monad m, IsSequence seq) => Index seq -> Conduit seq m seq
-- | Stream all values downstream that match the given predicate.
--
-- Same caveats regarding downstream termination apply as with
-- <tt>take</tt>.
--
-- Since 1.0.0
takeWhileC :: Monad m => (a -> Bool) -> Conduit a m a
-- | Stream all elements downstream that match the given predicate in a
-- chunked stream.
--
-- Same caveats regarding downstream termination apply as with
-- <tt>takeE</tt>.
--
-- Since 1.0.0
takeWhileCE :: (Monad m, IsSequence seq) => (Element seq -> Bool) -> Conduit seq m seq
-- | Consume precisely the given number of values and feed them downstream.
--
-- This function is in contrast to <tt>take</tt>, which will only consume
-- up to the given number of values, and will terminate early if
-- downstream terminates early. This function will discard any additional
-- values in the stream if they are unconsumed.
--
-- Note that this function takes a downstream <tt>ConduitM</tt> as a
-- parameter, as opposed to working with normal fusion. For more
-- information, see
-- <a>http://www.yesodweb.com/blog/2013/10/core-flaw-pipes-conduit</a>,
-- the section titled "pipes and conduit: isolate".
--
-- Since 1.0.0
takeExactlyC :: Monad m => Int -> ConduitM a b m r -> ConduitM a b m r
-- | Same as <tt>takeExactly</tt>, but for chunked streams.
--
-- Since 1.0.0
takeExactlyCE :: (Monad m, IsSequence a) => Index a -> ConduitM a b m r -> ConduitM a b m r
-- | Flatten out a stream by yielding the values contained in an incoming
-- <tt>MonoFoldable</tt> as individually yielded values.
--
-- Since 1.0.0
concatC :: (Monad m, MonoFoldable mono) => Conduit mono m (Element mono)
-- | Keep only values in the stream passing a given predicate.
--
-- Since 1.0.0
filterC :: Monad m => (a -> Bool) -> Conduit a m a
-- | Keep only elements in the chunked stream passing a given predicate.
--
-- Since 1.0.0
filterCE :: (IsSequence seq, Monad m) => (Element seq -> Bool) -> Conduit seq m seq
-- | Map values as long as the result is <tt>Just</tt>.
--
-- Since 1.0.0
mapWhileC :: Monad m => (a -> Maybe b) -> Conduit a m b
-- | Break up a stream of values into vectors of size n. The final vector
-- may be smaller than n if the total number of values is not a strict
-- multiple of n. No empty vectors will be yielded.
--
-- Since 1.0.0
conduitVector :: (MonadBase base m, Vector v a, PrimMonad base) => Int -> Conduit a m (v a)
-- | Analog of <a>scanl</a> for lists.
--
-- Since 1.0.6
scanlC :: Monad m => (a -> b -> a) -> a -> Conduit b m a
-- | <tt>concatMap</tt> with an accumulator.
--
-- Since 1.0.0
concatMapAccumC :: Monad m => (a -> accum -> (accum, [b])) -> accum -> Conduit a m b
-- | Insert the given value between each two values in the stream.
--
-- Since 1.0.0
intersperseC :: Monad m => a -> Conduit a m a
-- | Sliding window of values 1,2,3,4,5 with window size 2 gives
-- [1,2],[2,3],[3,4],[4,5]
--
-- Best used with structures that support O(1) snoc.
--
-- Since 1.0.0
slidingWindowC :: (Monad m, IsSequence seq, Element seq ~ a) => Int -> Conduit a m seq
-- | Apply base64-encoding to the stream.
--
-- Since 1.0.0
encodeBase64C :: Monad m => Conduit ByteString m ByteString
-- | Apply base64-decoding to the stream. Will stop decoding on the first
-- invalid chunk.
--
-- Since 1.0.0
decodeBase64C :: Monad m => Conduit ByteString m ByteString
-- | Apply URL-encoding to the stream.
--
-- Since 1.0.0
encodeBase64URLC :: Monad m => Conduit ByteString m ByteString
-- | Apply lenient base64URL-decoding to the stream. Will stop decoding on
-- the first invalid chunk.
--
-- Since 1.0.0
decodeBase64URLC :: Monad m => Conduit ByteString m ByteString
-- | Apply base16-encoding to the stream.
--
-- Since 1.0.0
encodeBase16C :: Monad m => Conduit ByteString m ByteString
-- | Apply base16-decoding to the stream. Will stop decoding on the first
-- invalid chunk.
--
-- Since 1.0.0
decodeBase16C :: Monad m => Conduit ByteString m ByteString
-- | Apply a monadic transformation to all values in a stream.
--
-- If you do not need the transformed values, and instead just want the
-- monadic side-effects of running the action, see <tt>mapM_</tt>.
--
-- Since 1.0.0
mapMC :: Monad m => (a -> m b) -> Conduit a m b
-- | Apply a monadic transformation to all elements in a chunked stream.
--
-- Since 1.0.0
mapMCE :: (Monad m, Traversable f) => (a -> m b) -> Conduit (f a) m (f b)
-- | Apply a monadic monomorphic transformation to all elements in a
-- chunked stream.
--
-- Unlike <tt>mapME</tt>, this will work on types like
-- <tt>ByteString</tt> and <tt>Text</tt> which are <tt>MonoFunctor</tt>
-- but not <tt>Functor</tt>.
--
-- Since 1.0.0
omapMCE :: (Monad m, MonoTraversable mono) => (Element mono -> m (Element mono)) -> Conduit mono m mono
-- | Apply the monadic function to each value in the stream, resulting in a
-- foldable value (e.g., a list). Then yield each of the individual
-- values in that foldable value separately.
--
-- Generalizes concatMapM, mapMaybeM, and mapFoldableM.
--
-- Since 1.0.0
concatMapMC :: (Monad m, MonoFoldable mono) => (a -> m mono) -> Conduit a m (Element mono)
-- | Keep only values in the stream passing a given monadic predicate.
--
-- Since 1.0.0
filterMC :: Monad m => (a -> m Bool) -> Conduit a m a
-- | Keep only elements in the chunked stream passing a given monadic
-- predicate.
--
-- Since 1.0.0
filterMCE :: (Monad m, IsSequence seq) => (Element seq -> m Bool) -> Conduit seq m seq
-- | Apply a monadic action on all values in a stream.
--
-- This <tt>Conduit</tt> can be used to perform a monadic side-effect for
-- every value, whilst passing the value through the <tt>Conduit</tt>
-- as-is.
--
-- <pre>
-- iterM f = mapM (\a -> f a >>= \() -> return a)
-- </pre>
--
-- Since 1.0.0
iterMC :: Monad m => (a -> m ()) -> Conduit a m a
-- | Analog of <a>scanl</a> for lists, monadic.
--
-- Since 1.0.6
scanlMC :: Monad m => (a -> b -> m a) -> a -> Conduit b m a
-- | <tt>concatMapM</tt> with an accumulator.
--
-- Since 1.0.0
concatMapAccumMC :: Monad m => (a -> accum -> m (accum, [b])) -> accum -> Conduit a m b
-- | Encode a stream of text as UTF8.
--
-- Since 1.0.0
encodeUtf8C :: (Monad m, Utf8 text binary) => Conduit text m binary
-- | Decode a stream of binary data as UTF8.
--
-- Since 1.0.0
decodeUtf8C :: MonadThrow m => Conduit ByteString m Text
-- | Decode a stream of binary data as UTF8, replacing any invalid bytes
-- with the Unicode replacement character.
--
-- Since 1.0.0
decodeUtf8LenientC :: MonadThrow m => Conduit ByteString m Text
-- | Stream in the entirety of a single line.
--
-- Like <tt>takeExactly</tt>, this will consume the entirety of the line
-- regardless of the behavior of the inner Conduit.
--
-- Since 1.0.0
lineC :: (Monad m, IsSequence seq, Element seq ~ Char) => ConduitM seq o m r -> ConduitM seq o m r
-- | Same as <tt>line</tt>, but operates on ASCII/binary data.
--
-- Since 1.0.0
lineAsciiC :: (Monad m, IsSequence seq, Element seq ~ Word8) => ConduitM seq o m r -> ConduitM seq o m r
-- | Insert a newline character after each incoming chunk of data.
--
-- Since 1.0.0
unlinesC :: (Monad m, IsSequence seq, Element seq ~ Char) => Conduit seq m seq
-- | Same as <tt>unlines</tt>, but operates on ASCII/binary data.
--
-- Since 1.0.0
unlinesAsciiC :: (Monad m, IsSequence seq, Element seq ~ Word8) => Conduit seq m seq
-- | Convert a stream of arbitrarily-chunked textual data into a stream of
-- data where each chunk represents a single line. Note that, if you have
-- unknown<i>untrusted input, this function is </i>unsafe/, since it
-- would allow an attacker to form lines of massive length and exhaust
-- memory.
--
-- Since 1.0.0
linesUnboundedC :: (Monad m, IsSequence seq, Element seq ~ Char) => Conduit seq m seq
-- | Same as <tt>linesUnbounded</tt>, but for ASCII/binary data.
--
-- Since 1.0.0
linesUnboundedAsciiC :: (Monad m, IsSequence seq, Element seq ~ Word8) => Conduit seq m seq
-- | Generally speaking, yielding values from inside a Conduit requires
-- some allocation for constructors. This can introduce an overhead,
-- similar to the overhead needed to represent a list of values instead
-- of a vector. This overhead is even more severe when talking about
-- unboxed values.
--
-- This combinator allows you to overcome this overhead, and efficiently
-- fill up vectors. It takes two parameters. The first is the size of
-- each mutable vector to be allocated. The second is a function. The
-- function takes an argument which will yield the next value into a
-- mutable vector.
--
-- Under the surface, this function uses a number of tricks to get high
-- performance. For more information on both usage and implementation,
-- please see:
-- <a>https://www.fpcomplete.com/user/snoyberg/library-documentation/vectorbuilder</a>
--
-- Since 1.0.0
vectorBuilderC :: (PrimMonad base, MonadBase base m, Vector v e, MonadBase base n) => Int -> ((e -> n ()) -> Sink i m r) -> ConduitM i (v e) m r
-- | Monads in which <a>IO</a> computations may be embedded. Any monad
-- built by applying a sequence of monad transformers to the <a>IO</a>
-- monad will be an instance of this class.
--
-- Instances should satisfy the following laws, which state that
-- <a>liftIO</a> is a transformer of monads:
--
-- <ul>
-- <li><pre><a>liftIO</a> . <a>return</a> = <a>return</a></pre></li>
-- <li><pre><a>liftIO</a> (m >>= f) = <a>liftIO</a> m >>=
-- (<a>liftIO</a> . f)</pre></li>
-- </ul>
class Monad m => MonadIO (m :: * -> *)
liftIO :: MonadIO m => IO a -> m a
-- | The class of monad transformers. Instances should satisfy the
-- following laws, which state that <a>lift</a> is a transformer of
-- monads:
--
-- <ul>
-- <li><pre><a>lift</a> . <a>return</a> = <a>return</a></pre></li>
-- <li><pre><a>lift</a> (m >>= f) = <a>lift</a> m >>=
-- (<a>lift</a> . f)</pre></li>
-- </ul>
class MonadTrans (t :: (* -> *) -> * -> *)
lift :: (MonadTrans t, Monad m) => m a -> t m a
class (Applicative b, Applicative m, Monad b, Monad m) => MonadBase (b :: * -> *) (m :: * -> *) | m -> b
liftBase :: MonadBase b m => b α -> m α
class Monad m => MonadThrow (m :: * -> *)
throwM :: (MonadThrow m, Exception e) => e -> m a
class MonadBase b m => MonadBaseControl (b :: * -> *) (m :: * -> *) | m -> b
-- | A <tt>Monad</tt> which allows for safe resource allocation. In theory,
-- any monad transformer stack included a <tt>ResourceT</tt> can be an
-- instance of <tt>MonadResource</tt>.
--
-- Note: <tt>runResourceT</tt> has a requirement for a
-- <tt>MonadBaseControl IO m</tt> monad, which allows control operations
-- to be lifted. A <tt>MonadResource</tt> does not have this requirement.
-- This means that transformers such as <tt>ContT</tt> can be an instance
-- of <tt>MonadResource</tt>. However, the <tt>ContT</tt> wrapper will
-- need to be unwrapped before calling <tt>runResourceT</tt>.
--
-- Since 0.3.0
class (MonadThrow m, MonadIO m, Applicative m, MonadBase IO m) => MonadResource (m :: * -> *)
-- | The Resource transformer. This transformer keeps track of all
-- registered actions, and calls them upon exit (via
-- <tt>runResourceT</tt>). Actions may be registered via
-- <tt>register</tt>, or resources may be allocated atomically via
-- <tt>allocate</tt>. <tt>allocate</tt> corresponds closely to
-- <tt>bracket</tt>.
--
-- Releasing may be performed before exit via the <tt>release</tt>
-- function. This is a highly recommended optimization, as it will ensure
-- that scarce resources are freed early. Note that calling
-- <tt>release</tt> will deregister the action, so that a release action
-- will only ever be called once.
--
-- Since 0.3.0
data ResourceT (m :: * -> *) a :: (* -> *) -> * -> *
-- | Unwrap a <a>ResourceT</a> transformer, and call all registered release
-- actions.
--
-- Note that there is some reference counting involved due to
-- <a>resourceForkIO</a>. If multiple threads are sharing the same
-- collection of resources, only the last call to <tt>runResourceT</tt>
-- will deallocate the resources.
--
-- Since 0.3.0
runResourceT :: MonadBaseControl IO m => ResourceT m a -> m a
withAcquire :: MonadBaseControl IO m => Acquire a -> (a -> m b) -> m b
-- | Identity functor and monad.
newtype Identity a :: * -> *
Identity :: a -> Identity a
runIdentity :: Identity a -> a
|