/usr/share/doc/libghc-cabal-doc/html/Cabal.txt is in libghc-cabal-doc 1.24.1.0-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 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 | -- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A framework for packaging Haskell software
--
-- The Haskell Common Architecture for Building Applications and
-- Libraries: a framework defining a common interface for authors to more
-- easily build their Haskell applications in a portable way.
--
-- The Haskell Cabal is part of a larger infrastructure for distributing,
-- organizing, and cataloging Haskell libraries and tools.
@package Cabal
@version 1.24.1.0
module Distribution.Compat.Binary
decodeOrFailIO :: Binary a => ByteString -> IO (Either String a)
-- | This module defines the detailed test suite interface which makes it
-- possible to expose individual tests to Cabal or other test agents.
module Distribution.TestSuite
data TestInstance
TestInstance :: IO Progress -> String -> [String] -> [OptionDescr] -> (String -> String -> Either String TestInstance) -> TestInstance
-- | Perform the test.
[run] :: TestInstance -> IO Progress
-- | A name for the test, unique within a test suite.
[name] :: TestInstance -> String
-- | Users can select groups of tests by their tags.
[tags] :: TestInstance -> [String]
-- | Descriptions of the options recognized by this test.
[options] :: TestInstance -> [OptionDescr]
-- | Try to set the named option to the given value. Returns an error
-- message if the option is not supported or the value could not be
-- correctly parsed; otherwise, a <a>TestInstance</a> with the option set
-- to the given value is returned.
[setOption] :: TestInstance -> String -> String -> Either String TestInstance
data OptionDescr
OptionDescr :: String -> String -> OptionType -> Maybe String -> OptionDescr
[optionName] :: OptionDescr -> String
-- | A human-readable description of the option to guide the user setting
-- it.
[optionDescription] :: OptionDescr -> String
[optionType] :: OptionDescr -> OptionType
[optionDefault] :: OptionDescr -> Maybe String
data OptionType
OptionFile :: Bool -> Bool -> [String] -> OptionType
[optionFileMustExist] :: OptionType -> Bool
[optionFileIsDir] :: OptionType -> Bool
[optionFileExtensions] :: OptionType -> [String]
OptionString :: Bool -> OptionType
[optionStringMultiline] :: OptionType -> Bool
OptionNumber :: Bool -> (Maybe String, Maybe String) -> OptionType
[optionNumberIsInt] :: OptionType -> Bool
[optionNumberBounds] :: OptionType -> (Maybe String, Maybe String)
OptionBool :: OptionType
OptionEnum :: [String] -> OptionType
OptionSet :: [String] -> OptionType
OptionRngSeed :: OptionType
data Test
Test :: TestInstance -> Test
Group :: String -> Bool -> [Test] -> Test
[groupName] :: Test -> String
-- | If true, then children of this group may be run in parallel. Note that
-- this setting is not inherited by children. In particular, consider a
-- group F with "concurrently = False" that has some children, including
-- a group T with "concurrently = True". The children of group T may be
-- run concurrently with each other, as long as none are run at the same
-- time as any of the direct children of group F.
[concurrently] :: Test -> Bool
[groupTests] :: Test -> [Test]
ExtraOptions :: [OptionDescr] -> Test -> Test
type Options = [(String, String)]
data Progress
Finished :: Result -> Progress
Progress :: String -> (IO Progress) -> Progress
data Result
Pass :: Result
Fail :: String -> Result
Error :: String -> Result
-- | Create a named group of tests, which are assumed to be safe to run in
-- parallel.
testGroup :: String -> [Test] -> Test
instance GHC.Show.Show Distribution.TestSuite.Result
instance GHC.Read.Read Distribution.TestSuite.Result
instance GHC.Classes.Eq Distribution.TestSuite.Result
instance GHC.Show.Show Distribution.TestSuite.OptionDescr
instance GHC.Read.Read Distribution.TestSuite.OptionDescr
instance GHC.Classes.Eq Distribution.TestSuite.OptionDescr
instance GHC.Show.Show Distribution.TestSuite.OptionType
instance GHC.Read.Read Distribution.TestSuite.OptionType
instance GHC.Classes.Eq Distribution.TestSuite.OptionType
-- | Internal utilities used by Distribution.Simple.Program.*.
module Distribution.Simple.Program.Internal
-- | Extract the version number from the output of 'strip --version'.
--
-- Invoking "strip --version" gives very inconsistent results. We ignore
-- everything in parentheses (see #2497), look for the first word that
-- starts with a number, and try parsing out the first two components of
-- it. Non-GNU <tt>strip</tt> doesn't appear to have a version flag.
stripExtractVersion :: String -> String
-- | Remove the "literal" markups from a Haskell source file, including
-- "<tt>></tt>", "<tt>\begin{code}</tt>", "<tt>\end{code}</tt>", and
-- "<tt>#</tt>"
module Distribution.Simple.PreProcess.Unlit
-- | <a>unlit</a> takes a filename (for error reports), and transforms the
-- given string, to eliminate the literate comments from the program
-- text.
unlit :: FilePath -> String -> Either String String
-- | No unliteration.
plain :: String -> String -> String
-- | Common utils used by modules under Distribution.PackageDescription.*.
module Distribution.PackageDescription.Utils
cabalBug :: String -> a
userBug :: String -> a
-- | Compatibility layer for <a>Data.Semigroup</a>
module Distribution.Compat.Semigroup
-- | The class of semigroups (types with an associative binary operation).
class Semigroup a
-- | An associative operation.
--
-- <pre>
-- (a <a><></a> b) <a><></a> c = a <a><></a> (b <a><></a> c)
-- </pre>
--
-- If <tt>a</tt> is also a <a>Monoid</a> we further require
--
-- <pre>
-- (<a><></a>) = <a>mappend</a>
-- </pre>
(<>) :: a -> a -> a
-- | The class of monoids (types with an associative binary operation that
-- has an identity). Instances should satisfy the following laws:
--
-- <ul>
-- <li><pre>mappend mempty x = x</pre></li>
-- <li><pre>mappend x mempty = x</pre></li>
-- <li><pre>mappend x (mappend y z) = mappend (mappend x y) z</pre></li>
-- <li><pre>mconcat = <a>foldr</a> mappend mempty</pre></li>
-- </ul>
--
-- The method names refer to the monoid of lists under concatenation, but
-- there are many other instances.
--
-- Some types can be viewed as a monoid in more than one way, e.g. both
-- addition and multiplication on numbers. In such cases we often define
-- <tt>newtype</tt>s and make those instances of <a>Monoid</a>, e.g.
-- <tt>Sum</tt> and <tt>Product</tt>.
class Monoid a
-- | Identity of <a>mappend</a>
mempty :: a
-- | An associative operation
mappend :: a -> a -> a
-- | Fold a list using the monoid. For most types, the default definition
-- for <a>mconcat</a> will be used, but the function is included in the
-- class definition so that an optimized version can be provided for
-- specific types.
mconcat :: [a] -> a
-- | Boolean monoid under conjunction (<a>&&</a>).
newtype All :: *
All :: Bool -> All
[getAll] :: All -> Bool
-- | Boolean monoid under disjunction (<a>||</a>).
newtype Any :: *
Any :: Bool -> Any
[getAny] :: Any -> Bool
-- | Cabal's own <a>Last</a> copy to avoid requiring an orphan
-- <a>Binary</a> instance.
--
-- Once the oldest <tt>binary</tt> version we support provides a
-- <a>Binary</a> instance for <a>Last</a> we can remove this one here.
--
-- NB: <a>Last</a> is defined differently and not a <a>Monoid</a>
newtype Last' a
Last' :: Maybe a -> Last' a
[getLast'] :: Last' a -> Maybe a
-- | Generically generate a <a>Semigroup</a> (<a><></a>) operation
-- for any type implementing <a>Generic</a>. This operation will append
-- two values by point-wise appending their component fields. It is only
-- defined for product types.
--
-- <pre>
-- <a>gmappend</a> a (<a>gmappend</a> b c) = <a>gmappend</a> (<a>gmappend</a> a b) c
-- </pre>
gmappend :: (Generic a, GSemigroup (Rep a)) => a -> a -> a
-- | Generically generate a <a>Monoid</a> <a>mempty</a> for any
-- product-like type implementing <a>Generic</a>.
--
-- It is only defined for product types.
--
-- <pre>
-- <a>gmappend</a> <a>gmempty</a> a = a = <a>gmappend</a> a <a>gmempty</a>
-- </pre>
gmempty :: (Generic a, GMonoid (Rep a)) => a
instance GHC.Generics.Generic (Distribution.Compat.Semigroup.Last' a)
instance GHC.Base.Applicative Distribution.Compat.Semigroup.Last'
instance GHC.Base.Functor Distribution.Compat.Semigroup.Last'
instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Distribution.Compat.Semigroup.Last' a)
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Compat.Semigroup.Last' a)
instance GHC.Read.Read a => GHC.Read.Read (Distribution.Compat.Semigroup.Last' a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Distribution.Compat.Semigroup.Last' a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Distribution.Compat.Semigroup.Last' a)
instance Data.Semigroup.Semigroup (Distribution.Compat.Semigroup.Last' a)
instance GHC.Base.Monoid (Distribution.Compat.Semigroup.Last' a)
instance Data.Semigroup.Semigroup a => Distribution.Compat.Semigroup.GSemigroup (GHC.Generics.K1 i a)
instance Distribution.Compat.Semigroup.GSemigroup f => Distribution.Compat.Semigroup.GSemigroup (GHC.Generics.M1 i c f)
instance (Distribution.Compat.Semigroup.GSemigroup f, Distribution.Compat.Semigroup.GSemigroup g) => Distribution.Compat.Semigroup.GSemigroup (f GHC.Generics.:*: g)
instance (Data.Semigroup.Semigroup a, GHC.Base.Monoid a) => Distribution.Compat.Semigroup.GMonoid (GHC.Generics.K1 i a)
instance Distribution.Compat.Semigroup.GMonoid f => Distribution.Compat.Semigroup.GMonoid (GHC.Generics.M1 i c f)
instance (Distribution.Compat.Semigroup.GMonoid f, Distribution.Compat.Semigroup.GMonoid g) => Distribution.Compat.Semigroup.GMonoid (f GHC.Generics.:*: g)
-- | This simple package provides types and functions for interacting with
-- C compilers. Currently it's just a type enumerating extant C-like
-- languages, which we call dialects.
module Distribution.Simple.CCompiler
-- | Represents a dialect of C. The Monoid instance expresses backward
-- compatibility, in the sense that 'mappend a b' is the least inclusive
-- dialect which both <tt>a</tt> and <tt>b</tt> can be correctly
-- interpreted as.
data CDialect
C :: CDialect
ObjectiveC :: CDialect
CPlusPlus :: CDialect
ObjectiveCPlusPlus :: CDialect
-- | A list of all file extensions which are recognized as possibly
-- containing some dialect of C code. Note that this list is only for
-- source files, not for header files.
cSourceExtensions :: [String]
-- | Takes a dialect of C and whether code is intended to be passed through
-- the preprocessor, and returns a filename extension for containing that
-- code.
cDialectFilenameExtension :: CDialect -> Bool -> String
-- | Infers from a filename's extension the dialect of C which it contains,
-- and whether it is intended to be passed through the preprocessor.
filenameCDialect :: String -> Maybe (CDialect, Bool)
instance GHC.Show.Show Distribution.Simple.CCompiler.CDialect
instance GHC.Classes.Eq Distribution.Simple.CCompiler.CDialect
instance GHC.Base.Monoid Distribution.Simple.CCompiler.CDialect
instance Data.Semigroup.Semigroup Distribution.Simple.CCompiler.CDialect
-- | This is a library of parser combinators, originally written by Koen
-- Claessen. It parses all alternatives in parallel, so it never keeps
-- hold of the beginning of the input string, a common source of space
-- leaks with other parsers. The '(+++)' choice combinator is genuinely
-- commutative; it makes no difference which branch is "shorter".
--
-- See also Koen's paper <i>Parallel Parsing Processes</i>
-- (<a>http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.19.9217</a>).
--
-- This version of ReadP has been locally hacked to make it H98, by
-- Martin Sjögren <a>mailto:msjogren@gmail.com</a>
--
-- The unit tests have been moved to UnitTest.Distribution.Compat.ReadP,
-- by Mark Lentczner <a>mailto:mark@glyphic.com</a>
module Distribution.Compat.ReadP
type ReadP r a = Parser r Char a
-- | Consumes and returns the next character. Fails if there is no input
-- left.
get :: ReadP r Char
-- | Look-ahead: returns the part of the input that is left, without
-- consuming it.
look :: ReadP r String
-- | Symmetric choice.
(+++) :: ReadP r a -> ReadP r a -> ReadP r a
infixr 5 +++
-- | Local, exclusive, left-biased choice: If left parser locally produces
-- any result at all, then right parser is not used.
(<++) :: ReadP a a -> ReadP r a -> ReadP r a
infixr 5 <++
-- | Transforms a parser into one that does the same, but in addition
-- returns the exact characters read. IMPORTANT NOTE: <a>gather</a> gives
-- a runtime error if its first argument is built using any occurrences
-- of readS_to_P.
gather :: ReadP (String -> P Char r) a -> ReadP r (String, a)
-- | Always fails.
pfail :: ReadP r a
-- | Consumes and returns the next character, if it satisfies the specified
-- predicate.
satisfy :: (Char -> Bool) -> ReadP r Char
-- | Parses and returns the specified character.
char :: Char -> ReadP r Char
-- | Parses and returns the specified string.
string :: String -> ReadP r String
-- | Parses the first zero or more characters satisfying the predicate.
munch :: (Char -> Bool) -> ReadP r String
-- | Parses the first one or more characters satisfying the predicate.
munch1 :: (Char -> Bool) -> ReadP r String
-- | Skips all whitespace.
skipSpaces :: ReadP r ()
-- | Combines all parsers in the specified list.
choice :: [ReadP r a] -> ReadP r a
-- | <tt> count n p </tt> parses <tt>n</tt> occurrences of <tt>p</tt> in
-- sequence. A list of results is returned.
count :: Int -> ReadP r a -> ReadP r [a]
-- | <tt> between open close p </tt> parses <tt>open</tt>, followed by
-- <tt>p</tt> and finally <tt>close</tt>. Only the value of <tt>p</tt> is
-- returned.
between :: ReadP r open -> ReadP r close -> ReadP r a -> ReadP r a
-- | <tt>option x p</tt> will either parse <tt>p</tt> or return <tt>x</tt>
-- without consuming any input.
option :: a -> ReadP r a -> ReadP r a
-- | <tt>optional p</tt> optionally parses <tt>p</tt> and always returns
-- <tt>()</tt>.
optional :: ReadP r a -> ReadP r ()
-- | Parses zero or more occurrences of the given parser.
many :: ReadP r a -> ReadP r [a]
-- | Parses one or more occurrences of the given parser.
many1 :: ReadP r a -> ReadP r [a]
-- | Like <a>many</a>, but discards the result.
skipMany :: ReadP r a -> ReadP r ()
-- | Like <a>many1</a>, but discards the result.
skipMany1 :: ReadP r a -> ReadP r ()
-- | <tt>sepBy p sep</tt> parses zero or more occurrences of <tt>p</tt>,
-- separated by <tt>sep</tt>. Returns a list of values returned by
-- <tt>p</tt>.
sepBy :: ReadP r a -> ReadP r sep -> ReadP r [a]
-- | <tt>sepBy1 p sep</tt> parses one or more occurrences of <tt>p</tt>,
-- separated by <tt>sep</tt>. Returns a list of values returned by
-- <tt>p</tt>.
sepBy1 :: ReadP r a -> ReadP r sep -> ReadP r [a]
-- | <tt>endBy p sep</tt> parses zero or more occurrences of <tt>p</tt>,
-- separated and ended by <tt>sep</tt>.
endBy :: ReadP r a -> ReadP r sep -> ReadP r [a]
-- | <tt>endBy p sep</tt> parses one or more occurrences of <tt>p</tt>,
-- separated and ended by <tt>sep</tt>.
endBy1 :: ReadP r a -> ReadP r sep -> ReadP r [a]
-- | <tt>chainr p op x</tt> parses zero or more occurrences of <tt>p</tt>,
-- separated by <tt>op</tt>. Returns a value produced by a <i>right</i>
-- associative application of all functions returned by <tt>op</tt>. If
-- there are no occurrences of <tt>p</tt>, <tt>x</tt> is returned.
chainr :: ReadP r a -> ReadP r (a -> a -> a) -> a -> ReadP r a
-- | <tt>chainl p op x</tt> parses zero or more occurrences of <tt>p</tt>,
-- separated by <tt>op</tt>. Returns a value produced by a <i>left</i>
-- associative application of all functions returned by <tt>op</tt>. If
-- there are no occurrences of <tt>p</tt>, <tt>x</tt> is returned.
chainl :: ReadP r a -> ReadP r (a -> a -> a) -> a -> ReadP r a
-- | Like <a>chainl</a>, but parses one or more occurrences of <tt>p</tt>.
chainl1 :: ReadP r a -> ReadP r (a -> a -> a) -> ReadP r a
-- | Like <a>chainr</a>, but parses one or more occurrences of <tt>p</tt>.
chainr1 :: ReadP r a -> ReadP r (a -> a -> a) -> ReadP r a
-- | <tt>manyTill p end</tt> parses zero or more occurrences of <tt>p</tt>,
-- until <tt>end</tt> succeeds. Returns a list of values returned by
-- <tt>p</tt>.
manyTill :: ReadP r a -> ReadP [a] end -> ReadP r [a]
-- | A parser for a type <tt>a</tt>, represented as a function that takes a
-- <a>String</a> and returns a list of possible parses as
-- <tt>(a,<a>String</a>)</tt> pairs.
--
-- Note that this kind of backtracking parser is very inefficient;
-- reading a large structure may be quite slow (cf <a>ReadP</a>).
type ReadS a = String -> [(a, String)]
-- | Converts a parser into a Haskell ReadS-style function. This is the
-- main way in which you can "run" a <a>ReadP</a> parser: the expanded
-- type is <tt> readP_to_S :: ReadP a -> String -> [(a,String)]
-- </tt>
readP_to_S :: ReadP a a -> ReadS a
-- | Converts a Haskell ReadS-style function into a parser. Warning: This
-- introduces local backtracking in the resulting parser, and therefore a
-- possible inefficiency.
readS_to_P :: ReadS a -> ReadP r a
instance GHC.Base.Functor (Distribution.Compat.ReadP.P s)
instance GHC.Base.Applicative (Distribution.Compat.ReadP.P s)
instance GHC.Base.Monad (Distribution.Compat.ReadP.P s)
instance Control.Monad.Fail.MonadFail (Distribution.Compat.ReadP.P s)
instance GHC.Base.Alternative (Distribution.Compat.ReadP.P s)
instance GHC.Base.MonadPlus (Distribution.Compat.ReadP.P s)
instance GHC.Base.Functor (Distribution.Compat.ReadP.Parser r s)
instance GHC.Base.Applicative (Distribution.Compat.ReadP.Parser r s)
instance GHC.Base.Monad (Distribution.Compat.ReadP.Parser r s)
instance Control.Monad.Fail.MonadFail (Distribution.Compat.ReadP.Parser r s)
-- | Simple parsing with failure
module Distribution.ReadE
-- | Parser with simple error reporting
newtype ReadE a
ReadE :: (String -> Either ErrorMsg a) -> ReadE a
[runReadE] :: ReadE a -> String -> Either ErrorMsg a
succeedReadE :: (String -> a) -> ReadE a
failReadE :: ErrorMsg -> ReadE a
parseReadE :: ReadE a -> ReadP r a
readEOrFail :: ReadE a -> String -> a
readP_to_E :: (String -> ErrorMsg) -> ReadP a a -> ReadE a
instance GHC.Base.Functor Distribution.ReadE.ReadE
-- | A simple <a>Verbosity</a> type with associated utilities. There are 4
-- standard verbosity levels from <a>silent</a>, <a>normal</a>,
-- <a>verbose</a> up to <a>deafening</a>. This is used for deciding what
-- logging messages to print.
module Distribution.Verbosity
data Verbosity
silent :: Verbosity
normal :: Verbosity
verbose :: Verbosity
deafening :: Verbosity
moreVerbose :: Verbosity -> Verbosity
lessVerbose :: Verbosity -> Verbosity
intToVerbosity :: Int -> Maybe Verbosity
flagToVerbosity :: ReadE Verbosity
showForCabal :: Verbosity -> String
showForGHC :: Verbosity -> String
instance GHC.Enum.Bounded Distribution.Verbosity.Verbosity
instance GHC.Enum.Enum Distribution.Verbosity.Verbosity
instance GHC.Classes.Ord Distribution.Verbosity.Verbosity
instance GHC.Classes.Eq Distribution.Verbosity.Verbosity
instance GHC.Read.Read Distribution.Verbosity.Verbosity
instance GHC.Show.Show Distribution.Verbosity.Verbosity
instance GHC.Generics.Generic Distribution.Verbosity.Verbosity
instance Data.Binary.Class.Binary Distribution.Verbosity.Verbosity
-- | This defines a <a>Text</a> class which is a bit like the <a>Read</a>
-- and <a>Show</a> classes. The difference is that is uses a modern
-- pretty printer and parser system and the format is not expected to be
-- Haskell concrete syntax but rather the external human readable
-- representation used by Cabal.
module Distribution.Text
class Text a
disp :: Text a => a -> Doc
parse :: Text a => ReadP r a
-- | The default rendering style used in Cabal for console output.
defaultStyle :: Style
display :: Text a => a -> String
simpleParse :: Text a => String -> Maybe a
instance Distribution.Text.Text GHC.Types.Bool
instance Distribution.Text.Text GHC.Types.Int
instance Distribution.Text.Text Data.Version.Version
-- | Data type for Haskell module names.
module Distribution.ModuleName
-- | A valid Haskell module name.
data ModuleName
-- | Construct a <a>ModuleName</a> from a valid module name <a>String</a>.
--
-- This is just a convenience function intended for valid module strings.
-- It is an error if it is used with a string that is not a valid module
-- name. If you are parsing user input then use <a>simpleParse</a>
-- instead.
fromString :: String -> ModuleName
-- | The individual components of a hierarchical module name. For example
--
-- <pre>
-- components (fromString "A.B.C") = ["A", "B", "C"]
-- </pre>
components :: ModuleName -> [String]
-- | Convert a module name to a file path, but without any file extension.
-- For example:
--
-- <pre>
-- toFilePath (fromString "A.B.C") = "A/B/C"
-- </pre>
toFilePath :: ModuleName -> FilePath
-- | The module name <tt>Main</tt>.
main :: ModuleName
-- | <i>Deprecated: use ModuleName.fromString instead</i>
simple :: String -> ModuleName
instance Data.Data.Data Distribution.ModuleName.ModuleName
instance GHC.Show.Show Distribution.ModuleName.ModuleName
instance GHC.Read.Read Distribution.ModuleName.ModuleName
instance GHC.Classes.Ord Distribution.ModuleName.ModuleName
instance GHC.Generics.Generic Distribution.ModuleName.ModuleName
instance GHC.Classes.Eq Distribution.ModuleName.ModuleName
instance Data.Binary.Class.Binary Distribution.ModuleName.ModuleName
instance Distribution.Text.Text Distribution.ModuleName.ModuleName
-- | Cabal often needs to do slightly different things on specific
-- platforms. You probably know about the <a>os</a> however using that is
-- very inconvenient because it is a string and different Haskell
-- implementations do not agree on using the same strings for the same
-- platforms! (In particular see the controversy over "windows" vs
-- "mingw32"). So to make it more consistent and easy to use we have an
-- <a>OS</a> enumeration.
module Distribution.System
data OS
Linux :: OS
Windows :: OS
OSX :: OS
FreeBSD :: OS
OpenBSD :: OS
NetBSD :: OS
DragonFly :: OS
Solaris :: OS
AIX :: OS
HPUX :: OS
IRIX :: OS
HaLVM :: OS
Hurd :: OS
IOS :: OS
Android :: OS
Ghcjs :: OS
OtherOS :: String -> OS
buildOS :: OS
data Arch
I386 :: Arch
X86_64 :: Arch
PPC :: Arch
PPC64 :: Arch
Sparc :: Arch
Arm :: Arch
Mips :: Arch
SH :: Arch
IA64 :: Arch
S390 :: Arch
Alpha :: Arch
Hppa :: Arch
Rs6000 :: Arch
M68k :: Arch
Vax :: Arch
JavaScript :: Arch
OtherArch :: String -> Arch
buildArch :: Arch
data Platform
Platform :: Arch -> OS -> Platform
-- | The platform Cabal was compiled on. In most cases,
-- <tt>LocalBuildInfo.hostPlatform</tt> should be used instead (the
-- platform we're targeting).
buildPlatform :: Platform
platformFromTriple :: String -> Maybe Platform
knownOSs :: [OS]
knownArches :: [Arch]
instance Data.Data.Data Distribution.System.Platform
instance GHC.Read.Read Distribution.System.Platform
instance GHC.Show.Show Distribution.System.Platform
instance GHC.Classes.Ord Distribution.System.Platform
instance GHC.Generics.Generic Distribution.System.Platform
instance GHC.Classes.Eq Distribution.System.Platform
instance Data.Data.Data Distribution.System.Arch
instance GHC.Read.Read Distribution.System.Arch
instance GHC.Show.Show Distribution.System.Arch
instance GHC.Classes.Ord Distribution.System.Arch
instance GHC.Generics.Generic Distribution.System.Arch
instance GHC.Classes.Eq Distribution.System.Arch
instance Data.Data.Data Distribution.System.OS
instance GHC.Read.Read Distribution.System.OS
instance GHC.Show.Show Distribution.System.OS
instance GHC.Classes.Ord Distribution.System.OS
instance GHC.Generics.Generic Distribution.System.OS
instance GHC.Classes.Eq Distribution.System.OS
instance Data.Binary.Class.Binary Distribution.System.OS
instance Distribution.Text.Text Distribution.System.OS
instance Data.Binary.Class.Binary Distribution.System.Arch
instance Distribution.Text.Text Distribution.System.Arch
instance Data.Binary.Class.Binary Distribution.System.Platform
instance Distribution.Text.Text Distribution.System.Platform
-- | Exports the <a>Version</a> type along with a parser and pretty
-- printer. A version is something like <tt>"1.3.3"</tt>. It also defines
-- the <a>VersionRange</a> data types. Version ranges are like <tt>">=
-- 1.2 && < 2"</tt>.
module Distribution.Version
-- | A <a>Version</a> represents the version of a software entity.
--
-- An instance of <a>Eq</a> is provided, which implements exact equality
-- modulo reordering of the tags in the <a>versionTags</a> field.
--
-- An instance of <a>Ord</a> is also provided, which gives lexicographic
-- ordering on the <a>versionBranch</a> fields (i.e. 2.1 > 2.0, 1.2.3
-- > 1.2.2, etc.). This is expected to be sufficient for many uses,
-- but note that you may need to use a more specific ordering for your
-- versioning scheme. For example, some versioning schemes may include
-- pre-releases which have tags <tt>"pre1"</tt>, <tt>"pre2"</tt>, and so
-- on, and these would need to be taken into account when determining
-- ordering. In some cases, date ordering may be more appropriate, so the
-- application would have to look for <tt>date</tt> tags in the
-- <a>versionTags</a> field and compare those. The bottom line is, don't
-- always assume that <a>compare</a> and other <a>Ord</a> operations are
-- the right thing for every <a>Version</a>.
--
-- Similarly, concrete representations of versions may differ. One
-- possible concrete representation is provided (see <a>showVersion</a>
-- and <a>parseVersion</a>), but depending on the application a different
-- concrete representation may be more appropriate.
data Version :: *
Version :: [Int] -> [String] -> Version
-- | The numeric branch for this version. This reflects the fact that most
-- software versions are tree-structured; there is a main trunk which is
-- tagged with versions at various points (1,2,3...), and the first
-- branch off the trunk after version 3 is 3.1, the second branch off the
-- trunk after version 3 is 3.2, and so on. The tree can be branched
-- arbitrarily, just by adding more digits.
--
-- We represent the branch as a list of <a>Int</a>, so version 3.2.1
-- becomes [3,2,1]. Lexicographic ordering (i.e. the default instance of
-- <a>Ord</a> for <tt>[Int]</tt>) gives the natural ordering of branches.
[versionBranch] :: Version -> [Int]
-- | A version can be tagged with an arbitrary list of strings. The
-- interpretation of the list of tags is entirely dependent on the entity
-- that this version applies to.
[versionTags] :: Version -> [String]
data VersionRange
-- | <i>Deprecated: Use <a>anyVersion</a>, <a>foldVersionRange</a> or
-- <a>asVersionIntervals</a></i>
AnyVersion :: VersionRange
-- | <i>Deprecated: Use <a>thisVersion</a>, <a>foldVersionRange</a> or
-- <a>asVersionIntervals</a></i>
ThisVersion :: Version -> VersionRange
-- | <i>Deprecated: Use <a>laterVersion</a>, <a>foldVersionRange</a> or
-- <a>asVersionIntervals</a></i>
LaterVersion :: Version -> VersionRange
-- | <i>Deprecated: Use <a>earlierVersion</a>, <a>foldVersionRange</a> or
-- <a>asVersionIntervals</a></i>
EarlierVersion :: Version -> VersionRange
-- | <i>Deprecated: Use <a>anyVersion</a>, <a>foldVersionRange</a> or
-- <a>asVersionIntervals</a></i>
WildcardVersion :: Version -> VersionRange
-- | <i>Deprecated: Use <a>unionVersionRanges</a>, <a>foldVersionRange</a>
-- or <a>asVersionIntervals</a></i>
UnionVersionRanges :: VersionRange -> VersionRange -> VersionRange
-- | <i>Deprecated: Use <a>intersectVersionRanges</a>,
-- <a>foldVersionRange</a> or <a>asVersionIntervals</a></i>
IntersectVersionRanges :: VersionRange -> VersionRange -> VersionRange
VersionRangeParens :: VersionRange -> VersionRange
-- | The version range <tt>-any</tt>. That is, a version range containing
-- all versions.
--
-- <pre>
-- withinRange v anyVersion = True
-- </pre>
anyVersion :: VersionRange
-- | The empty version range, that is a version range containing no
-- versions.
--
-- This can be constructed using any unsatisfiable version range
-- expression, for example <tt>> 1 && < 1</tt>.
--
-- <pre>
-- withinRange v noVersion = False
-- </pre>
noVersion :: VersionRange
-- | The version range <tt>== v</tt>
--
-- <pre>
-- withinRange v' (thisVersion v) = v' == v
-- </pre>
thisVersion :: Version -> VersionRange
-- | The version range <tt><a>||</a> v</tt>
--
-- <pre>
-- withinRange v' (notThisVersion v) = v' /= v
-- </pre>
notThisVersion :: Version -> VersionRange
-- | The version range <tt>> v</tt>
--
-- <pre>
-- withinRange v' (laterVersion v) = v' > v
-- </pre>
laterVersion :: Version -> VersionRange
-- | The version range <tt>< v</tt>
--
-- <pre>
-- withinRange v' (earlierVersion v) = v' < v
-- </pre>
earlierVersion :: Version -> VersionRange
-- | The version range <tt>>= v</tt>
--
-- <pre>
-- withinRange v' (orLaterVersion v) = v' >= v
-- </pre>
orLaterVersion :: Version -> VersionRange
-- | The version range <tt><= v</tt>
--
-- <pre>
-- withinRange v' (orEarlierVersion v) = v' <= v
-- </pre>
orEarlierVersion :: Version -> VersionRange
-- | The version range <tt>vr1 || vr2</tt>
--
-- <pre>
-- withinRange v' (unionVersionRanges vr1 vr2)
-- = withinRange v' vr1 || withinRange v' vr2
-- </pre>
unionVersionRanges :: VersionRange -> VersionRange -> VersionRange
-- | The version range <tt>vr1 && vr2</tt>
--
-- <pre>
-- withinRange v' (intersectVersionRanges vr1 vr2)
-- = withinRange v' vr1 && withinRange v' vr2
-- </pre>
intersectVersionRanges :: VersionRange -> VersionRange -> VersionRange
-- | The difference of two version ranges
--
-- <pre>
-- withinRange v' (differenceVersionRanges vr1 vr2)
-- = withinRange v' vr1 && not (withinRange v' vr2)
-- </pre>
differenceVersionRanges :: VersionRange -> VersionRange -> VersionRange
-- | The inverse of a version range
--
-- <pre>
-- withinRange v' (invertVersionRange vr)
-- = not (withinRange v' vr)
-- </pre>
invertVersionRange :: VersionRange -> VersionRange
-- | The version range <tt>== v.*</tt>.
--
-- For example, for version <tt>1.2</tt>, the version range <tt>==
-- 1.2.*</tt> is the same as <tt>>= 1.2 && < 1.3</tt>
--
-- <pre>
-- withinRange v' (laterVersion v) = v' >= v && v' < upper v
-- where
-- upper (Version lower t) = Version (init lower ++ [last lower + 1]) t
-- </pre>
withinVersion :: Version -> VersionRange
-- | The version range <tt>>= v1 && <= v2</tt>.
--
-- In practice this is not very useful because we normally use inclusive
-- lower bounds and exclusive upper bounds.
--
-- <pre>
-- withinRange v' (laterVersion v) = v' > v
-- </pre>
-- | <i>Deprecated: In practice this is not very useful because we normally
-- use inclusive lower bounds and exclusive upper bounds</i>
betweenVersionsInclusive :: Version -> Version -> VersionRange
-- | Does this version fall within the given range?
--
-- This is the evaluation function for the <a>VersionRange</a> type.
withinRange :: Version -> VersionRange -> Bool
-- | Does this <a>VersionRange</a> place any restriction on the
-- <a>Version</a> or is it in fact equivalent to <a>AnyVersion</a>.
--
-- Note this is a semantic check, not simply a syntactic check. So for
-- example the following is <tt>True</tt> (for all <tt>v</tt>).
--
-- <pre>
-- isAnyVersion (EarlierVersion v `UnionVersionRanges` orLaterVersion v)
-- </pre>
isAnyVersion :: VersionRange -> Bool
-- | This is the converse of <a>isAnyVersion</a>. It check if the version
-- range is empty, if there is no possible version that satisfies the
-- version range.
--
-- For example this is <tt>True</tt> (for all <tt>v</tt>):
--
-- <pre>
-- isNoVersion (EarlierVersion v `IntersectVersionRanges` LaterVersion v)
-- </pre>
isNoVersion :: VersionRange -> Bool
-- | Is this version range in fact just a specific version?
--
-- For example the version range <tt>">= 3 && <= 3"</tt>
-- contains only the version <tt>3</tt>.
isSpecificVersion :: VersionRange -> Maybe Version
-- | Simplify a <a>VersionRange</a> expression. For non-empty version
-- ranges this produces a canonical form. Empty or inconsistent version
-- ranges are left as-is because that provides more information.
--
-- If you need a canonical form use <tt>fromVersionIntervals .
-- toVersionIntervals</tt>
--
-- It satisfies the following properties:
--
-- <pre>
-- withinRange v (simplifyVersionRange r) = withinRange v r
-- </pre>
--
-- <pre>
-- withinRange v r = withinRange v r'
-- ==> simplifyVersionRange r = simplifyVersionRange r'
-- || isNoVersion r
-- || isNoVersion r'
-- </pre>
simplifyVersionRange :: VersionRange -> VersionRange
-- | Fold over the basic syntactic structure of a <a>VersionRange</a>.
--
-- This provides a syntactic view of the expression defining the version
-- range. The syntactic sugar <tt>">= v"</tt>, <tt>"<= v"</tt> and
-- <tt>"== v.*"</tt> is presented in terms of the other basic syntax.
--
-- For a semantic view use <a>asVersionIntervals</a>.
foldVersionRange :: a -> (Version -> a) -> (Version -> a) -> (Version -> a) -> (a -> a -> a) -> (a -> a -> a) -> VersionRange -> a
-- | An extended variant of <a>foldVersionRange</a> that also provides a
-- view of the expression in which the syntactic sugar <tt>">=
-- v"</tt>, <tt>"<= v"</tt> and <tt>"== v.*"</tt> is presented
-- explicitly rather than in terms of the other basic syntax.
foldVersionRange' :: a -> (Version -> a) -> (Version -> a) -> (Version -> a) -> (Version -> a) -> (Version -> a) -> (Version -> Version -> a) -> (a -> a -> a) -> (a -> a -> a) -> (a -> a) -> VersionRange -> a
-- | Does the version range have an upper bound?
hasUpperBound :: VersionRange -> Bool
-- | Does the version range have an explicit lower bound?
--
-- Note: this function only considers the user-specified lower bounds,
-- but not the implicit >=0 lower bound.
hasLowerBound :: VersionRange -> Bool
-- | Given a version range, remove the highest upper bound. Example:
-- <tt>(>= 1 && < 3) || (>= 4 && < 5)</tt> is
-- converted to <tt>(>= 1 && <a>|| (</a>= 4)</tt>.
removeUpperBound :: VersionRange -> VersionRange
-- | View a <a>VersionRange</a> as a union of intervals.
--
-- This provides a canonical view of the semantics of a
-- <a>VersionRange</a> as opposed to the syntax of the expression used to
-- define it. For the syntactic view use <a>foldVersionRange</a>.
--
-- Each interval is non-empty. The sequence is in increasing order and no
-- intervals overlap or touch. Therefore only the first and last can be
-- unbounded. The sequence can be empty if the range is empty (e.g. a
-- range expression like <tt><a>&&</a> 2</tt>).
--
-- Other checks are trivial to implement using this view. For example:
--
-- <pre>
-- isNoVersion vr | [] <- asVersionIntervals vr = True
-- | otherwise = False
-- </pre>
--
-- <pre>
-- isSpecificVersion vr
-- | [(LowerBound v InclusiveBound
-- ,UpperBound v' InclusiveBound)] <- asVersionIntervals vr
-- , v == v' = Just v
-- | otherwise = Nothing
-- </pre>
asVersionIntervals :: VersionRange -> [VersionInterval]
type VersionInterval = (LowerBound, UpperBound)
data LowerBound
LowerBound :: Version -> !Bound -> LowerBound
data UpperBound
NoUpperBound :: UpperBound
UpperBound :: Version -> !Bound -> UpperBound
data Bound
ExclusiveBound :: Bound
InclusiveBound :: Bound
-- | A complementary representation of a <a>VersionRange</a>. Instead of a
-- boolean version predicate it uses an increasing sequence of
-- non-overlapping, non-empty intervals.
--
-- The key point is that this representation gives a canonical
-- representation for the semantics of <a>VersionRange</a>s. This makes
-- it easier to check things like whether a version range is empty,
-- covers all versions, or requires a certain minimum or maximum version.
-- It also makes it easy to check equality or containment. It also makes
-- it easier to identify 'simple' version predicates for translation into
-- foreign packaging systems that do not support complex version range
-- expressions.
data VersionIntervals
-- | Convert a <a>VersionRange</a> to a sequence of version intervals.
toVersionIntervals :: VersionRange -> VersionIntervals
-- | Convert a <a>VersionIntervals</a> value back into a
-- <a>VersionRange</a> expression representing the version intervals.
fromVersionIntervals :: VersionIntervals -> VersionRange
-- | Test if a version falls within the version intervals.
--
-- It exists mostly for completeness and testing. It satisfies the
-- following properties:
--
-- <pre>
-- withinIntervals v (toVersionIntervals vr) = withinRange v vr
-- withinIntervals v ivs = withinRange v (fromVersionIntervals ivs)
-- </pre>
withinIntervals :: Version -> VersionIntervals -> Bool
-- | Inspect the list of version intervals.
versionIntervals :: VersionIntervals -> [VersionInterval]
-- | Directly construct a <a>VersionIntervals</a> from a list of intervals.
--
-- Each interval must be non-empty. The sequence must be in increasing
-- order and no intervals may overlap or touch. If any of these
-- conditions are not satisfied the function returns <tt>Nothing</tt>.
mkVersionIntervals :: [VersionInterval] -> Maybe VersionIntervals
unionVersionIntervals :: VersionIntervals -> VersionIntervals -> VersionIntervals
intersectVersionIntervals :: VersionIntervals -> VersionIntervals -> VersionIntervals
invertVersionIntervals :: VersionIntervals -> VersionIntervals
instance GHC.Show.Show Distribution.Version.VersionIntervals
instance GHC.Classes.Eq Distribution.Version.VersionIntervals
instance GHC.Show.Show Distribution.Version.LowerBound
instance GHC.Classes.Eq Distribution.Version.LowerBound
instance GHC.Show.Show Distribution.Version.UpperBound
instance GHC.Classes.Eq Distribution.Version.UpperBound
instance GHC.Show.Show Distribution.Version.Bound
instance GHC.Classes.Eq Distribution.Version.Bound
instance GHC.Show.Show Distribution.Version.VersionRange
instance GHC.Read.Read Distribution.Version.VersionRange
instance GHC.Generics.Generic Distribution.Version.VersionRange
instance GHC.Classes.Eq Distribution.Version.VersionRange
instance Data.Data.Data Distribution.Version.VersionRange
instance Data.Binary.Class.Binary Distribution.Version.VersionRange
instance GHC.Classes.Ord Distribution.Version.LowerBound
instance GHC.Classes.Ord Distribution.Version.UpperBound
instance Distribution.Text.Text Distribution.Version.VersionRange
-- | Package descriptions contain fields for specifying the name of a
-- software license and the name of the file containing the text of that
-- license. While package authors may choose any license they like, Cabal
-- provides an enumeration of a small set of common free and open source
-- software licenses. This is done so that Hackage can recognise
-- licenses, so that tools can detect <a>licensing conflicts</a>, and to
-- deter <a>license proliferation</a>.
--
-- It is recommended that all package authors use the
-- <tt>license-file</tt> or <tt>license-files</tt> fields in their
-- package descriptions. Further information about these fields can be
-- found in the <a>Cabal users guide</a>.
--
-- <h1>Additional resources</h1>
--
-- The following websites provide information about free and open source
-- software licenses:
--
-- <ul>
-- <li><a>The Open Source Initiative (OSI)</a></li>
-- <li><a>The Free Software Foundation (FSF)</a></li>
-- </ul>
--
-- <h1>Disclaimer</h1>
--
-- The descriptions of software licenses provided by this documentation
-- are intended for informational purposes only and in no way constitute
-- legal advice. Please read the text of the licenses and consult a
-- lawyer for any advice regarding software licensing.
module Distribution.License
-- | Indicates the license under which a package's source code is released.
-- Versions of the licenses not listed here will be rejected by Hackage
-- and cause <tt>cabal check</tt> to issue a warning.
data License
-- | GNU General Public License, <a>version 2</a> or <a>version 3</a>.
GPL :: (Maybe Version) -> License
-- | <a>GNU Affero General Public License, version 3</a>.
AGPL :: (Maybe Version) -> License
-- | GNU Lesser General Public License, <a>version 2.1</a> or <a>version
-- 3</a>.
LGPL :: (Maybe Version) -> License
-- | <a>2-clause BSD license</a>.
BSD2 :: License
-- | <a>3-clause BSD license</a>.
BSD3 :: License
-- | <a>4-clause BSD license</a>. This license has not been approved by the
-- OSI and is incompatible with the GNU GPL. It is provided for
-- historical reasons and should be avoided.
BSD4 :: License
-- | <a>MIT license</a>.
MIT :: License
-- | <a>ISC license</a>
ISC :: License
-- | <a>Mozilla Public License, version 2.0</a>.
MPL :: Version -> License
-- | <a>Apache License, version 2.0</a>.
Apache :: (Maybe Version) -> License
-- | The author of a package disclaims any copyright to its source code and
-- dedicates it to the public domain. This is not a software license.
-- Please note that it is not possible to dedicate works to the public
-- domain in every jurisdiction, nor is a work that is in the public
-- domain in one jurisdiction necessarily in the public domain elsewhere.
PublicDomain :: License
-- | Explicitly 'All Rights Reserved', eg for proprietary software. The
-- package may not be legally modified or redistributed by anyone but the
-- rightsholder.
AllRightsReserved :: License
-- | No license specified which legally defaults to 'All Rights Reserved'.
-- The package may not be legally modified or redistributed by anyone but
-- the rightsholder.
UnspecifiedLicense :: License
-- | Any other software license.
OtherLicense :: License
-- | Indicates an erroneous license name.
UnknownLicense :: String -> License
-- | The list of all currently recognised licenses.
knownLicenses :: [License]
instance Data.Data.Data Distribution.License.License
instance GHC.Classes.Eq Distribution.License.License
instance GHC.Show.Show Distribution.License.License
instance GHC.Read.Read Distribution.License.License
instance GHC.Generics.Generic Distribution.License.License
instance Data.Binary.Class.Binary Distribution.License.License
instance Distribution.Text.Text Distribution.License.License
-- | Defines a package identifier along with a parser and pretty printer
-- for it. <a>PackageIdentifier</a>s consist of a name and an exact
-- version. It also defines a <a>Dependency</a> data type. A dependency
-- is a package name and a version range, like <tt>"foo >= 1.2
-- && < 2"</tt>.
module Distribution.Package
newtype PackageName
PackageName :: String -> PackageName
[unPackageName] :: PackageName -> String
-- | The name and version of a package.
data PackageIdentifier
PackageIdentifier :: PackageName -> Version -> PackageIdentifier
-- | The name of this package, eg. foo
[pkgName] :: PackageIdentifier -> PackageName
-- | the version of this package, eg 1.2
[pkgVersion] :: PackageIdentifier -> Version
-- | Type alias so we can use the shorter name PackageId.
type PackageId = PackageIdentifier
-- | A <a>ComponentId</a> uniquely identifies the transitive source code
-- closure of a component. For non-Backpack components, it also serves as
-- the basis for install paths, symbols, etc.
data ComponentId
ComponentId :: String -> ComponentId
-- | For now, there is no distinction between component IDs and unit IDs in
-- Cabal.
newtype UnitId
SimpleUnitId :: ComponentId -> UnitId
-- | Makes a simple-style UnitId from a string.
mkUnitId :: String -> UnitId
-- | Make an old-style UnitId from a package identifier
mkLegacyUnitId :: PackageId -> UnitId
-- | Returns library name prefixed with HS, suitable for filenames
getHSLibraryName :: UnitId -> String
-- | <i>Deprecated: Use UnitId instead</i>
type InstalledPackageId = UnitId
newtype AbiHash
AbiHash :: String -> AbiHash
-- | Describes a dependency on a source package (API)
data Dependency
Dependency :: PackageName -> VersionRange -> Dependency
thisPackageVersion :: PackageIdentifier -> Dependency
notThisPackageVersion :: PackageIdentifier -> Dependency
-- | Simplify the <a>VersionRange</a> expression in a <a>Dependency</a>.
-- See <a>simplifyVersionRange</a>.
simplifyDependency :: Dependency -> Dependency
-- | Class of things that have a <a>PackageIdentifier</a>
--
-- Types in this class are all notions of a package. This allows us to
-- have different types for the different phases that packages go though,
-- from simple name/id, package description, configured or installed
-- packages.
--
-- Not all kinds of packages can be uniquely identified by a
-- <a>PackageIdentifier</a>. In particular, installed packages cannot,
-- there may be many installed instances of the same source package.
class Package pkg
packageId :: Package pkg => pkg -> PackageIdentifier
packageName :: Package pkg => pkg -> PackageName
packageVersion :: Package pkg => pkg -> Version
-- | Packages that have an installed package ID
class Package pkg => HasUnitId pkg
installedUnitId :: HasUnitId pkg => pkg -> UnitId
-- | Compatibility wrapper for Cabal pre-1.24.
-- | <i>Deprecated: Use installedUnitId instead</i>
installedPackageId :: HasUnitId pkg => pkg -> UnitId
-- | Class of installed packages.
--
-- The primary data type which is an instance of this package is
-- <tt>InstalledPackageInfo</tt>, but when we are doing install plans in
-- Cabal install we may have other, installed package-like things which
-- contain more metadata. Installed packages have exact dependencies
-- <a>installedDepends</a>.
class (HasUnitId pkg) => PackageInstalled pkg
installedDepends :: PackageInstalled pkg => pkg -> [UnitId]
instance GHC.Generics.Generic Distribution.Package.AbiHash
instance GHC.Read.Read Distribution.Package.AbiHash
instance GHC.Show.Show Distribution.Package.AbiHash
instance GHC.Classes.Eq Distribution.Package.AbiHash
instance Data.Data.Data Distribution.Package.Dependency
instance GHC.Classes.Eq Distribution.Package.Dependency
instance GHC.Show.Show Distribution.Package.Dependency
instance GHC.Read.Read Distribution.Package.Dependency
instance GHC.Generics.Generic Distribution.Package.Dependency
instance Control.DeepSeq.NFData Distribution.Package.UnitId
instance Distribution.Text.Text Distribution.Package.UnitId
instance Data.Binary.Class.Binary Distribution.Package.UnitId
instance Data.Data.Data Distribution.Package.UnitId
instance GHC.Classes.Ord Distribution.Package.UnitId
instance GHC.Classes.Eq Distribution.Package.UnitId
instance GHC.Show.Show Distribution.Package.UnitId
instance GHC.Read.Read Distribution.Package.UnitId
instance GHC.Generics.Generic Distribution.Package.UnitId
instance Data.Data.Data Distribution.Package.ComponentId
instance GHC.Classes.Ord Distribution.Package.ComponentId
instance GHC.Classes.Eq Distribution.Package.ComponentId
instance GHC.Show.Show Distribution.Package.ComponentId
instance GHC.Read.Read Distribution.Package.ComponentId
instance GHC.Generics.Generic Distribution.Package.ComponentId
instance Data.Data.Data Distribution.Package.PackageIdentifier
instance GHC.Classes.Ord Distribution.Package.PackageIdentifier
instance GHC.Classes.Eq Distribution.Package.PackageIdentifier
instance GHC.Show.Show Distribution.Package.PackageIdentifier
instance GHC.Read.Read Distribution.Package.PackageIdentifier
instance GHC.Generics.Generic Distribution.Package.PackageIdentifier
instance Data.Data.Data Distribution.Package.PackageName
instance GHC.Classes.Ord Distribution.Package.PackageName
instance GHC.Classes.Eq Distribution.Package.PackageName
instance GHC.Show.Show Distribution.Package.PackageName
instance GHC.Read.Read Distribution.Package.PackageName
instance GHC.Generics.Generic Distribution.Package.PackageName
instance Data.Binary.Class.Binary Distribution.Package.PackageName
instance Distribution.Text.Text Distribution.Package.PackageName
instance Control.DeepSeq.NFData Distribution.Package.PackageName
instance Data.Binary.Class.Binary Distribution.Package.PackageIdentifier
instance Distribution.Text.Text Distribution.Package.PackageIdentifier
instance Control.DeepSeq.NFData Distribution.Package.PackageIdentifier
instance Data.Binary.Class.Binary Distribution.Package.ComponentId
instance Distribution.Text.Text Distribution.Package.ComponentId
instance Control.DeepSeq.NFData Distribution.Package.ComponentId
instance Data.Binary.Class.Binary Distribution.Package.Dependency
instance Distribution.Text.Text Distribution.Package.Dependency
instance Distribution.Package.Package Distribution.Package.PackageIdentifier
instance Data.Binary.Class.Binary Distribution.Package.AbiHash
instance Distribution.Text.Text Distribution.Package.AbiHash
-- | Haskell language dialects and extensions
module Language.Haskell.Extension
-- | This represents a Haskell language dialect.
--
-- Language <a>Extension</a>s are interpreted relative to one of these
-- base languages.
data Language
-- | The Haskell 98 language as defined by the Haskell 98 report.
-- <a>http://haskell.org/onlinereport/</a>
Haskell98 :: Language
-- | The Haskell 2010 language as defined by the Haskell 2010 report.
-- <a>http://www.haskell.org/onlinereport/haskell2010</a>
Haskell2010 :: Language
-- | An unknown language, identified by its name.
UnknownLanguage :: String -> Language
knownLanguages :: [Language]
-- | This represents language extensions beyond a base <a>Language</a>
-- definition (such as <a>Haskell98</a>) that are supported by some
-- implementations, usually in some special mode.
--
-- Where applicable, references are given to an implementation's official
-- documentation.
data Extension
-- | Enable a known extension
EnableExtension :: KnownExtension -> Extension
-- | Disable a known extension
DisableExtension :: KnownExtension -> Extension
-- | An unknown extension, identified by the name of its <tt>LANGUAGE</tt>
-- pragma.
UnknownExtension :: String -> Extension
data KnownExtension
-- | Allow overlapping class instances, provided there is a unique most
-- specific instance for each use.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/type-class-extensions.html#instance-overlap</a></li>
-- </ul>
OverlappingInstances :: KnownExtension
-- | Ignore structural rules guaranteeing the termination of class instance
-- resolution. Termination is guaranteed by a fixed-depth recursion
-- stack, and compilation may fail if this depth is exceeded.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/type-class-extensions.html#undecidable-instances</a></li>
-- </ul>
UndecidableInstances :: KnownExtension
-- | Implies <a>OverlappingInstances</a>. Allow the implementation to
-- choose an instance even when it is possible that further instantiation
-- of types will lead to a more specific instance being applicable.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/type-class-extensions.html#instance-overlap</a></li>
-- </ul>
IncoherentInstances :: KnownExtension
-- | <i>(deprecated)</i> Allow recursive bindings in <tt>do</tt> blocks,
-- using the <tt>rec</tt> keyword. See also <a>RecursiveDo</a>.
DoRec :: KnownExtension
-- | Allow recursive bindings using <tt>mdo</tt>, a variant of <tt>do</tt>.
-- <tt>DoRec</tt> provides a different, preferred syntax.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#recursive-do-notation</a></li>
-- </ul>
RecursiveDo :: KnownExtension
-- | Provide syntax for writing list comprehensions which iterate over
-- several lists together, like the <a>zipWith</a> family of functions.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#parallel-list-comprehensions</a></li>
-- </ul>
ParallelListComp :: KnownExtension
-- | Allow multiple parameters in a type class.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/type-class-extensions.html#multi-param-type-classes</a></li>
-- </ul>
MultiParamTypeClasses :: KnownExtension
-- | Enable the dreaded monomorphism restriction.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/monomorphism.html</a></li>
-- </ul>
MonomorphismRestriction :: KnownExtension
-- | Allow a specification attached to a multi-parameter type class which
-- indicates that some parameters are entirely determined by others. The
-- implementation will check that this property holds for the declared
-- instances, and will use this property to reduce ambiguity in instance
-- resolution.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/type-class-extensions.html#functional-dependencies</a></li>
-- </ul>
FunctionalDependencies :: KnownExtension
-- | Like <a>RankNTypes</a> but does not allow a higher-rank type to itself
-- appear on the left of a function arrow.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extensions.html#universal-quantification</a></li>
-- </ul>
Rank2Types :: KnownExtension
-- | Allow a universally-quantified type to occur on the left of a function
-- arrow.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extensions.html#universal-quantification</a></li>
-- </ul>
RankNTypes :: KnownExtension
-- | Allow data constructors to have polymorphic arguments. Unlike
-- <a>RankNTypes</a>, does not allow this for ordinary functions.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extensions.html#universal-quantification</a></li>
-- </ul>
PolymorphicComponents :: KnownExtension
-- | Allow existentially-quantified data constructors.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/data-type-extensions.html#existential-quantification</a></li>
-- </ul>
ExistentialQuantification :: KnownExtension
-- | Cause a type variable in a signature, which has an explicit
-- <tt>forall</tt> quantifier, to scope over the definition of the
-- accompanying value declaration.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extensions.html#scoped-type-variables</a></li>
-- </ul>
ScopedTypeVariables :: KnownExtension
-- | Deprecated, use <a>ScopedTypeVariables</a> instead.
PatternSignatures :: KnownExtension
-- | Enable implicit function parameters with dynamic scope.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extensions.html#implicit-parameters</a></li>
-- </ul>
ImplicitParams :: KnownExtension
-- | Relax some restrictions on the form of the context of a type
-- signature.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extensions.html#flexible-contexts</a></li>
-- </ul>
FlexibleContexts :: KnownExtension
-- | Relax some restrictions on the form of the context of an instance
-- declaration.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/type-class-extensions.html#instance-rules</a></li>
-- </ul>
FlexibleInstances :: KnownExtension
-- | Allow data type declarations with no constructors.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/data-type-extensions.html#nullary-types</a></li>
-- </ul>
EmptyDataDecls :: KnownExtension
-- | Run the C preprocessor on Haskell source code.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/options-phases.html#c-pre-processor</a></li>
-- </ul>
CPP :: KnownExtension
-- | Allow an explicit kind signature giving the kind of types over which a
-- type variable ranges.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extensions.html#kinding</a></li>
-- </ul>
KindSignatures :: KnownExtension
-- | Enable a form of pattern which forces evaluation before an attempted
-- match, and a form of strict <tt>let</tt>/<tt>where</tt> binding.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/bang-patterns.html</a></li>
-- </ul>
BangPatterns :: KnownExtension
-- | Allow type synonyms in instance heads.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/type-class-extensions.html#flexible-instance-head</a></li>
-- </ul>
TypeSynonymInstances :: KnownExtension
-- | Enable Template Haskell, a system for compile-time metaprogramming.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/template-haskell.html</a></li>
-- </ul>
TemplateHaskell :: KnownExtension
-- | Enable the Foreign Function Interface. In GHC, implements the standard
-- Haskell 98 Foreign Function Interface Addendum, plus some GHC-specific
-- extensions.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/ffi.html</a></li>
-- </ul>
ForeignFunctionInterface :: KnownExtension
-- | Enable arrow notation.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/arrow-notation.html</a></li>
-- </ul>
Arrows :: KnownExtension
-- | <i>(deprecated)</i> Enable generic type classes, with default
-- instances defined in terms of the algebraic structure of a type.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/generic-classes.html</a></li>
-- </ul>
Generics :: KnownExtension
-- | Enable the implicit importing of the module <a>Prelude</a>. When
-- disabled, when desugaring certain built-in syntax into ordinary
-- identifiers, use whatever is in scope rather than the <a>Prelude</a>
-- -- version.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#rebindable-syntax</a></li>
-- </ul>
ImplicitPrelude :: KnownExtension
-- | Enable syntax for implicitly binding local names corresponding to the
-- field names of a record. Puns bind specific names, unlike
-- <a>RecordWildCards</a>.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#record-puns</a></li>
-- </ul>
NamedFieldPuns :: KnownExtension
-- | Enable a form of guard which matches a pattern and binds variables.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#pattern-guards</a></li>
-- </ul>
PatternGuards :: KnownExtension
-- | Allow a type declared with <tt>newtype</tt> to use <tt>deriving</tt>
-- for any class with an instance for the underlying type.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/deriving.html#newtype-deriving</a></li>
-- </ul>
GeneralizedNewtypeDeriving :: KnownExtension
-- | Enable the "Trex" extensible records system.
--
-- <ul>
--
-- <li><a>http://cvs.haskell.org/Hugs/pages/users_guide/hugs-only.html#TREX</a></li>
-- </ul>
ExtensibleRecords :: KnownExtension
-- | Enable type synonyms which are transparent in some definitions and
-- opaque elsewhere, as a way of implementing abstract datatypes.
--
-- <ul>
--
-- <li><a>http://cvs.haskell.org/Hugs/pages/users_guide/restricted-synonyms.html</a></li>
-- </ul>
RestrictedTypeSynonyms :: KnownExtension
-- | Enable an alternate syntax for string literals, with string
-- templating.
--
-- <ul>
--
-- <li><a>http://cvs.haskell.org/Hugs/pages/users_guide/here-documents.html</a></li>
-- </ul>
HereDocuments :: KnownExtension
-- | Allow the character <tt>#</tt> as a postfix modifier on identifiers.
-- Also enables literal syntax for unboxed values.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#magic-hash</a></li>
-- </ul>
MagicHash :: KnownExtension
-- | Allow data types and type synonyms which are indexed by types, i.e.
-- ad-hoc polymorphism for types.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/type-families.html</a></li>
-- </ul>
TypeFamilies :: KnownExtension
-- | Allow a standalone declaration which invokes the type class
-- <tt>deriving</tt> mechanism.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/deriving.html#stand-alone-deriving</a></li>
-- </ul>
StandaloneDeriving :: KnownExtension
-- | Allow certain Unicode characters to stand for certain ASCII character
-- sequences, e.g. keywords and punctuation.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#unicode-syntax</a></li>
-- </ul>
UnicodeSyntax :: KnownExtension
-- | Allow the use of unboxed types as foreign types, e.g. in <tt>foreign
-- import</tt> and <tt>foreign export</tt>.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/ffi.html#id681687</a></li>
-- </ul>
UnliftedFFITypes :: KnownExtension
-- | Enable interruptible FFI.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/ffi.html#ffi-interruptible</a></li>
-- </ul>
InterruptibleFFI :: KnownExtension
-- | Allow use of CAPI FFI calling convention (<tt>foreign import
-- capi</tt>).
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/ffi.html#ffi-capi</a></li>
-- </ul>
CApiFFI :: KnownExtension
-- | Defer validity checking of types until after expanding type synonyms,
-- relaxing the constraints on how synonyms may be used.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/data-type-extensions.html#type-synonyms</a></li>
-- </ul>
LiberalTypeSynonyms :: KnownExtension
-- | Allow the name of a type constructor, type class, or type variable to
-- be an infix operator.
TypeOperators :: KnownExtension
-- | Enable syntax for implicitly binding local names corresponding to the
-- field names of a record. A wildcard binds all unmentioned names,
-- unlike <a>NamedFieldPuns</a>.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#record-wildcards</a></li>
-- </ul>
RecordWildCards :: KnownExtension
-- | Deprecated, use <a>NamedFieldPuns</a> instead.
RecordPuns :: KnownExtension
-- | Allow a record field name to be disambiguated by the type of the
-- record it's in.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#disambiguate-fields</a></li>
-- </ul>
DisambiguateRecordFields :: KnownExtension
-- | Enable traditional record syntax (as supported by Haskell 98)
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#traditional-record-syntax</a></li>
-- </ul>
TraditionalRecordSyntax :: KnownExtension
-- | Enable overloading of string literals using a type class, much like
-- integer literals.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/type-class-extensions.html#overloaded-strings</a></li>
-- </ul>
OverloadedStrings :: KnownExtension
-- | Enable generalized algebraic data types, in which type variables may
-- be instantiated on a per-constructor basis. Implies <a>GADTSyntax</a>.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/data-type-extensions.html#gadt</a></li>
-- </ul>
GADTs :: KnownExtension
-- | Enable GADT syntax for declaring ordinary algebraic datatypes.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/data-type-extensions.html#gadt-style</a></li>
-- </ul>
GADTSyntax :: KnownExtension
-- | Make pattern bindings monomorphic.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/monomorphism.html#id630981</a></li>
-- </ul>
MonoPatBinds :: KnownExtension
-- | Relax the requirements on mutually-recursive polymorphic functions.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extensions.html#typing-binds</a></li>
-- </ul>
RelaxedPolyRec :: KnownExtension
-- | Allow default instantiation of polymorphic types in more situations.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/interactive-evaluation.html#extended-default-rules</a></li>
-- </ul>
ExtendedDefaultRules :: KnownExtension
-- | Enable unboxed tuples.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/primitives.html#unboxed-tuples</a></li>
-- </ul>
UnboxedTuples :: KnownExtension
-- | Enable <tt>deriving</tt> for classes <a>Typeable</a> and <a>Data</a>.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/deriving.html#deriving-typeable</a></li>
-- </ul>
DeriveDataTypeable :: KnownExtension
-- | Enable <tt>deriving</tt> for <a>Generic</a> and <a>Generic1</a>.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/deriving.html#deriving-typeable</a></li>
-- </ul>
DeriveGeneric :: KnownExtension
-- | Enable support for default signatures.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/type-class-extensions.html#class-default-signatures</a></li>
-- </ul>
DefaultSignatures :: KnownExtension
-- | Allow type signatures to be specified in instance declarations.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/type-class-extensions.html#instance-sigs</a></li>
-- </ul>
InstanceSigs :: KnownExtension
-- | Allow a class method's type to place additional constraints on a class
-- type variable.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/type-class-extensions.html#class-method-types</a></li>
-- </ul>
ConstrainedClassMethods :: KnownExtension
-- | Allow imports to be qualified by the package name the module is
-- intended to be imported from, e.g.
--
-- <pre>
-- import "network" Network.Socket
-- </pre>
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#package-imports</a></li>
-- </ul>
PackageImports :: KnownExtension
-- | <i>(deprecated)</i> Allow a type variable to be instantiated at a
-- polymorphic type.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/6.12.3/html/users_guide/other-type-extensions.html#impredicative-polymorphism</a></li>
-- </ul>
ImpredicativeTypes :: KnownExtension
-- | <i>(deprecated)</i> Change the syntax for qualified infix operators.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/6.12.3/html/users_guide/syntax-extns.html#new-qualified-operators</a></li>
-- </ul>
NewQualifiedOperators :: KnownExtension
-- | Relax the interpretation of left operator sections to allow unary
-- postfix operators.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#postfix-operators</a></li>
-- </ul>
PostfixOperators :: KnownExtension
-- | Enable quasi-quotation, a mechanism for defining new concrete syntax
-- for expressions and patterns.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/template-haskell.html#th-quasiquotation</a></li>
-- </ul>
QuasiQuotes :: KnownExtension
-- | Enable generalized list comprehensions, supporting operations such as
-- sorting and grouping.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#generalised-list-comprehensions</a></li>
-- </ul>
TransformListComp :: KnownExtension
-- | Enable monad comprehensions, which generalise the list comprehension
-- syntax to work for any monad.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#monad-comprehensions</a></li>
-- </ul>
MonadComprehensions :: KnownExtension
-- | Enable view patterns, which match a value by applying a function and
-- matching on the result.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#view-patterns</a></li>
-- </ul>
ViewPatterns :: KnownExtension
-- | Allow concrete XML syntax to be used in expressions and patterns, as
-- per the Haskell Server Pages extension language:
-- <a>http://www.haskell.org/haskellwiki/HSP</a>. The ideas behind it are
-- discussed in the paper "Haskell Server Pages through Dynamic Loading"
-- by Niklas Broberg, from Haskell Workshop '05.
XmlSyntax :: KnownExtension
-- | Allow regular pattern matching over lists, as discussed in the paper
-- "Regular Expression Patterns" by Niklas Broberg, Andreas Farre and
-- Josef Svenningsson, from ICFP '04.
RegularPatterns :: KnownExtension
-- | Enable the use of tuple sections, e.g. <tt>(, True)</tt> desugars into
-- <tt>x -> (x, True)</tt>.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#tuple-sections</a></li>
-- </ul>
TupleSections :: KnownExtension
-- | Allow GHC primops, written in C--, to be imported into a Haskell file.
GHCForeignImportPrim :: KnownExtension
-- | Support for patterns of the form <tt>n + k</tt>, where <tt>k</tt> is
-- an integer literal.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#n-k-patterns</a></li>
-- </ul>
NPlusKPatterns :: KnownExtension
-- | Improve the layout rule when <tt>if</tt> expressions are used in a
-- <tt>do</tt> block.
DoAndIfThenElse :: KnownExtension
-- | Enable support for multi-way <tt>if</tt>-expressions.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#multi-way-if</a></li>
-- </ul>
MultiWayIf :: KnownExtension
-- | Enable support lambda-<tt>case</tt> expressions.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#lambda-case</a></li>
-- </ul>
LambdaCase :: KnownExtension
-- | Makes much of the Haskell sugar be desugared into calls to the
-- function with a particular name that is in scope.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#rebindable-syntax</a></li>
-- </ul>
RebindableSyntax :: KnownExtension
-- | Make <tt>forall</tt> a keyword in types, which can be used to give the
-- generalisation explicitly.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extensions.html#explicit-foralls</a></li>
-- </ul>
ExplicitForAll :: KnownExtension
-- | Allow contexts to be put on datatypes, e.g. the <tt>Eq a</tt> in
-- <tt>data Eq a => Set a = NilSet | ConsSet a (Set a)</tt>.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/data-type-extensions.html#datatype-contexts</a></li>
-- </ul>
DatatypeContexts :: KnownExtension
-- | Local (<tt>let</tt> and <tt>where</tt>) bindings are monomorphic.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extensions.html#mono-local-binds</a></li>
-- </ul>
MonoLocalBinds :: KnownExtension
-- | Enable <tt>deriving</tt> for the <a>Functor</a> class.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/deriving.html#deriving-typeable</a></li>
-- </ul>
DeriveFunctor :: KnownExtension
-- | Enable <tt>deriving</tt> for the <a>Traversable</a> class.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/deriving.html#deriving-typeable</a></li>
-- </ul>
DeriveTraversable :: KnownExtension
-- | Enable <tt>deriving</tt> for the <a>Foldable</a> class.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/deriving.html#deriving-typeable</a></li>
-- </ul>
DeriveFoldable :: KnownExtension
-- | Enable non-decreasing indentation for <tt>do</tt> blocks.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/bugs-and-infelicities.html#infelicities-syntax</a></li>
-- </ul>
NondecreasingIndentation :: KnownExtension
-- | Allow imports to be qualified with a safe keyword that requires the
-- imported module be trusted as according to the Safe Haskell definition
-- of trust.
--
-- <pre>
-- import safe Network.Socket
-- </pre>
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/safe-haskell.html#safe-imports</a></li>
-- </ul>
SafeImports :: KnownExtension
-- | Compile a module in the Safe, Safe Haskell mode -- a restricted form
-- of the Haskell language to ensure type safety.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/safe-haskell.html#safe-trust</a></li>
-- </ul>
Safe :: KnownExtension
-- | Compile a module in the Trustworthy, Safe Haskell mode -- no
-- restrictions apply but the module is marked as trusted as long as the
-- package the module resides in is trusted.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/safe-haskell.html#safe-trust</a></li>
-- </ul>
Trustworthy :: KnownExtension
-- | Compile a module in the Unsafe, Safe Haskell mode so that modules
-- compiled using Safe, Safe Haskell mode can't import it.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/safe-haskell.html#safe-trust</a></li>
-- </ul>
Unsafe :: KnownExtension
-- | Allow type class<i>implicit parameter</i>equality constraints to be
-- used as types with the special kind constraint. Also generalise the
-- <tt>(ctxt => ty)</tt> syntax so that any type of kind constraint
-- can occur before the arrow.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/constraint-kind.html</a></li>
-- </ul>
ConstraintKinds :: KnownExtension
-- | Enable kind polymorphism.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/kind-polymorphism.html</a></li>
-- </ul>
PolyKinds :: KnownExtension
-- | Enable datatype promotion.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/promotion.html</a></li>
-- </ul>
DataKinds :: KnownExtension
-- | Enable parallel arrays syntax (<tt>[:</tt>, <tt>:]</tt>) for <i>Data
-- Parallel Haskell</i>.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/haskellwiki/GHC/Data_Parallel_Haskell</a></li>
-- </ul>
ParallelArrays :: KnownExtension
-- | Enable explicit role annotations, like in (<tt>type role Foo
-- representational representational</tt>).
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/roles.html</a></li>
-- </ul>
RoleAnnotations :: KnownExtension
-- | Enable overloading of list literals, arithmetic sequences and list
-- patterns using the <tt>IsList</tt> type class.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/type-class-extensions.html#overloaded-lists</a></li>
-- </ul>
OverloadedLists :: KnownExtension
-- | Enable case expressions that have no alternatives. Also applies to
-- lambda-case expressions if they are enabled.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#empty-case</a></li>
-- </ul>
EmptyCase :: KnownExtension
-- | Triggers the generation of derived <a>Typeable</a> instances for every
-- datatype and type class declaration.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/deriving.html#auto-derive-typeable</a></li>
-- </ul>
AutoDeriveTypeable :: KnownExtension
-- | Desugars negative literals directly (without using negate).
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#negative-literals</a></li>
-- </ul>
NegativeLiterals :: KnownExtension
-- | Allow the use of binary integer literal syntax (e.g.
-- <tt>0b11001001</tt> to denote <tt>201</tt>).
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#binary-literals</a></li>
-- </ul>
BinaryLiterals :: KnownExtension
-- | Allow the use of floating literal syntax for all instances of
-- <a>Num</a>, including <a>Int</a> and <a>Integer</a>.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#num-decimals</a></li>
-- </ul>
NumDecimals :: KnownExtension
-- | Enable support for type classes with no type parameter.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/type-class-extensions.html#nullary-type-classes</a></li>
-- </ul>
NullaryTypeClasses :: KnownExtension
-- | Enable explicit namespaces in module import/export lists.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#explicit-namespaces</a></li>
-- </ul>
ExplicitNamespaces :: KnownExtension
-- | Allow the user to write ambiguous types, and the type inference engine
-- to infer them.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extensions.html#ambiguity</a></li>
-- </ul>
AllowAmbiguousTypes :: KnownExtension
-- | Enable <tt>foreign import javascript</tt>.
JavaScriptFFI :: KnownExtension
-- | Allow giving names to and abstracting over patterns.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extensions.html#pattern-synonyms</a></li>
-- </ul>
PatternSynonyms :: KnownExtension
-- | Allow anonymous placeholders (underscore) inside type signatures. The
-- type inference engine will generate a message describing the type
-- inferred at the hole's location.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extensions.html#partial-type-signatures</a></li>
-- </ul>
PartialTypeSignatures :: KnownExtension
-- | Allow named placeholders written with a leading underscore inside type
-- signatures. Wildcards with the same name unify to the same type.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extensions.html#named-wildcards</a></li>
-- </ul>
NamedWildCards :: KnownExtension
-- | Enable <tt>deriving</tt> for any class.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extensions.html#derive-any-class</a></li>
-- </ul>
DeriveAnyClass :: KnownExtension
-- | Enable <tt>deriving</tt> for the <a>Lift</a> class.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/deriving.html#deriving-lift</a></li>
-- </ul>
DeriveLift :: KnownExtension
-- | Enable support for 'static pointers' (and the <tt>static</tt> keyword)
-- to refer to globally stable names, even across different programs.
--
-- <ul>
--
-- <li><a>http://www.haskell.org/ghc/docs/latest/html/users_guide/static-pointers.html</a></li>
-- </ul>
StaticPointers :: KnownExtension
-- | Switches data type declarations to be strict by default (as if they
-- had a bang using <tt>BangPatterns</tt>), and allow opt-in field
-- laziness using <tt>~</tt>.
StrictData :: KnownExtension
-- | Switches all pattern bindings to be strict by default (as if they had
-- a bang using <tt>BangPatterns</tt>), ordinary patterns are recovered
-- using <tt>~</tt>. Implies <tt>StrictData</tt>.
Strict :: KnownExtension
-- | Allows <tt>do</tt>-notation for types that are
-- <tt><a>Applicative</a></tt> as well as <tt><a>Monad</a></tt>. When
-- enabled, desugaring <tt>do</tt> notation tries to use
-- <tt>(<a>*</a>)</tt> and <tt><a>fmap</a></tt> and
-- <tt><tt>join</tt></tt> as far as possible.
ApplicativeDo :: KnownExtension
-- | Allow records to use duplicated field labels for accessors.
DuplicateRecordFields :: KnownExtension
-- | Enable explicit type applications with the syntax <tt>id @Int</tt>.
TypeApplications :: KnownExtension
-- | Dissolve the distinction between types and kinds, allowing the
-- compiler to reason about kind equality and therefore enabling GADTs to
-- be promoted to the type-level.
TypeInType :: KnownExtension
-- | Allow recursive (and therefore undecideable) super-class
-- relationships.
UndecidableSuperClasses :: KnownExtension
-- | A temporary extension to help library authors check if their code will
-- compile with the new planned desugaring of fail.
MonadFailDesugaring :: KnownExtension
-- | A subset of <tt>TemplateHaskell</tt> including only quasi-quoting.
TemplateHaskellQuotes :: KnownExtension
-- | Allows use of the <tt>#label</tt> syntax.
OverloadedLabels :: KnownExtension
-- | <i>Deprecated: KnownExtension is an instance of Enum and Bounded, use
-- those instead.</i>
knownExtensions :: [KnownExtension]
-- | Extensions that have been deprecated, possibly paired with another
-- extension that replaces it.
deprecatedExtensions :: [(Extension, Maybe Extension)]
instance Data.Data.Data Language.Haskell.Extension.Extension
instance GHC.Classes.Ord Language.Haskell.Extension.Extension
instance GHC.Classes.Eq Language.Haskell.Extension.Extension
instance GHC.Read.Read Language.Haskell.Extension.Extension
instance GHC.Show.Show Language.Haskell.Extension.Extension
instance GHC.Generics.Generic Language.Haskell.Extension.Extension
instance Data.Data.Data Language.Haskell.Extension.KnownExtension
instance GHC.Enum.Bounded Language.Haskell.Extension.KnownExtension
instance GHC.Enum.Enum Language.Haskell.Extension.KnownExtension
instance GHC.Classes.Ord Language.Haskell.Extension.KnownExtension
instance GHC.Classes.Eq Language.Haskell.Extension.KnownExtension
instance GHC.Read.Read Language.Haskell.Extension.KnownExtension
instance GHC.Show.Show Language.Haskell.Extension.KnownExtension
instance GHC.Generics.Generic Language.Haskell.Extension.KnownExtension
instance Data.Data.Data Language.Haskell.Extension.Language
instance GHC.Classes.Eq Language.Haskell.Extension.Language
instance GHC.Read.Read Language.Haskell.Extension.Language
instance GHC.Show.Show Language.Haskell.Extension.Language
instance GHC.Generics.Generic Language.Haskell.Extension.Language
instance Data.Binary.Class.Binary Language.Haskell.Extension.Language
instance Distribution.Text.Text Language.Haskell.Extension.Language
instance Data.Binary.Class.Binary Language.Haskell.Extension.Extension
instance Data.Binary.Class.Binary Language.Haskell.Extension.KnownExtension
instance Distribution.Text.Text Language.Haskell.Extension.Extension
instance Distribution.Text.Text Language.Haskell.Extension.KnownExtension
-- | This has an enumeration of the various compilers that Cabal knows
-- about. It also specifies the default compiler. Sadly you'll often see
-- code that does case analysis on this compiler flavour enumeration
-- like:
--
-- <pre>
-- case compilerFlavor comp of
-- GHC -> GHC.getInstalledPackages verbosity packageDb progconf
-- JHC -> JHC.getInstalledPackages verbosity packageDb progconf
-- </pre>
--
-- Obviously it would be better to use the proper <tt>Compiler</tt>
-- abstraction because that would keep all the compiler-specific code
-- together. Unfortunately we cannot make this change yet without
-- breaking the <tt>UserHooks</tt> api, which would break all custom
-- <tt>Setup.hs</tt> files, so for the moment we just have to live with
-- this deficiency. If you're interested, see ticket #57.
module Distribution.Compiler
data CompilerFlavor
GHC :: CompilerFlavor
GHCJS :: CompilerFlavor
NHC :: CompilerFlavor
YHC :: CompilerFlavor
Hugs :: CompilerFlavor
HBC :: CompilerFlavor
Helium :: CompilerFlavor
JHC :: CompilerFlavor
LHC :: CompilerFlavor
UHC :: CompilerFlavor
HaskellSuite :: String -> CompilerFlavor
OtherCompiler :: String -> CompilerFlavor
buildCompilerId :: CompilerId
buildCompilerFlavor :: CompilerFlavor
-- | The default compiler flavour to pick when compiling stuff. This
-- defaults to the compiler used to build the Cabal lib.
--
-- However if it's not a recognised compiler then it's <a>Nothing</a> and
-- the user will have to specify which compiler they want.
defaultCompilerFlavor :: Maybe CompilerFlavor
-- | Like <a>classifyCompilerFlavor</a> but compatible with the old ReadS
-- parser.
--
-- It is compatible in the sense that it accepts only the same strings,
-- eg <a>GHC</a> but not "ghc". However other strings get mapped to
-- <a>OtherCompiler</a>. The point of this is that we do not allow extra
-- valid values that would upset older Cabal versions that had a stricter
-- parser however we cope with new values more gracefully so that we'll
-- be able to introduce new value in future without breaking things so
-- much.
parseCompilerFlavorCompat :: ReadP r CompilerFlavor
data CompilerId
CompilerId :: CompilerFlavor -> Version -> CompilerId
-- | Compiler information used for resolving configurations. Some fields
-- can be set to Nothing to indicate that the information is unknown.
data CompilerInfo
CompilerInfo :: CompilerId -> AbiTag -> Maybe [CompilerId] -> Maybe [Language] -> Maybe [Extension] -> CompilerInfo
-- | Compiler flavour and version.
[compilerInfoId] :: CompilerInfo -> CompilerId
-- | Tag for distinguishing incompatible ABI's on the same architecture/os.
[compilerInfoAbiTag] :: CompilerInfo -> AbiTag
-- | Other implementations that this compiler claims to be compatible with,
-- if known.
[compilerInfoCompat] :: CompilerInfo -> Maybe [CompilerId]
-- | Supported language standards, if known.
[compilerInfoLanguages] :: CompilerInfo -> Maybe [Language]
-- | Supported extensions, if known.
[compilerInfoExtensions] :: CompilerInfo -> Maybe [Extension]
-- | Make a CompilerInfo of which only the known information is its
-- CompilerId, its AbiTag and that it does not claim to be compatible
-- with other compiler id's.
unknownCompilerInfo :: CompilerId -> AbiTag -> CompilerInfo
data AbiTag
NoAbiTag :: AbiTag
AbiTag :: String -> AbiTag
abiTagString :: AbiTag -> String
instance GHC.Read.Read Distribution.Compiler.CompilerInfo
instance GHC.Show.Show Distribution.Compiler.CompilerInfo
instance GHC.Generics.Generic Distribution.Compiler.CompilerInfo
instance GHC.Read.Read Distribution.Compiler.AbiTag
instance GHC.Show.Show Distribution.Compiler.AbiTag
instance GHC.Generics.Generic Distribution.Compiler.AbiTag
instance GHC.Classes.Eq Distribution.Compiler.AbiTag
instance GHC.Show.Show Distribution.Compiler.CompilerId
instance GHC.Read.Read Distribution.Compiler.CompilerId
instance GHC.Classes.Ord Distribution.Compiler.CompilerId
instance GHC.Generics.Generic Distribution.Compiler.CompilerId
instance GHC.Classes.Eq Distribution.Compiler.CompilerId
instance Data.Data.Data Distribution.Compiler.CompilerFlavor
instance GHC.Classes.Ord Distribution.Compiler.CompilerFlavor
instance GHC.Classes.Eq Distribution.Compiler.CompilerFlavor
instance GHC.Read.Read Distribution.Compiler.CompilerFlavor
instance GHC.Show.Show Distribution.Compiler.CompilerFlavor
instance GHC.Generics.Generic Distribution.Compiler.CompilerFlavor
instance Data.Binary.Class.Binary Distribution.Compiler.CompilerFlavor
instance Distribution.Text.Text Distribution.Compiler.CompilerFlavor
instance Data.Binary.Class.Binary Distribution.Compiler.CompilerId
instance Distribution.Text.Text Distribution.Compiler.CompilerId
instance Data.Binary.Class.Binary Distribution.Compiler.CompilerInfo
instance Data.Binary.Class.Binary Distribution.Compiler.AbiTag
instance Distribution.Text.Text Distribution.Compiler.AbiTag
-- | This manages everything to do with where files get installed (though
-- does not get involved with actually doing any installation). It
-- provides an <a>InstallDirs</a> type which is a set of directories for
-- where to install things. It also handles the fact that we use
-- templates in these install dirs. For example most install dirs are
-- relative to some <tt>$prefix</tt> and by changing the prefix all other
-- dirs still end up changed appropriately. So it provides a
-- <a>PathTemplate</a> type and functions for substituting for these
-- templates.
module Distribution.Simple.InstallDirs
-- | The directories where we will install files for packages.
--
-- We have several different directories for different types of files
-- since many systems have conventions whereby different types of files
-- in a package are installed in different directories. This is
-- particularly the case on Unix style systems.
data InstallDirs dir
InstallDirs :: dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> InstallDirs dir
[prefix] :: InstallDirs dir -> dir
[bindir] :: InstallDirs dir -> dir
[libdir] :: InstallDirs dir -> dir
[libsubdir] :: InstallDirs dir -> dir
[dynlibdir] :: InstallDirs dir -> dir
[libexecdir] :: InstallDirs dir -> dir
[includedir] :: InstallDirs dir -> dir
[datadir] :: InstallDirs dir -> dir
[datasubdir] :: InstallDirs dir -> dir
[docdir] :: InstallDirs dir -> dir
[mandir] :: InstallDirs dir -> dir
[htmldir] :: InstallDirs dir -> dir
[haddockdir] :: InstallDirs dir -> dir
[sysconfdir] :: InstallDirs dir -> dir
-- | The installation directories in terms of <a>PathTemplate</a>s that
-- contain variables.
--
-- The defaults for most of the directories are relative to each other,
-- in particular they are all relative to a single prefix. This makes it
-- convenient for the user to override the default installation directory
-- by only having to specify --prefix=... rather than overriding each
-- individually. This is done by allowing $-style variables in the dirs.
-- These are expanded by textual substitution (see
-- <a>substPathTemplate</a>).
--
-- A few of these installation directories are split into two components,
-- the dir and subdir. The full installation path is formed by combining
-- the two together with <tt>/</tt>. The reason for this is compatibility
-- with other Unix build systems which also support <tt>--libdir</tt> and
-- <tt>--datadir</tt>. We would like users to be able to configure
-- <tt>--libdir=/usr/lib64</tt> for example but because by default we
-- want to support installing multiple versions of packages and building
-- the same package for multiple compilers we append the libsubdir to
-- get: <tt>/usr/lib64/$libname/$compiler</tt>.
--
-- An additional complication is the need to support relocatable packages
-- on systems which support such things, like Windows.
type InstallDirTemplates = InstallDirs PathTemplate
defaultInstallDirs :: CompilerFlavor -> Bool -> Bool -> IO InstallDirTemplates
combineInstallDirs :: (a -> b -> c) -> InstallDirs a -> InstallDirs b -> InstallDirs c
-- | Convert from abstract install directories to actual absolute ones by
-- substituting for all the variables in the abstract paths, to get real
-- absolute path.
absoluteInstallDirs :: PackageIdentifier -> UnitId -> CompilerInfo -> CopyDest -> Platform -> InstallDirs PathTemplate -> InstallDirs FilePath
-- | The location prefix for the <i>copy</i> command.
data CopyDest
NoCopyDest :: CopyDest
CopyTo :: FilePath -> CopyDest
-- | Check which of the paths are relative to the installation $prefix.
--
-- If any of the paths are not relative, ie they are absolute paths, then
-- it prevents us from making a relocatable package (also known as a
-- "prefix independent" package).
prefixRelativeInstallDirs :: PackageIdentifier -> UnitId -> CompilerInfo -> Platform -> InstallDirTemplates -> InstallDirs (Maybe FilePath)
-- | Substitute the install dir templates into each other.
--
-- To prevent cyclic substitutions, only some variables are allowed in
-- particular dir templates. If out of scope vars are present, they are
-- not substituted for. Checking for any remaining unsubstituted vars can
-- be done as a subsequent operation.
--
-- The reason it is done this way is so that in
-- <a>prefixRelativeInstallDirs</a> we can replace <a>prefix</a> with the
-- <a>PrefixVar</a> and get resulting <a>PathTemplate</a>s that still
-- have the <a>PrefixVar</a> in them. Doing this makes it each to check
-- which paths are relative to the $prefix.
substituteInstallDirTemplates :: PathTemplateEnv -> InstallDirTemplates -> InstallDirTemplates
-- | An abstract path, possibly containing variables that need to be
-- substituted for to get a real <a>FilePath</a>.
data PathTemplate
data PathTemplateVariable
-- | The <tt>$prefix</tt> path variable
PrefixVar :: PathTemplateVariable
-- | The <tt>$bindir</tt> path variable
BindirVar :: PathTemplateVariable
-- | The <tt>$libdir</tt> path variable
LibdirVar :: PathTemplateVariable
-- | The <tt>$libsubdir</tt> path variable
LibsubdirVar :: PathTemplateVariable
-- | The <tt>$dynlibdir</tt> path variable
DynlibdirVar :: PathTemplateVariable
-- | The <tt>$datadir</tt> path variable
DatadirVar :: PathTemplateVariable
-- | The <tt>$datasubdir</tt> path variable
DatasubdirVar :: PathTemplateVariable
-- | The <tt>$docdir</tt> path variable
DocdirVar :: PathTemplateVariable
-- | The <tt>$htmldir</tt> path variable
HtmldirVar :: PathTemplateVariable
-- | The <tt>$pkg</tt> package name path variable
PkgNameVar :: PathTemplateVariable
-- | The <tt>$version</tt> package version path variable
PkgVerVar :: PathTemplateVariable
-- | The <tt>$pkgid</tt> package Id path variable, eg <tt>foo-1.0</tt>
PkgIdVar :: PathTemplateVariable
-- | The <tt>$libname</tt> path variable
LibNameVar :: PathTemplateVariable
-- | The compiler name and version, eg <tt>ghc-6.6.1</tt>
CompilerVar :: PathTemplateVariable
-- | The operating system name, eg <tt>windows</tt> or <tt>linux</tt>
OSVar :: PathTemplateVariable
-- | The CPU architecture name, eg <tt>i386</tt> or <tt>x86_64</tt>
ArchVar :: PathTemplateVariable
-- | The Compiler's ABI identifier, $arch-$os-$compiler-$abitag
AbiVar :: PathTemplateVariable
-- | The optional ABI tag for the compiler
AbiTagVar :: PathTemplateVariable
-- | The executable name; used in shell wrappers
ExecutableNameVar :: PathTemplateVariable
-- | The name of the test suite being run
TestSuiteNameVar :: PathTemplateVariable
-- | The result of the test suite being run, eg <tt>pass</tt>,
-- <tt>fail</tt>, or <tt>error</tt>.
TestSuiteResultVar :: PathTemplateVariable
-- | The name of the benchmark being run
BenchmarkNameVar :: PathTemplateVariable
type PathTemplateEnv = [(PathTemplateVariable, PathTemplate)]
-- | Convert a <a>FilePath</a> to a <a>PathTemplate</a> including any
-- template vars.
toPathTemplate :: FilePath -> PathTemplate
-- | Convert back to a path, any remaining vars are included
fromPathTemplate :: PathTemplate -> FilePath
substPathTemplate :: PathTemplateEnv -> PathTemplate -> PathTemplate
-- | The initial environment has all the static stuff but no paths
initialPathTemplateEnv :: PackageIdentifier -> UnitId -> CompilerInfo -> Platform -> PathTemplateEnv
platformTemplateEnv :: Platform -> PathTemplateEnv
compilerTemplateEnv :: CompilerInfo -> PathTemplateEnv
packageTemplateEnv :: PackageIdentifier -> UnitId -> PathTemplateEnv
abiTemplateEnv :: CompilerInfo -> Platform -> PathTemplateEnv
installDirsTemplateEnv :: InstallDirs PathTemplate -> PathTemplateEnv
instance GHC.Generics.Generic Distribution.Simple.InstallDirs.PathTemplate
instance GHC.Classes.Ord Distribution.Simple.InstallDirs.PathTemplate
instance GHC.Classes.Eq Distribution.Simple.InstallDirs.PathTemplate
instance GHC.Generics.Generic Distribution.Simple.InstallDirs.PathComponent
instance GHC.Classes.Ord Distribution.Simple.InstallDirs.PathComponent
instance GHC.Classes.Eq Distribution.Simple.InstallDirs.PathComponent
instance GHC.Generics.Generic Distribution.Simple.InstallDirs.PathTemplateVariable
instance GHC.Classes.Ord Distribution.Simple.InstallDirs.PathTemplateVariable
instance GHC.Classes.Eq Distribution.Simple.InstallDirs.PathTemplateVariable
instance GHC.Show.Show Distribution.Simple.InstallDirs.CopyDest
instance GHC.Classes.Eq Distribution.Simple.InstallDirs.CopyDest
instance GHC.Generics.Generic (Distribution.Simple.InstallDirs.InstallDirs dir)
instance GHC.Base.Functor Distribution.Simple.InstallDirs.InstallDirs
instance GHC.Show.Show dir => GHC.Show.Show (Distribution.Simple.InstallDirs.InstallDirs dir)
instance GHC.Read.Read dir => GHC.Read.Read (Distribution.Simple.InstallDirs.InstallDirs dir)
instance GHC.Classes.Eq dir => GHC.Classes.Eq (Distribution.Simple.InstallDirs.InstallDirs dir)
instance Data.Binary.Class.Binary dir => Data.Binary.Class.Binary (Distribution.Simple.InstallDirs.InstallDirs dir)
instance (Data.Semigroup.Semigroup dir, GHC.Base.Monoid dir) => GHC.Base.Monoid (Distribution.Simple.InstallDirs.InstallDirs dir)
instance Data.Semigroup.Semigroup dir => Data.Semigroup.Semigroup (Distribution.Simple.InstallDirs.InstallDirs dir)
instance Data.Binary.Class.Binary Distribution.Simple.InstallDirs.PathTemplate
instance Data.Binary.Class.Binary Distribution.Simple.InstallDirs.PathComponent
instance Data.Binary.Class.Binary Distribution.Simple.InstallDirs.PathTemplateVariable
instance GHC.Show.Show Distribution.Simple.InstallDirs.PathTemplateVariable
instance GHC.Read.Read Distribution.Simple.InstallDirs.PathTemplateVariable
instance GHC.Show.Show Distribution.Simple.InstallDirs.PathComponent
instance GHC.Read.Read Distribution.Simple.InstallDirs.PathComponent
instance GHC.Show.Show Distribution.Simple.InstallDirs.PathTemplate
instance GHC.Read.Read Distribution.Simple.InstallDirs.PathTemplate
-- | This defines the data structure for the <tt>.cabal</tt> file format.
-- There are several parts to this structure. It has top level info and
-- then <a>Library</a>, <a>Executable</a>, <a>TestSuite</a>, and
-- <a>Benchmark</a> sections each of which have associated
-- <a>BuildInfo</a> data that's used to build the library, exe, test, or
-- benchmark. To further complicate things there is both a
-- <a>PackageDescription</a> and a <a>GenericPackageDescription</a>. This
-- distinction relates to cabal configurations. When we initially read a
-- <tt>.cabal</tt> file we get a <a>GenericPackageDescription</a> which
-- has all the conditional sections. Before actually building a package
-- we have to decide on each conditional. Once we've done that we get a
-- <a>PackageDescription</a>. It was done this way initially to avoid
-- breaking too much stuff when the feature was introduced. It could
-- probably do with being rationalised at some point to make it simpler.
module Distribution.PackageDescription
-- | This data type is the internal representation of the file
-- <tt>pkg.cabal</tt>. It contains two kinds of information about the
-- package: information which is needed for all packages, such as the
-- package name and version, and information which is needed for the
-- simple build system only, such as the compiler options and library
-- name.
data PackageDescription
PackageDescription :: PackageIdentifier -> License -> [FilePath] -> String -> String -> String -> String -> [(CompilerFlavor, VersionRange)] -> String -> String -> String -> [SourceRepo] -> String -> String -> String -> [(String, String)] -> [Dependency] -> Either Version VersionRange -> Maybe BuildType -> Maybe SetupBuildInfo -> Maybe Library -> [Executable] -> [TestSuite] -> [Benchmark] -> [FilePath] -> FilePath -> [FilePath] -> [FilePath] -> [FilePath] -> PackageDescription
[package] :: PackageDescription -> PackageIdentifier
[license] :: PackageDescription -> License
[licenseFiles] :: PackageDescription -> [FilePath]
[copyright] :: PackageDescription -> String
[maintainer] :: PackageDescription -> String
[author] :: PackageDescription -> String
[stability] :: PackageDescription -> String
[testedWith] :: PackageDescription -> [(CompilerFlavor, VersionRange)]
[homepage] :: PackageDescription -> String
[pkgUrl] :: PackageDescription -> String
[bugReports] :: PackageDescription -> String
[sourceRepos] :: PackageDescription -> [SourceRepo]
-- | A one-line summary of this package
[synopsis] :: PackageDescription -> String
-- | A more verbose description of this package
[description] :: PackageDescription -> String
[category] :: PackageDescription -> String
-- | Custom fields starting with x-, stored in a simple assoc-list.
[customFieldsPD] :: PackageDescription -> [(String, String)]
-- | YOU PROBABLY DON'T WANT TO USE THIS FIELD. This field is special!
-- Depending on how far along processing the PackageDescription we are,
-- the contents of this field are either nonsense, or the collected
-- dependencies of *all* the components in this package. buildDepends is
-- initialized by <tt>finalizePackageDescription</tt> and
-- <tt>flattenPackageDescription</tt>; prior to that, dependency info is
-- stored in the <a>CondTree</a> built around a
-- <a>GenericPackageDescription</a>. When this resolution is done,
-- dependency info is written to the inner <a>BuildInfo</a> and this
-- field. This is all horrible, and #2066 tracks progress to get rid of
-- this field.
[buildDepends] :: PackageDescription -> [Dependency]
-- | The version of the Cabal spec that this package description uses. For
-- historical reasons this is specified with a version range but only
-- ranges of the form <tt>>= v</tt> make sense. We are in the process
-- of transitioning to specifying just a single version, not a range.
[specVersionRaw] :: PackageDescription -> Either Version VersionRange
[buildType] :: PackageDescription -> Maybe BuildType
[setupBuildInfo] :: PackageDescription -> Maybe SetupBuildInfo
[library] :: PackageDescription -> Maybe Library
[executables] :: PackageDescription -> [Executable]
[testSuites] :: PackageDescription -> [TestSuite]
[benchmarks] :: PackageDescription -> [Benchmark]
[dataFiles] :: PackageDescription -> [FilePath]
[dataDir] :: PackageDescription -> FilePath
[extraSrcFiles] :: PackageDescription -> [FilePath]
[extraTmpFiles] :: PackageDescription -> [FilePath]
[extraDocFiles] :: PackageDescription -> [FilePath]
emptyPackageDescription :: PackageDescription
-- | The version of the Cabal spec that this package should be interpreted
-- against.
--
-- Historically we used a version range but we are switching to using a
-- single version. Currently we accept either. This function converts
-- into a single version by ignoring upper bounds in the version range.
specVersion :: PackageDescription -> Version
-- | The range of versions of the Cabal tools that this package is intended
-- to work with.
--
-- This function is deprecated and should not be used for new purposes,
-- only to support old packages that rely on the old interpretation.
-- | <i>Deprecated: Use specVersion instead</i>
descCabalVersion :: PackageDescription -> VersionRange
-- | The type of build system used by this package.
data BuildType
-- | calls <tt>Distribution.Simple.defaultMain</tt>
Simple :: BuildType
-- | calls <tt>Distribution.Simple.defaultMainWithHooks
-- defaultUserHooks</tt>, which invokes <tt>configure</tt> to generate
-- additional build information used by later phases.
Configure :: BuildType
-- | calls <tt>Distribution.Make.defaultMain</tt>
Make :: BuildType
-- | uses user-supplied <tt>Setup.hs</tt> or <tt>Setup.lhs</tt> (default)
Custom :: BuildType
-- | a package that uses an unknown build type cannot actually be built.
-- Doing it this way rather than just giving a parse error means we get
-- better error messages and allows you to inspect the rest of the
-- package description.
UnknownBuildType :: String -> BuildType
knownBuildTypes :: [BuildType]
-- | Renaming applied to the modules provided by a package. The boolean
-- indicates whether or not to also include all of the original names of
-- modules. Thus, <tt>ModuleRenaming False []</tt> is "don't expose any
-- modules, and <tt>ModuleRenaming True [(<a>Data.Bool</a>,
-- <a>Bool</a>)]</tt> is, "expose all modules, but also expose
-- <tt>Data.Bool</tt> as <tt>Bool</tt>".
data ModuleRenaming
ModuleRenaming :: Bool -> [(ModuleName, ModuleName)] -> ModuleRenaming
defaultRenaming :: ModuleRenaming
lookupRenaming :: Package pkg => pkg -> Map PackageName ModuleRenaming -> ModuleRenaming
data Library
Library :: [ModuleName] -> [ModuleReexport] -> [ModuleName] -> [ModuleName] -> Bool -> BuildInfo -> Library
[exposedModules] :: Library -> [ModuleName]
[reexportedModules] :: Library -> [ModuleReexport]
-- | What sigs need implementations?
[requiredSignatures] :: Library -> [ModuleName]
-- | What sigs are visible to users?
[exposedSignatures] :: Library -> [ModuleName]
-- | Is the lib to be exposed by default?
[libExposed] :: Library -> Bool
[libBuildInfo] :: Library -> BuildInfo
data ModuleReexport
ModuleReexport :: Maybe PackageName -> ModuleName -> ModuleName -> ModuleReexport
[moduleReexportOriginalPackage] :: ModuleReexport -> Maybe PackageName
[moduleReexportOriginalName] :: ModuleReexport -> ModuleName
[moduleReexportName] :: ModuleReexport -> ModuleName
emptyLibrary :: Library
-- | If the package description has a library section, call the given
-- function with the library build info as argument.
withLib :: PackageDescription -> (Library -> IO ()) -> IO ()
-- | does this package have any libraries?
hasLibs :: PackageDescription -> Bool
-- | Get all the module names from the library (exposed and internal
-- modules) which need to be compiled. (This does not include reexports,
-- which do not need to be compiled.)
libModules :: Library -> [ModuleName]
data Executable
Executable :: String -> FilePath -> BuildInfo -> Executable
[exeName] :: Executable -> String
[modulePath] :: Executable -> FilePath
[buildInfo] :: Executable -> BuildInfo
emptyExecutable :: Executable
-- | Perform the action on each buildable <a>Executable</a> in the package
-- description.
withExe :: PackageDescription -> (Executable -> IO ()) -> IO ()
-- | does this package have any executables?
hasExes :: PackageDescription -> Bool
-- | Get all the module names from an exe
exeModules :: Executable -> [ModuleName]
-- | A "test-suite" stanza in a cabal file.
data TestSuite
TestSuite :: String -> TestSuiteInterface -> BuildInfo -> Bool -> TestSuite
[testName] :: TestSuite -> String
[testInterface] :: TestSuite -> TestSuiteInterface
[testBuildInfo] :: TestSuite -> BuildInfo
[testEnabled] :: TestSuite -> Bool
-- | The test suite interfaces that are currently defined. Each test suite
-- must specify which interface it supports.
--
-- More interfaces may be defined in future, either new revisions or
-- totally new interfaces.
data TestSuiteInterface
-- | Test interface "exitcode-stdio-1.0". The test-suite takes the form of
-- an executable. It returns a zero exit code for success, non-zero for
-- failure. The stdout and stderr channels may be logged. It takes no
-- command line parameters and nothing on stdin.
TestSuiteExeV10 :: Version -> FilePath -> TestSuiteInterface
-- | Test interface "detailed-0.9". The test-suite takes the form of a
-- library containing a designated module that exports "tests :: [Test]".
TestSuiteLibV09 :: Version -> ModuleName -> TestSuiteInterface
-- | A test suite that does not conform to one of the above interfaces for
-- the given reason (e.g. unknown test type).
TestSuiteUnsupported :: TestType -> TestSuiteInterface
-- | The "test-type" field in the test suite stanza.
data TestType
-- | "type: exitcode-stdio-x.y"
TestTypeExe :: Version -> TestType
-- | "type: detailed-x.y"
TestTypeLib :: Version -> TestType
-- | Some unknown test type e.g. "type: foo"
TestTypeUnknown :: String -> Version -> TestType
testType :: TestSuite -> TestType
knownTestTypes :: [TestType]
emptyTestSuite :: TestSuite
-- | Does this package have any test suites?
hasTests :: PackageDescription -> Bool
-- | Perform an action on each buildable <a>TestSuite</a> in a package.
withTest :: PackageDescription -> (TestSuite -> IO ()) -> IO ()
-- | Get all the module names from a test suite.
testModules :: TestSuite -> [ModuleName]
-- | Get all the enabled test suites from a package.
enabledTests :: PackageDescription -> [TestSuite]
-- | A "benchmark" stanza in a cabal file.
data Benchmark
Benchmark :: String -> BenchmarkInterface -> BuildInfo -> Bool -> Benchmark
[benchmarkName] :: Benchmark -> String
[benchmarkInterface] :: Benchmark -> BenchmarkInterface
[benchmarkBuildInfo] :: Benchmark -> BuildInfo
[benchmarkEnabled] :: Benchmark -> Bool
-- | The benchmark interfaces that are currently defined. Each benchmark
-- must specify which interface it supports.
--
-- More interfaces may be defined in future, either new revisions or
-- totally new interfaces.
data BenchmarkInterface
-- | Benchmark interface "exitcode-stdio-1.0". The benchmark takes the form
-- of an executable. It returns a zero exit code for success, non-zero
-- for failure. The stdout and stderr channels may be logged. It takes no
-- command line parameters and nothing on stdin.
BenchmarkExeV10 :: Version -> FilePath -> BenchmarkInterface
-- | A benchmark that does not conform to one of the above interfaces for
-- the given reason (e.g. unknown benchmark type).
BenchmarkUnsupported :: BenchmarkType -> BenchmarkInterface
-- | The "benchmark-type" field in the benchmark stanza.
data BenchmarkType
-- | "type: exitcode-stdio-x.y"
BenchmarkTypeExe :: Version -> BenchmarkType
-- | Some unknown benchmark type e.g. "type: foo"
BenchmarkTypeUnknown :: String -> Version -> BenchmarkType
benchmarkType :: Benchmark -> BenchmarkType
knownBenchmarkTypes :: [BenchmarkType]
emptyBenchmark :: Benchmark
-- | Does this package have any benchmarks?
hasBenchmarks :: PackageDescription -> Bool
-- | Perform an action on each buildable <a>Benchmark</a> in a package.
withBenchmark :: PackageDescription -> (Benchmark -> IO ()) -> IO ()
-- | Get all the module names from a benchmark.
benchmarkModules :: Benchmark -> [ModuleName]
-- | Get all the enabled benchmarks from a package.
enabledBenchmarks :: PackageDescription -> [Benchmark]
data BuildInfo
BuildInfo :: Bool -> [Dependency] -> [String] -> [String] -> [String] -> [Dependency] -> [String] -> [String] -> [FilePath] -> [FilePath] -> [FilePath] -> [ModuleName] -> Maybe Language -> [Language] -> [Extension] -> [Extension] -> [Extension] -> [String] -> [String] -> [String] -> [FilePath] -> [FilePath] -> [FilePath] -> [(CompilerFlavor, [String])] -> [(CompilerFlavor, [String])] -> [(CompilerFlavor, [String])] -> [(String, String)] -> [Dependency] -> Map PackageName ModuleRenaming -> BuildInfo
-- | component is buildable here
[buildable] :: BuildInfo -> Bool
-- | tools needed to build this bit
[buildTools] :: BuildInfo -> [Dependency]
-- | options for pre-processing Haskell code
[cppOptions] :: BuildInfo -> [String]
-- | options for C compiler
[ccOptions] :: BuildInfo -> [String]
-- | options for linker
[ldOptions] :: BuildInfo -> [String]
-- | pkg-config packages that are used
[pkgconfigDepends] :: BuildInfo -> [Dependency]
-- | support frameworks for Mac OS X
[frameworks] :: BuildInfo -> [String]
-- | extra locations to find frameworks.
[extraFrameworkDirs] :: BuildInfo -> [String]
[cSources] :: BuildInfo -> [FilePath]
[jsSources] :: BuildInfo -> [FilePath]
-- | where to look for the Haskell module hierarchy
[hsSourceDirs] :: BuildInfo -> [FilePath]
-- | non-exposed or non-main modules
[otherModules] :: BuildInfo -> [ModuleName]
-- | language used when not explicitly specified
[defaultLanguage] :: BuildInfo -> Maybe Language
-- | other languages used within the package
[otherLanguages] :: BuildInfo -> [Language]
-- | language extensions used by all modules
[defaultExtensions] :: BuildInfo -> [Extension]
-- | other language extensions used within the package
[otherExtensions] :: BuildInfo -> [Extension]
-- | the old extensions field, treated same as <a>defaultExtensions</a>
[oldExtensions] :: BuildInfo -> [Extension]
-- | what libraries to link with when compiling a program that uses your
-- package
[extraLibs] :: BuildInfo -> [String]
-- | if present, overrides extraLibs when package is loaded with GHCi.
[extraGHCiLibs] :: BuildInfo -> [String]
[extraLibDirs] :: BuildInfo -> [String]
-- | directories to find .h files
[includeDirs] :: BuildInfo -> [FilePath]
-- | The .h files to be found in includeDirs
[includes] :: BuildInfo -> [FilePath]
-- | .h files to install with the package
[installIncludes] :: BuildInfo -> [FilePath]
[options] :: BuildInfo -> [(CompilerFlavor, [String])]
[profOptions] :: BuildInfo -> [(CompilerFlavor, [String])]
[sharedOptions] :: BuildInfo -> [(CompilerFlavor, [String])]
-- | Custom fields starting with x-, stored in a simple assoc-list.
[customFieldsBI] :: BuildInfo -> [(String, String)]
-- | Dependencies specific to a library or executable target
[targetBuildDepends] :: BuildInfo -> [Dependency]
[targetBuildRenaming] :: BuildInfo -> Map PackageName ModuleRenaming
emptyBuildInfo :: BuildInfo
-- | The <a>BuildInfo</a> for the library (if there is one and it's
-- buildable), and all buildable executables, test suites and benchmarks.
-- Useful for gathering dependencies.
allBuildInfo :: PackageDescription -> [BuildInfo]
-- | The <a>Language</a>s used by this component
allLanguages :: BuildInfo -> [Language]
-- | The <a>Extension</a>s that are used somewhere by this component
allExtensions :: BuildInfo -> [Extension]
-- | The <tt>Extensions</tt> that are used by all modules in this component
usedExtensions :: BuildInfo -> [Extension]
-- | Select options for a particular Haskell compiler.
hcOptions :: CompilerFlavor -> BuildInfo -> [String]
hcProfOptions :: CompilerFlavor -> BuildInfo -> [String]
hcSharedOptions :: CompilerFlavor -> BuildInfo -> [String]
type HookedBuildInfo = (Maybe BuildInfo, [(String, BuildInfo)])
emptyHookedBuildInfo :: HookedBuildInfo
updatePackageDescription :: HookedBuildInfo -> PackageDescription -> PackageDescription
data GenericPackageDescription
GenericPackageDescription :: PackageDescription -> [Flag] -> Maybe (CondTree ConfVar [Dependency] Library) -> [(String, CondTree ConfVar [Dependency] Executable)] -> [(String, CondTree ConfVar [Dependency] TestSuite)] -> [(String, CondTree ConfVar [Dependency] Benchmark)] -> GenericPackageDescription
[packageDescription] :: GenericPackageDescription -> PackageDescription
[genPackageFlags] :: GenericPackageDescription -> [Flag]
[condLibrary] :: GenericPackageDescription -> Maybe (CondTree ConfVar [Dependency] Library)
[condExecutables] :: GenericPackageDescription -> [(String, CondTree ConfVar [Dependency] Executable)]
[condTestSuites] :: GenericPackageDescription -> [(String, CondTree ConfVar [Dependency] TestSuite)]
[condBenchmarks] :: GenericPackageDescription -> [(String, CondTree ConfVar [Dependency] Benchmark)]
-- | A flag can represent a feature to be included, or a way of linking a
-- target against its dependencies, or in fact whatever you can think of.
data Flag
MkFlag :: FlagName -> String -> Bool -> Bool -> Flag
[flagName] :: Flag -> FlagName
[flagDescription] :: Flag -> String
[flagDefault] :: Flag -> Bool
[flagManual] :: Flag -> Bool
-- | A <a>FlagName</a> is the name of a user-defined configuration flag
newtype FlagName
FlagName :: String -> FlagName
-- | A <a>FlagAssignment</a> is a total or partial mapping of
-- <a>FlagName</a>s to <a>Bool</a> flag values. It represents the flags
-- chosen by the user or discovered during configuration. For example
-- <tt>--flags=foo --flags=-bar</tt> becomes <tt>[("foo", True), ("bar",
-- False)]</tt>
type FlagAssignment = [(FlagName, Bool)]
data CondTree v c a
CondNode :: a -> c -> [(Condition v, CondTree v c a, Maybe (CondTree v c a))] -> CondTree v c a
[condTreeData] :: CondTree v c a -> a
[condTreeConstraints] :: CondTree v c a -> c
[condTreeComponents] :: CondTree v c a -> [(Condition v, CondTree v c a, Maybe (CondTree v c a))]
-- | A <tt>ConfVar</tt> represents the variable type used.
data ConfVar
OS :: OS -> ConfVar
Arch :: Arch -> ConfVar
Flag :: FlagName -> ConfVar
Impl :: CompilerFlavor -> VersionRange -> ConfVar
-- | A boolean expression parameterized over the variable type used.
data Condition c
Var :: c -> Condition c
Lit :: Bool -> Condition c
CNot :: (Condition c) -> Condition c
COr :: (Condition c) -> (Condition c) -> Condition c
CAnd :: (Condition c) -> (Condition c) -> Condition c
-- | Boolean negation of a <a>Condition</a> value.
cNot :: Condition a -> Condition a
-- | Boolean AND of two <tt>Condtion</tt> values.
cAnd :: Condition a -> Condition a -> Condition a
-- | Boolean OR of two <a>Condition</a> values.
cOr :: Eq v => Condition v -> Condition v -> Condition v
-- | Information about the source revision control system for a package.
--
-- When specifying a repo it is useful to know the meaning or intention
-- of the information as doing so enables automation. There are two
-- obvious common purposes: one is to find the repo for the latest
-- development version, the other is to find the repo for this specific
-- release. The <tt>ReopKind</tt> specifies which one we mean (or another
-- custom one).
--
-- A package can specify one or the other kind or both. Most will specify
-- just a head repo but some may want to specify a repo to reconstruct
-- the sources for this package release.
--
-- The required information is the <a>RepoType</a> which tells us if it's
-- using <a>Darcs</a>, <a>Git</a> for example. The <a>repoLocation</a>
-- and other details are interpreted according to the repo type.
data SourceRepo
SourceRepo :: RepoKind -> Maybe RepoType -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe FilePath -> SourceRepo
-- | The kind of repo. This field is required.
[repoKind] :: SourceRepo -> RepoKind
-- | The type of the source repository system for this repo, eg
-- <a>Darcs</a> or <a>Git</a>. This field is required.
[repoType] :: SourceRepo -> Maybe RepoType
-- | The location of the repository. For most <a>RepoType</a>s this is a
-- URL. This field is required.
[repoLocation] :: SourceRepo -> Maybe String
-- | <a>CVS</a> can put multiple "modules" on one server and requires a
-- module name in addition to the location to identify a particular repo.
-- Logically this is part of the location but unfortunately has to be
-- specified separately. This field is required for the <a>CVS</a>
-- <a>RepoType</a> and should not be given otherwise.
[repoModule] :: SourceRepo -> Maybe String
-- | The name or identifier of the branch, if any. Many source control
-- systems have the notion of multiple branches in a repo that exist in
-- the same location. For example <a>Git</a> and <a>CVS</a> use this
-- while systems like <a>Darcs</a> use different locations for different
-- branches. This field is optional but should be used if necessary to
-- identify the sources, especially for the <a>RepoThis</a> repo kind.
[repoBranch] :: SourceRepo -> Maybe String
-- | The tag identify a particular state of the repository. This should be
-- given for the <a>RepoThis</a> repo kind and not for <a>RepoHead</a>
-- kind.
[repoTag] :: SourceRepo -> Maybe String
-- | Some repositories contain multiple projects in different
-- subdirectories This field specifies the subdirectory where this
-- packages sources can be found, eg the subdirectory containing the
-- <tt>.cabal</tt> file. It is interpreted relative to the root of the
-- repository. This field is optional. If not given the default is "." ie
-- no subdirectory.
[repoSubdir] :: SourceRepo -> Maybe FilePath
-- | What this repo info is for, what it represents.
data RepoKind
-- | The repository for the "head" or development version of the project.
-- This repo is where we should track the latest development activity or
-- the usual repo people should get to contribute patches.
RepoHead :: RepoKind
-- | The repository containing the sources for this exact package version
-- or release. For this kind of repo a tag should be given to give enough
-- information to re-create the exact sources.
RepoThis :: RepoKind
RepoKindUnknown :: String -> RepoKind
-- | An enumeration of common source control systems. The fields used in
-- the <a>SourceRepo</a> depend on the type of repo. The tools and
-- methods used to obtain and track the repo depend on the repo type.
data RepoType
Darcs :: RepoType
Git :: RepoType
SVN :: RepoType
CVS :: RepoType
Mercurial :: RepoType
GnuArch :: RepoType
Bazaar :: RepoType
Monotone :: RepoType
OtherRepoType :: String -> RepoType
knownRepoTypes :: [RepoType]
data SetupBuildInfo
SetupBuildInfo :: [Dependency] -> Bool -> SetupBuildInfo
[setupDepends] :: SetupBuildInfo -> [Dependency]
-- | Is this a default 'custom-setup' section added by the cabal-install
-- code (as opposed to user-provided)? This field is only used
-- internally, and doesn't correspond to anything in the .cabal file. See
-- #3199.
[defaultSetupDepends] :: SetupBuildInfo -> Bool
instance GHC.Generics.Generic Distribution.PackageDescription.GenericPackageDescription
instance Data.Data.Data Distribution.PackageDescription.GenericPackageDescription
instance GHC.Classes.Eq Distribution.PackageDescription.GenericPackageDescription
instance GHC.Show.Show Distribution.PackageDescription.GenericPackageDescription
instance GHC.Generics.Generic (Distribution.PackageDescription.CondTree v c a)
instance (Data.Data.Data v, Data.Data.Data c, Data.Data.Data a) => Data.Data.Data (Distribution.PackageDescription.CondTree v c a)
instance (GHC.Classes.Eq v, GHC.Classes.Eq c, GHC.Classes.Eq a) => GHC.Classes.Eq (Distribution.PackageDescription.CondTree v c a)
instance (GHC.Show.Show v, GHC.Show.Show c, GHC.Show.Show a) => GHC.Show.Show (Distribution.PackageDescription.CondTree v c a)
instance GHC.Generics.Generic (Distribution.PackageDescription.Condition c)
instance Data.Data.Data c => Data.Data.Data (Distribution.PackageDescription.Condition c)
instance GHC.Classes.Eq c => GHC.Classes.Eq (Distribution.PackageDescription.Condition c)
instance GHC.Show.Show c => GHC.Show.Show (Distribution.PackageDescription.Condition c)
instance GHC.Generics.Generic Distribution.PackageDescription.ConfVar
instance Data.Data.Data Distribution.PackageDescription.ConfVar
instance GHC.Show.Show Distribution.PackageDescription.ConfVar
instance GHC.Classes.Eq Distribution.PackageDescription.ConfVar
instance GHC.Generics.Generic Distribution.PackageDescription.Flag
instance Data.Data.Data Distribution.PackageDescription.Flag
instance GHC.Classes.Eq Distribution.PackageDescription.Flag
instance GHC.Show.Show Distribution.PackageDescription.Flag
instance Data.Data.Data Distribution.PackageDescription.FlagName
instance GHC.Read.Read Distribution.PackageDescription.FlagName
instance GHC.Show.Show Distribution.PackageDescription.FlagName
instance GHC.Classes.Ord Distribution.PackageDescription.FlagName
instance GHC.Generics.Generic Distribution.PackageDescription.FlagName
instance GHC.Classes.Eq Distribution.PackageDescription.FlagName
instance Data.Data.Data Distribution.PackageDescription.PackageDescription
instance GHC.Classes.Eq Distribution.PackageDescription.PackageDescription
instance GHC.Read.Read Distribution.PackageDescription.PackageDescription
instance GHC.Show.Show Distribution.PackageDescription.PackageDescription
instance GHC.Generics.Generic Distribution.PackageDescription.PackageDescription
instance Data.Data.Data Distribution.PackageDescription.SourceRepo
instance GHC.Show.Show Distribution.PackageDescription.SourceRepo
instance GHC.Read.Read Distribution.PackageDescription.SourceRepo
instance GHC.Generics.Generic Distribution.PackageDescription.SourceRepo
instance GHC.Classes.Eq Distribution.PackageDescription.SourceRepo
instance Data.Data.Data Distribution.PackageDescription.RepoType
instance GHC.Show.Show Distribution.PackageDescription.RepoType
instance GHC.Read.Read Distribution.PackageDescription.RepoType
instance GHC.Classes.Ord Distribution.PackageDescription.RepoType
instance GHC.Generics.Generic Distribution.PackageDescription.RepoType
instance GHC.Classes.Eq Distribution.PackageDescription.RepoType
instance Data.Data.Data Distribution.PackageDescription.RepoKind
instance GHC.Show.Show Distribution.PackageDescription.RepoKind
instance GHC.Read.Read Distribution.PackageDescription.RepoKind
instance GHC.Classes.Ord Distribution.PackageDescription.RepoKind
instance GHC.Generics.Generic Distribution.PackageDescription.RepoKind
instance GHC.Classes.Eq Distribution.PackageDescription.RepoKind
instance Data.Data.Data Distribution.PackageDescription.Library
instance GHC.Read.Read Distribution.PackageDescription.Library
instance GHC.Classes.Eq Distribution.PackageDescription.Library
instance GHC.Show.Show Distribution.PackageDescription.Library
instance GHC.Generics.Generic Distribution.PackageDescription.Library
instance Data.Data.Data Distribution.PackageDescription.Executable
instance GHC.Classes.Eq Distribution.PackageDescription.Executable
instance GHC.Read.Read Distribution.PackageDescription.Executable
instance GHC.Show.Show Distribution.PackageDescription.Executable
instance GHC.Generics.Generic Distribution.PackageDescription.Executable
instance Data.Data.Data Distribution.PackageDescription.TestSuite
instance GHC.Classes.Eq Distribution.PackageDescription.TestSuite
instance GHC.Read.Read Distribution.PackageDescription.TestSuite
instance GHC.Show.Show Distribution.PackageDescription.TestSuite
instance GHC.Generics.Generic Distribution.PackageDescription.TestSuite
instance Data.Data.Data Distribution.PackageDescription.Benchmark
instance GHC.Classes.Eq Distribution.PackageDescription.Benchmark
instance GHC.Read.Read Distribution.PackageDescription.Benchmark
instance GHC.Show.Show Distribution.PackageDescription.Benchmark
instance GHC.Generics.Generic Distribution.PackageDescription.Benchmark
instance Data.Data.Data Distribution.PackageDescription.BuildInfo
instance GHC.Classes.Eq Distribution.PackageDescription.BuildInfo
instance GHC.Read.Read Distribution.PackageDescription.BuildInfo
instance GHC.Show.Show Distribution.PackageDescription.BuildInfo
instance GHC.Generics.Generic Distribution.PackageDescription.BuildInfo
instance Data.Data.Data Distribution.PackageDescription.BenchmarkInterface
instance GHC.Show.Show Distribution.PackageDescription.BenchmarkInterface
instance GHC.Read.Read Distribution.PackageDescription.BenchmarkInterface
instance GHC.Generics.Generic Distribution.PackageDescription.BenchmarkInterface
instance GHC.Classes.Eq Distribution.PackageDescription.BenchmarkInterface
instance Data.Data.Data Distribution.PackageDescription.BenchmarkType
instance GHC.Classes.Eq Distribution.PackageDescription.BenchmarkType
instance GHC.Read.Read Distribution.PackageDescription.BenchmarkType
instance GHC.Show.Show Distribution.PackageDescription.BenchmarkType
instance GHC.Generics.Generic Distribution.PackageDescription.BenchmarkType
instance Data.Data.Data Distribution.PackageDescription.TestSuiteInterface
instance GHC.Show.Show Distribution.PackageDescription.TestSuiteInterface
instance GHC.Read.Read Distribution.PackageDescription.TestSuiteInterface
instance GHC.Generics.Generic Distribution.PackageDescription.TestSuiteInterface
instance GHC.Classes.Eq Distribution.PackageDescription.TestSuiteInterface
instance Data.Data.Data Distribution.PackageDescription.TestType
instance GHC.Classes.Eq Distribution.PackageDescription.TestType
instance GHC.Read.Read Distribution.PackageDescription.TestType
instance GHC.Show.Show Distribution.PackageDescription.TestType
instance GHC.Generics.Generic Distribution.PackageDescription.TestType
instance Data.Data.Data Distribution.PackageDescription.ModuleReexport
instance GHC.Show.Show Distribution.PackageDescription.ModuleReexport
instance GHC.Read.Read Distribution.PackageDescription.ModuleReexport
instance GHC.Generics.Generic Distribution.PackageDescription.ModuleReexport
instance GHC.Classes.Eq Distribution.PackageDescription.ModuleReexport
instance GHC.Generics.Generic Distribution.PackageDescription.ModuleRenaming
instance Data.Data.Data Distribution.PackageDescription.ModuleRenaming
instance GHC.Classes.Ord Distribution.PackageDescription.ModuleRenaming
instance GHC.Classes.Eq Distribution.PackageDescription.ModuleRenaming
instance GHC.Read.Read Distribution.PackageDescription.ModuleRenaming
instance GHC.Show.Show Distribution.PackageDescription.ModuleRenaming
instance Data.Data.Data Distribution.PackageDescription.SetupBuildInfo
instance GHC.Read.Read Distribution.PackageDescription.SetupBuildInfo
instance GHC.Classes.Eq Distribution.PackageDescription.SetupBuildInfo
instance GHC.Show.Show Distribution.PackageDescription.SetupBuildInfo
instance GHC.Generics.Generic Distribution.PackageDescription.SetupBuildInfo
instance Data.Data.Data Distribution.PackageDescription.BuildType
instance GHC.Classes.Eq Distribution.PackageDescription.BuildType
instance GHC.Read.Read Distribution.PackageDescription.BuildType
instance GHC.Show.Show Distribution.PackageDescription.BuildType
instance GHC.Generics.Generic Distribution.PackageDescription.BuildType
instance Data.Binary.Class.Binary Distribution.PackageDescription.PackageDescription
instance Distribution.Package.Package Distribution.PackageDescription.PackageDescription
instance Data.Binary.Class.Binary Distribution.PackageDescription.BuildType
instance Distribution.Text.Text Distribution.PackageDescription.BuildType
instance Data.Binary.Class.Binary Distribution.PackageDescription.SetupBuildInfo
instance GHC.Base.Monoid Distribution.PackageDescription.SetupBuildInfo
instance Data.Semigroup.Semigroup Distribution.PackageDescription.SetupBuildInfo
instance Data.Binary.Class.Binary Distribution.PackageDescription.ModuleRenaming
instance GHC.Base.Monoid Distribution.PackageDescription.ModuleRenaming
instance Data.Semigroup.Semigroup Distribution.PackageDescription.ModuleRenaming
instance Distribution.Text.Text Distribution.PackageDescription.ModuleRenaming
instance Data.Binary.Class.Binary Distribution.PackageDescription.Library
instance GHC.Base.Monoid Distribution.PackageDescription.Library
instance Data.Semigroup.Semigroup Distribution.PackageDescription.Library
instance Data.Binary.Class.Binary Distribution.PackageDescription.ModuleReexport
instance Distribution.Text.Text Distribution.PackageDescription.ModuleReexport
instance Data.Binary.Class.Binary Distribution.PackageDescription.Executable
instance GHC.Base.Monoid Distribution.PackageDescription.Executable
instance Data.Semigroup.Semigroup Distribution.PackageDescription.Executable
instance Data.Binary.Class.Binary Distribution.PackageDescription.TestSuite
instance Data.Binary.Class.Binary Distribution.PackageDescription.TestSuiteInterface
instance GHC.Base.Monoid Distribution.PackageDescription.TestSuite
instance Data.Semigroup.Semigroup Distribution.PackageDescription.TestSuite
instance GHC.Base.Monoid Distribution.PackageDescription.TestSuiteInterface
instance Data.Semigroup.Semigroup Distribution.PackageDescription.TestSuiteInterface
instance Data.Binary.Class.Binary Distribution.PackageDescription.TestType
instance Distribution.Text.Text Distribution.PackageDescription.TestType
instance Data.Binary.Class.Binary Distribution.PackageDescription.Benchmark
instance Data.Binary.Class.Binary Distribution.PackageDescription.BenchmarkInterface
instance GHC.Base.Monoid Distribution.PackageDescription.Benchmark
instance Data.Semigroup.Semigroup Distribution.PackageDescription.Benchmark
instance GHC.Base.Monoid Distribution.PackageDescription.BenchmarkInterface
instance Data.Semigroup.Semigroup Distribution.PackageDescription.BenchmarkInterface
instance Data.Binary.Class.Binary Distribution.PackageDescription.BenchmarkType
instance Distribution.Text.Text Distribution.PackageDescription.BenchmarkType
instance Data.Binary.Class.Binary Distribution.PackageDescription.BuildInfo
instance GHC.Base.Monoid Distribution.PackageDescription.BuildInfo
instance Data.Semigroup.Semigroup Distribution.PackageDescription.BuildInfo
instance Data.Binary.Class.Binary Distribution.PackageDescription.SourceRepo
instance Data.Binary.Class.Binary Distribution.PackageDescription.RepoKind
instance Data.Binary.Class.Binary Distribution.PackageDescription.RepoType
instance Distribution.Text.Text Distribution.PackageDescription.RepoKind
instance Distribution.Text.Text Distribution.PackageDescription.RepoType
instance Distribution.Package.Package Distribution.PackageDescription.GenericPackageDescription
instance Data.Binary.Class.Binary Distribution.PackageDescription.GenericPackageDescription
instance Data.Binary.Class.Binary Distribution.PackageDescription.Flag
instance Data.Binary.Class.Binary Distribution.PackageDescription.FlagName
instance Data.Binary.Class.Binary Distribution.PackageDescription.ConfVar
instance GHC.Base.Functor Distribution.PackageDescription.Condition
instance Data.Foldable.Foldable Distribution.PackageDescription.Condition
instance Data.Traversable.Traversable Distribution.PackageDescription.Condition
instance GHC.Base.Applicative Distribution.PackageDescription.Condition
instance GHC.Base.Monad Distribution.PackageDescription.Condition
instance GHC.Base.Monoid (Distribution.PackageDescription.Condition a)
instance Data.Semigroup.Semigroup (Distribution.PackageDescription.Condition a)
instance GHC.Base.Alternative Distribution.PackageDescription.Condition
instance GHC.Base.MonadPlus Distribution.PackageDescription.Condition
instance Data.Binary.Class.Binary c => Data.Binary.Class.Binary (Distribution.PackageDescription.Condition c)
instance (Data.Binary.Class.Binary v, Data.Binary.Class.Binary c, Data.Binary.Class.Binary a) => Data.Binary.Class.Binary (Distribution.PackageDescription.CondTree v c a)
module Distribution.Compat.Exception
catchIO :: IO a -> (IOException -> IO a) -> IO a
catchExit :: IO a -> (ExitCode -> IO a) -> IO a
tryIO :: IO a -> IO (Either IOException a)
-- | A large and somewhat miscellaneous collection of utility functions
-- used throughout the rest of the Cabal lib and in other tools that use
-- the Cabal lib like <tt>cabal-install</tt>. It has a very simple set of
-- logging actions. It has low level functions for running programs, a
-- bunch of wrappers for various directory and file functions that do
-- extra logging.
module Distribution.Simple.Utils
cabalVersion :: Version
die :: String -> IO a
dieWithLocation :: FilePath -> Maybe Int -> String -> IO a
topHandler :: IO a -> IO a
topHandlerWith :: forall a. (SomeException -> IO a) -> IO a -> IO a
-- | Non fatal conditions that may be indicative of an error or problem.
--
-- We display these at the <a>normal</a> verbosity level.
warn :: Verbosity -> String -> IO ()
-- | Useful status messages.
--
-- We display these at the <a>normal</a> verbosity level.
--
-- This is for the ordinary helpful status messages that users see. Just
-- enough information to know that things are working but not floods of
-- detail.
notice :: Verbosity -> String -> IO ()
setupMessage :: Verbosity -> String -> PackageIdentifier -> IO ()
-- | More detail on the operation of some action.
--
-- We display these messages when the verbosity level is <a>verbose</a>
info :: Verbosity -> String -> IO ()
-- | Detailed internal debugging information
--
-- We display these messages when the verbosity level is <a>deafening</a>
debug :: Verbosity -> String -> IO ()
-- | A variant of <a>debug</a> that doesn't perform the automatic line
-- wrapping. Produces better output in some cases.
debugNoWrap :: Verbosity -> String -> IO ()
-- | Perform an IO action, catching any IO exceptions and printing an error
-- if one occurs.
chattyTry :: String -> IO () -> IO ()
printRawCommandAndArgs :: Verbosity -> FilePath -> [String] -> IO ()
printRawCommandAndArgsAndEnv :: Verbosity -> FilePath -> [String] -> Maybe [(String, String)] -> IO ()
-- | Run an IO computation, returning <tt>e</tt> if it raises a "file does
-- not exist" error.
handleDoesNotExist :: a -> IO a -> IO a
rawSystemExit :: Verbosity -> FilePath -> [String] -> IO ()
rawSystemExitCode :: Verbosity -> FilePath -> [String] -> IO ExitCode
rawSystemExitWithEnv :: Verbosity -> FilePath -> [String] -> [(String, String)] -> IO ()
-- | Run a command and return its output.
--
-- The output is assumed to be text in the locale encoding.
rawSystemStdout :: Verbosity -> FilePath -> [String] -> IO String
-- | Run a command and return its output, errors and exit status.
-- Optionally also supply some input. Also provides control over whether
-- the binary/text mode of the input and output.
rawSystemStdInOut :: Verbosity -> FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> Maybe (String, Bool) -> Bool -> IO (String, String, ExitCode)
rawSystemIOWithEnv :: Verbosity -> FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> Maybe Handle -> Maybe Handle -> Maybe Handle -> IO ExitCode
createProcessWithEnv :: Verbosity -> FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> StdStream -> StdStream -> StdStream -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
maybeExit :: IO ExitCode -> IO ()
-- | Like the Unix xargs program. Useful for when we've got very long
-- command lines that might overflow an OS limit on command line length
-- and so you need to invoke a command multiple times to get all the args
-- in.
--
-- Use it with either of the rawSystem variants above. For example:
--
-- <pre>
-- xargs (32*1024) (rawSystemExit verbosity) prog fixedArgs bigArgs
-- </pre>
xargs :: Int -> ([String] -> IO ()) -> [String] -> [String] -> IO ()
-- | Look for a program on the path.
-- | <i>Deprecated: No longer used within Cabal, try
-- findProgramOnSearchPath</i>
findProgramLocation :: Verbosity -> FilePath -> IO (Maybe FilePath)
-- | Look for a program and try to find it's version number. It can accept
-- either an absolute path or the name of a program binary, in which case
-- we will look for the program on the path.
findProgramVersion :: String -> (String -> String) -> Verbosity -> FilePath -> IO (Maybe Version)
-- | <i>Deprecated: Use findModuleFiles and copyFiles or
-- installOrdinaryFiles</i>
smartCopySources :: Verbosity -> [FilePath] -> FilePath -> [ModuleName] -> [String] -> IO ()
-- | Same as <tt>createDirectoryIfMissing</tt> but logs at higher verbosity
-- levels.
createDirectoryIfMissingVerbose :: Verbosity -> Bool -> FilePath -> IO ()
-- | Copies a file without copying file permissions. The target file is
-- created with default permissions. Any existing target file is
-- replaced.
--
-- At higher verbosity levels it logs an info message.
copyFileVerbose :: Verbosity -> FilePath -> FilePath -> IO ()
-- | <i>Deprecated: You probably want installDirectoryContents instead</i>
copyDirectoryRecursiveVerbose :: Verbosity -> FilePath -> FilePath -> IO ()
-- | Copies a bunch of files to a target directory, preserving the
-- directory structure in the target location. The target directories are
-- created if they do not exist.
--
-- The files are identified by a pair of base directory and a path
-- relative to that base. It is only the relative part that is preserved
-- in the destination.
--
-- For example:
--
-- <pre>
-- copyFiles normal "dist/src"
-- [("", "src/Foo.hs"), ("dist/build/", "src/Bar.hs")]
-- </pre>
--
-- This would copy "src/Foo.hs" to "dist/src/src/Foo.hs" and copy
-- "dist/build/src/Bar.hs" to "dist/src/src/Bar.hs".
--
-- This operation is not atomic. Any IO failure during the copy
-- (including any missing source files) leaves the target in an unknown
-- state so it is best to use it with a freshly created directory so that
-- it can be simply deleted if anything goes wrong.
copyFiles :: Verbosity -> FilePath -> [(FilePath, FilePath)] -> IO ()
-- | Given a relative path to a file, copy it to the given directory,
-- preserving the relative path and creating the parent directories if
-- needed.
copyFileTo :: Verbosity -> FilePath -> FilePath -> IO ()
-- | Install an ordinary file. This is like a file copy but the permissions
-- are set appropriately for an installed file. On Unix it is
-- "-rw-r--r--" while on Windows it uses the default permissions for the
-- target directory.
installOrdinaryFile :: Verbosity -> FilePath -> FilePath -> IO ()
-- | Install an executable file. This is like a file copy but the
-- permissions are set appropriately for an installed file. On Unix it is
-- "-rwxr-xr-x" while on Windows it uses the default permissions for the
-- target directory.
installExecutableFile :: Verbosity -> FilePath -> FilePath -> IO ()
-- | Install a file that may or not be executable, preserving permissions.
installMaybeExecutableFile :: Verbosity -> FilePath -> FilePath -> IO ()
-- | This is like <a>copyFiles</a> but uses <a>installOrdinaryFile</a>.
installOrdinaryFiles :: Verbosity -> FilePath -> [(FilePath, FilePath)] -> IO ()
-- | This is like <a>copyFiles</a> but uses <a>installExecutableFile</a>.
installExecutableFiles :: Verbosity -> FilePath -> [(FilePath, FilePath)] -> IO ()
-- | This is like <a>copyFiles</a> but uses
-- <a>installMaybeExecutableFile</a>.
installMaybeExecutableFiles :: Verbosity -> FilePath -> [(FilePath, FilePath)] -> IO ()
-- | This installs all the files in a directory to a target location,
-- preserving the directory layout. All the files are assumed to be
-- ordinary rather than executable files.
installDirectoryContents :: Verbosity -> FilePath -> FilePath -> IO ()
-- | Recursively copy the contents of one directory to another path.
copyDirectoryRecursive :: Verbosity -> FilePath -> FilePath -> IO ()
-- | Like <a>doesFileExist</a>, but also checks that the file is
-- executable.
doesExecutableExist :: FilePath -> IO Bool
setFileOrdinary :: FilePath -> IO ()
setFileExecutable :: FilePath -> IO ()
-- | The path name that represents the current directory. In Unix, it's
-- <tt>"."</tt>, but this is system-specific. (E.g. AmigaOS uses the
-- empty string <tt>""</tt> for the current directory.)
currentDir :: FilePath
shortRelativePath :: FilePath -> FilePath -> FilePath
-- | Drop the extension if it's one of <a>exeExtensions</a>, or return the
-- path unchanged.
dropExeExtension :: FilePath -> FilePath
-- | List of possible executable file extensions on the current platform.
exeExtensions :: [String]
-- | Find a file by looking in a search path. The file path must match
-- exactly.
findFile :: [FilePath] -> FilePath -> IO FilePath
findFirstFile :: (a -> FilePath) -> [a] -> IO (Maybe a)
-- | Find a file by looking in a search path with one of a list of possible
-- file extensions. The file base name should be given and it will be
-- tried with each of the extensions in each element of the search path.
findFileWithExtension :: [String] -> [FilePath] -> FilePath -> IO (Maybe FilePath)
-- | Like <a>findFileWithExtension</a> but returns which element of the
-- search path the file was found in, and the file path relative to that
-- base directory.
findFileWithExtension' :: [String] -> [FilePath] -> FilePath -> IO (Maybe (FilePath, FilePath))
findAllFilesWithExtension :: [String] -> [FilePath] -> FilePath -> IO [FilePath]
-- | Find the file corresponding to a Haskell module name.
--
-- This is similar to <a>findFileWithExtension'</a> but specialised to a
-- module name. The function fails if the file corresponding to the
-- module is missing.
findModuleFile :: [FilePath] -> [String] -> ModuleName -> IO (FilePath, FilePath)
-- | Finds the files corresponding to a list of Haskell module names.
--
-- As <a>findModuleFile</a> but for a list of module names.
findModuleFiles :: [FilePath] -> [String] -> [ModuleName] -> IO [(FilePath, FilePath)]
-- | List all the files in a directory and all subdirectories.
--
-- The order places files in sub-directories after all the files in their
-- parent directories. The list is generated lazily so is not well
-- defined if the source directory structure changes before the list is
-- used.
getDirectoryContentsRecursive :: FilePath -> IO [FilePath]
-- | Is this directory in the system search path?
isInSearchPath :: FilePath -> IO Bool
addLibraryPath :: OS -> [FilePath] -> [(String, String)] -> [(String, String)]
matchFileGlob :: FilePath -> IO [FilePath]
matchDirFileGlob :: FilePath -> FilePath -> IO [FilePath]
parseFileGlob :: FilePath -> Maybe FileGlob
data FileGlob
-- | No glob at all, just an ordinary file
NoGlob :: FilePath -> FileGlob
-- | dir prefix and extension, like <tt>"foo/bar/*.baz"</tt> corresponds to
-- <tt>FileGlob "foo/bar" ".baz"</tt>
FileGlob :: FilePath -> String -> FileGlob
-- | Compare the modification times of two files to see if the first is
-- newer than the second. The first file must exist but the second need
-- not. The expected use case is when the second file is generated using
-- the first. In this use case, if the result is True then the second
-- file is out of date.
moreRecentFile :: FilePath -> FilePath -> IO Bool
-- | Like <a>moreRecentFile</a>, but also checks that the first file
-- exists.
existsAndIsMoreRecentThan :: FilePath -> FilePath -> IO Bool
-- | Advanced options for <a>withTempFile</a> and <a>withTempDirectory</a>.
data TempFileOptions
TempFileOptions :: Bool -> TempFileOptions
-- | Keep temporary files?
[optKeepTempFiles] :: TempFileOptions -> Bool
defaultTempFileOptions :: TempFileOptions
-- | Use a temporary filename that doesn't already exist.
withTempFile :: FilePath -> String -> (FilePath -> Handle -> IO a) -> IO a
-- | A version of <a>withTempFile</a> that additionally takes a
-- <a>TempFileOptions</a> argument.
withTempFileEx :: TempFileOptions -> FilePath -> String -> (FilePath -> Handle -> IO a) -> IO a
-- | Create and use a temporary directory.
--
-- Creates a new temporary directory inside the given directory, making
-- use of the template. The temp directory is deleted after use. For
-- example:
--
-- <pre>
-- withTempDirectory verbosity "src" "sdist." $ \tmpDir -> do ...
-- </pre>
--
-- The <tt>tmpDir</tt> will be a new subdirectory of the given directory,
-- e.g. <tt>src/sdist.342</tt>.
withTempDirectory :: Verbosity -> FilePath -> String -> (FilePath -> IO a) -> IO a
-- | A version of <a>withTempDirectory</a> that additionally takes a
-- <a>TempFileOptions</a> argument.
withTempDirectoryEx :: Verbosity -> TempFileOptions -> FilePath -> String -> (FilePath -> IO a) -> IO a
-- | Package description file (<i>pkgname</i><tt>.cabal</tt>)
defaultPackageDesc :: Verbosity -> IO FilePath
-- | Find a package description file in the given directory. Looks for
-- <tt>.cabal</tt> files.
findPackageDesc :: FilePath -> IO (Either String FilePath)
-- | Like <a>findPackageDesc</a>, but calls <a>die</a> in case of error.
tryFindPackageDesc :: FilePath -> IO FilePath
-- | Optional auxiliary package information file
-- (<i>pkgname</i><tt>.buildinfo</tt>)
defaultHookedPackageDesc :: IO (Maybe FilePath)
-- | Find auxiliary package information in the given directory. Looks for
-- <tt>.buildinfo</tt> files.
findHookedPackageDesc :: FilePath -> IO (Maybe FilePath)
-- | Gets the contents of a file, but guarantee that it gets closed.
--
-- The file is read lazily but if it is not fully consumed by the action
-- then the remaining input is truncated and the file is closed.
withFileContents :: FilePath -> (String -> IO a) -> IO a
-- | Writes a file atomically.
--
-- The file is either written successfully or an IO exception is raised
-- and the original file is left unchanged.
--
-- On windows it is not possible to delete a file that is open by a
-- process. This case will give an IO exception but the atomic property
-- is not affected.
writeFileAtomic :: FilePath -> ByteString -> IO ()
-- | Write a file but only if it would have new content. If we would be
-- writing the same as the existing content then leave the file as is so
-- that we do not update the file's modification time.
--
-- NB: the file is assumed to be ASCII-encoded.
rewriteFile :: FilePath -> String -> IO ()
fromUTF8 :: String -> String
toUTF8 :: String -> String
-- | Reads a UTF8 encoded text file as a Unicode String
--
-- Reads lazily using ordinary <a>readFile</a>.
readUTF8File :: FilePath -> IO String
-- | Reads a UTF8 encoded text file as a Unicode String
--
-- Same behaviour as <a>withFileContents</a>.
withUTF8FileContents :: FilePath -> (String -> IO a) -> IO a
-- | Writes a Unicode String as a UTF8 encoded text file.
--
-- Uses <a>writeFileAtomic</a>, so provides the same guarantees.
writeUTF8File :: FilePath -> String -> IO ()
-- | Fix different systems silly line ending conventions
normaliseLineEndings :: String -> String
-- | Whether BOM is at the beginning of the input
startsWithBOM :: String -> Bool
-- | Check whether a file has Unicode byte order mark (BOM).
fileHasBOM :: FilePath -> IO Bool
-- | Ignore a Unicode byte order mark (BOM) at the beginning of the input
ignoreBOM :: String -> String
-- | <tt>dropWhileEndLE p</tt> is equivalent to <tt>reverse . dropWhile p .
-- reverse</tt>, but quite a bit faster. The difference between
-- "Data.List.dropWhileEnd" and this version is that the one in
-- <a>Data.List</a> is strict in elements, but spine-lazy, while this one
-- is spine-strict but lazy in elements. That's what <tt>LE</tt> stands
-- for - "lazy in elements".
--
-- Example:
--
-- <pre>
-- > tail $ Data.List.dropWhileEnd (<3) [undefined, 5, 4, 3, 2, 1]
-- *** Exception: Prelude.undefined
-- > tail $ dropWhileEndLE (<3) [undefined, 5, 4, 3, 2, 1]
-- [5,4,3]
-- > take 3 $ Data.List.dropWhileEnd (<3) [5, 4, 3, 2, 1, undefined]
-- [5,4,3]
-- > take 3 $ dropWhileEndLE (<3) [5, 4, 3, 2, 1, undefined]
-- *** Exception: Prelude.undefined
-- </pre>
dropWhileEndLE :: (a -> Bool) -> [a] -> [a]
-- | <tt>takeWhileEndLE p</tt> is equivalent to <tt>reverse . takeWhile p .
-- reverse</tt>, but is usually faster (as well as being easier to read).
takeWhileEndLE :: (a -> Bool) -> [a] -> [a]
equating :: Eq a => (b -> a) -> b -> b -> Bool
-- | <pre>
-- comparing p x y = compare (p x) (p y)
-- </pre>
--
-- Useful combinator for use in conjunction with the <tt>xxxBy</tt>
-- family of functions from <a>Data.List</a>, for example:
--
-- <pre>
-- ... sortBy (comparing fst) ...
-- </pre>
comparing :: Ord a => (b -> a) -> b -> b -> Ordering
-- | The <a>isInfixOf</a> function takes two lists and returns <a>True</a>
-- iff the first list is contained, wholly and intact, anywhere within
-- the second.
--
-- Example:
--
-- <pre>
-- isInfixOf "Haskell" "I really like Haskell." == True
-- isInfixOf "Ial" "I really like Haskell." == False
-- </pre>
isInfixOf :: Eq a => [a] -> [a] -> Bool
-- | <a>intercalate</a> <tt>xs xss</tt> is equivalent to <tt>(<a>concat</a>
-- (<a>intersperse</a> xs xss))</tt>. It inserts the list <tt>xs</tt> in
-- between the lists in <tt>xss</tt> and concatenates the result.
intercalate :: [a] -> [[a]] -> [a]
lowercase :: String -> String
-- | Like "Data.List.union", but has <tt>O(n log n)</tt> complexity instead
-- of <tt>O(n^2)</tt>.
listUnion :: (Ord a) => [a] -> [a] -> [a]
-- | A right-biased version of <a>listUnion</a>.
--
-- Example:
--
-- <pre>
-- > listUnion [1,2,3,4,3] [2,1,1]
-- [1,2,3,4,3]
-- > listUnionRight [1,2,3,4,3] [2,1,1]
-- [4,3,2,1,1]
-- </pre>
listUnionRight :: (Ord a) => [a] -> [a] -> [a]
-- | Like "Data.List.nub", but has <tt>O(n log n)</tt> complexity instead
-- of <tt>O(n^2)</tt>. Code for <a>ordNub</a> and <a>listUnion</a> taken
-- from Niklas Hambüchen's <a>ordnub</a> package.
ordNub :: (Ord a) => [a] -> [a]
-- | A right-biased version of <a>ordNub</a>.
--
-- Example:
--
-- <pre>
-- > ordNub [1,2,1]
-- [1,2]
-- > ordNubRight [1,2,1]
-- [2,1]
-- </pre>
ordNubRight :: (Ord a) => [a] -> [a]
-- | A total variant of <a>tail</a>.
safeTail :: [a] -> [a]
-- | Wraps text to the default line width. Existing newlines are preserved.
wrapText :: String -> String
-- | Wraps a list of words to a list of lines of words of a particular
-- width.
wrapLine :: Int -> [String] -> [[String]]
-- | This is about the cabal configurations feature. It exports
-- <a>finalizePackageDescription</a> and <a>flattenPackageDescription</a>
-- which are functions for converting <a>GenericPackageDescription</a>s
-- down to <a>PackageDescription</a>s. It has code for working with the
-- tree of conditions and resolving or flattening conditions.
module Distribution.PackageDescription.Configuration
-- | Create a package description with all configurations resolved.
--
-- This function takes a <a>GenericPackageDescription</a> and several
-- environment parameters and tries to generate <a>PackageDescription</a>
-- by finding a flag assignment that result in satisfiable dependencies.
--
-- It takes as inputs a not necessarily complete specifications of flags
-- assignments, an optional package index as well as platform parameters.
-- If some flags are not assigned explicitly, this function will try to
-- pick an assignment that causes this function to succeed. The package
-- index is optional since on some platforms we cannot determine which
-- packages have been installed before. When no package index is
-- supplied, every dependency is assumed to be satisfiable, therefore all
-- not explicitly assigned flags will get their default values.
--
-- This function will fail if it cannot find a flag assignment that leads
-- to satisfiable dependencies. (It will not try alternative assignments
-- for explicitly specified flags.) In case of failure it will return the
-- missing dependencies that it encountered when trying different flag
-- assignments. On success, it will return the package description and
-- the full flag assignment chosen.
finalizePackageDescription :: FlagAssignment -> (Dependency -> Bool) -> Platform -> CompilerInfo -> [Dependency] -> GenericPackageDescription -> Either [Dependency] (PackageDescription, FlagAssignment)
-- | Flatten a generic package description by ignoring all conditions and
-- just join the field descriptors into on package description. Note,
-- however, that this may lead to inconsistent field values, since all
-- values are joined into one field, which may not be possible in the
-- original package description, due to the use of exclusive choices (if
-- ... else ...).
--
-- TODO: One particularly tricky case is defaulting. In the original
-- package description, e.g., the source directory might either be the
-- default or a certain, explicitly set path. Since defaults are filled
-- in only after the package has been resolved and when no explicit value
-- has been set, the default path will be missing from the package
-- description returned by this function.
flattenPackageDescription :: GenericPackageDescription -> PackageDescription
-- | Parse a configuration condition from a string.
parseCondition :: ReadP r (Condition ConfVar)
freeVars :: CondTree ConfVar c a -> [FlagName]
-- | Extract the condition matched by the given predicate from a cond tree.
--
-- We use this mainly for extracting buildable conditions (see the Note
-- above), but the function is in fact more general.
extractCondition :: Eq v => (a -> Bool) -> CondTree v c a -> Condition v
-- | Extract conditions matched by the given predicate from all cond trees
-- in a <a>GenericPackageDescription</a>.
extractConditions :: (BuildInfo -> Bool) -> GenericPackageDescription -> [Condition ConfVar]
-- | Transforms a <a>CondTree</a> by putting the input under the "then"
-- branch of a conditional that is True when Buildable is True. If
-- <a>addBuildableCondition</a> can determine that Buildable is always
-- True, it returns the input unchanged. If Buildable is always False, it
-- returns the empty <a>CondTree</a>.
addBuildableCondition :: (Eq v, Monoid a, Monoid c) => (a -> BuildInfo) -> CondTree v c a -> CondTree v c a
mapCondTree :: (a -> b) -> (c -> d) -> (Condition v -> Condition w) -> CondTree v c a -> CondTree w d b
mapTreeData :: (a -> b) -> CondTree v c a -> CondTree v c b
mapTreeConds :: (Condition v -> Condition w) -> CondTree v c a -> CondTree w c a
mapTreeConstrs :: (c -> d) -> CondTree v c a -> CondTree v d a
transformAllBuildInfos :: (BuildInfo -> BuildInfo) -> (SetupBuildInfo -> SetupBuildInfo) -> GenericPackageDescription -> GenericPackageDescription
-- | Walk a <a>GenericPackageDescription</a> and apply <tt>f</tt> to all
-- nested <tt>build-depends</tt> fields.
transformAllBuildDepends :: (Dependency -> Dependency) -> GenericPackageDescription -> GenericPackageDescription
instance GHC.Show.Show Distribution.PackageDescription.Configuration.PDTagged
instance GHC.Read.Read Distribution.PackageDescription.Configuration.DependencyMap
instance GHC.Show.Show Distribution.PackageDescription.Configuration.DependencyMap
instance Data.Semigroup.Semigroup d => GHC.Base.Monoid (Distribution.PackageDescription.Configuration.DepTestRslt d)
instance Data.Semigroup.Semigroup d => Data.Semigroup.Semigroup (Distribution.PackageDescription.Configuration.DepTestRslt d)
instance GHC.Base.Monoid Distribution.PackageDescription.Configuration.DependencyMap
instance Data.Semigroup.Semigroup Distribution.PackageDescription.Configuration.DependencyMap
instance GHC.Base.Monoid Distribution.PackageDescription.Configuration.PDTagged
instance Data.Semigroup.Semigroup Distribution.PackageDescription.Configuration.PDTagged
-- | This has code for checking for various problems in packages. There is
-- one set of checks that just looks at a <a>PackageDescription</a> in
-- isolation and another set of checks that also looks at files in the
-- package. Some of the checks are basic sanity checks, others are
-- portability standards that we'd like to encourage. There is a
-- <a>PackageCheck</a> type that distinguishes the different kinds of
-- check so we can see which ones are appropriate to report in different
-- situations. This code gets uses when configuring a package when we
-- consider only basic problems. The higher standard is uses when when
-- preparing a source tarball and by Hackage when uploading new packages.
-- The reason for this is that we want to hold packages that are expected
-- to be distributed to a higher standard than packages that are only
-- ever expected to be used on the author's own environment.
module Distribution.PackageDescription.Check
-- | Results of some kind of failed package check.
--
-- There are a range of severities, from merely dubious to totally
-- insane. All of them come with a human readable explanation. In future
-- we may augment them with more machine readable explanations, for
-- example to help an IDE suggest automatic corrections.
data PackageCheck
-- | This package description is no good. There's no way it's going to
-- build sensibly. This should give an error at configure time.
PackageBuildImpossible :: String -> PackageCheck
[explanation] :: PackageCheck -> String
-- | A problem that is likely to affect building the package, or an issue
-- that we'd like every package author to be aware of, even if the
-- package is never distributed.
PackageBuildWarning :: String -> PackageCheck
[explanation] :: PackageCheck -> String
-- | An issue that might not be a problem for the package author but might
-- be annoying or detrimental when the package is distributed to users.
-- We should encourage distributed packages to be free from these issues,
-- but occasionally there are justifiable reasons so we cannot ban them
-- entirely.
PackageDistSuspicious :: String -> PackageCheck
[explanation] :: PackageCheck -> String
-- | Like PackageDistSuspicious but will only display warnings rather than
-- causing abnormal exit when you run 'cabal check'.
PackageDistSuspiciousWarn :: String -> PackageCheck
[explanation] :: PackageCheck -> String
-- | An issue that is OK in the author's environment but is almost certain
-- to be a portability problem for other environments. We can quite
-- legitimately refuse to publicly distribute packages with these
-- problems.
PackageDistInexcusable :: String -> PackageCheck
[explanation] :: PackageCheck -> String
-- | Check for common mistakes and problems in package descriptions.
--
-- This is the standard collection of checks covering all aspects except
-- for checks that require looking at files within the package. For those
-- see <a>checkPackageFiles</a>.
--
-- It requires the <a>GenericPackageDescription</a> and optionally a
-- particular configuration of that package. If you pass <a>Nothing</a>
-- then we just check a version of the generic description using
-- <a>flattenPackageDescription</a>.
checkPackage :: GenericPackageDescription -> Maybe PackageDescription -> [PackageCheck]
checkConfiguredPackage :: PackageDescription -> [PackageCheck]
-- | Sanity check things that requires IO. It looks at the files in the
-- package and expects to find the package unpacked in at the given file
-- path.
checkPackageFiles :: PackageDescription -> FilePath -> IO [PackageCheck]
-- | Sanity check things that requires looking at files in the package.
-- This is a generalised version of <a>checkPackageFiles</a> that can
-- work in any monad for which you can provide
-- <a>CheckPackageContentOps</a> operations.
--
-- The point of this extra generality is to allow doing checks in some
-- virtual file system, for example a tarball in memory.
checkPackageContent :: Monad m => CheckPackageContentOps m -> PackageDescription -> m [PackageCheck]
-- | A record of operations needed to check the contents of packages. Used
-- by <a>checkPackageContent</a>.
data CheckPackageContentOps m
CheckPackageContentOps :: (FilePath -> m Bool) -> (FilePath -> m Bool) -> (FilePath -> m [FilePath]) -> (FilePath -> m String) -> CheckPackageContentOps m
[doesFileExist] :: CheckPackageContentOps m -> FilePath -> m Bool
[doesDirectoryExist] :: CheckPackageContentOps m -> FilePath -> m Bool
[getDirectoryContents] :: CheckPackageContentOps m -> FilePath -> m [FilePath]
[getFileContents] :: CheckPackageContentOps m -> FilePath -> m String
-- | Check the names of all files in a package for portability problems.
-- This should be done for example when creating or validating a package
-- tarball.
checkPackageFileNames :: [FilePath] -> [PackageCheck]
instance GHC.Classes.Eq Distribution.PackageDescription.Check.PackageCheck
instance GHC.Show.Show Distribution.PackageDescription.Check.PackageCheck
-- | This is the information about an <i>installed</i> package that is
-- communicated to the <tt>ghc-pkg</tt> program in order to register a
-- package. <tt>ghc-pkg</tt> now consumes this package format (as of
-- version 6.4). This is specific to GHC at the moment.
--
-- The <tt>.cabal</tt> file format is for describing a package that is
-- not yet installed. It has a lot of flexibility, like conditionals and
-- dependency ranges. As such, that format is not at all suitable for
-- describing a package that has already been built and installed. By the
-- time we get to that stage, we have resolved all conditionals and
-- resolved dependency version constraints to exact versions of dependent
-- packages. So, this module defines the <a>InstalledPackageInfo</a> data
-- structure that contains all the info we keep about an installed
-- package. There is a parser and pretty printer. The textual format is
-- rather simpler than the <tt>.cabal</tt> format: there are no sections,
-- for example.
module Distribution.InstalledPackageInfo
data InstalledPackageInfo
InstalledPackageInfo :: PackageId -> UnitId -> String -> License -> String -> String -> String -> String -> String -> String -> String -> String -> String -> AbiHash -> Bool -> [ExposedModule] -> [ModuleName] -> Bool -> [FilePath] -> [FilePath] -> [FilePath] -> FilePath -> [String] -> [String] -> [String] -> [FilePath] -> [String] -> [UnitId] -> [String] -> [String] -> [FilePath] -> [String] -> [FilePath] -> [FilePath] -> Maybe FilePath -> InstalledPackageInfo
[sourcePackageId] :: InstalledPackageInfo -> PackageId
[installedUnitId] :: InstalledPackageInfo -> UnitId
[compatPackageKey] :: InstalledPackageInfo -> String
[license] :: InstalledPackageInfo -> License
[copyright] :: InstalledPackageInfo -> String
[maintainer] :: InstalledPackageInfo -> String
[author] :: InstalledPackageInfo -> String
[stability] :: InstalledPackageInfo -> String
[homepage] :: InstalledPackageInfo -> String
[pkgUrl] :: InstalledPackageInfo -> String
[synopsis] :: InstalledPackageInfo -> String
[description] :: InstalledPackageInfo -> String
[category] :: InstalledPackageInfo -> String
[abiHash] :: InstalledPackageInfo -> AbiHash
[exposed] :: InstalledPackageInfo -> Bool
[exposedModules] :: InstalledPackageInfo -> [ExposedModule]
[hiddenModules] :: InstalledPackageInfo -> [ModuleName]
[trusted] :: InstalledPackageInfo -> Bool
[importDirs] :: InstalledPackageInfo -> [FilePath]
[libraryDirs] :: InstalledPackageInfo -> [FilePath]
[libraryDynDirs] :: InstalledPackageInfo -> [FilePath]
[dataDir] :: InstalledPackageInfo -> FilePath
[hsLibraries] :: InstalledPackageInfo -> [String]
[extraLibraries] :: InstalledPackageInfo -> [String]
[extraGHCiLibraries] :: InstalledPackageInfo -> [String]
[includeDirs] :: InstalledPackageInfo -> [FilePath]
[includes] :: InstalledPackageInfo -> [String]
[depends] :: InstalledPackageInfo -> [UnitId]
[ccOptions] :: InstalledPackageInfo -> [String]
[ldOptions] :: InstalledPackageInfo -> [String]
[frameworkDirs] :: InstalledPackageInfo -> [FilePath]
[frameworks] :: InstalledPackageInfo -> [String]
[haddockInterfaces] :: InstalledPackageInfo -> [FilePath]
[haddockHTMLs] :: InstalledPackageInfo -> [FilePath]
[pkgRoot] :: InstalledPackageInfo -> Maybe FilePath
installedComponentId :: InstalledPackageInfo -> ComponentId
-- | Backwards compatibility with Cabal pre-1.24.
-- | <i>Deprecated: Use installedUnitId instead</i>
installedPackageId :: InstalledPackageInfo -> UnitId
data OriginalModule
OriginalModule :: UnitId -> ModuleName -> OriginalModule
[originalPackageId] :: OriginalModule -> UnitId
[originalModuleName] :: OriginalModule -> ModuleName
data ExposedModule
ExposedModule :: ModuleName -> Maybe OriginalModule -> ExposedModule
[exposedName] :: ExposedModule -> ModuleName
[exposedReexport] :: ExposedModule -> Maybe OriginalModule
data ParseResult a
ParseFailed :: PError -> ParseResult a
ParseOk :: [PWarning] -> a -> ParseResult a
data PError
AmbiguousParse :: String -> LineNo -> PError
NoParse :: String -> LineNo -> PError
TabsError :: LineNo -> PError
FromString :: String -> (Maybe LineNo) -> PError
data PWarning
emptyInstalledPackageInfo :: InstalledPackageInfo
parseInstalledPackageInfo :: String -> ParseResult InstalledPackageInfo
showInstalledPackageInfo :: InstalledPackageInfo -> String
showInstalledPackageInfoField :: String -> Maybe (InstalledPackageInfo -> String)
showSimpleInstalledPackageInfoField :: String -> Maybe (InstalledPackageInfo -> String)
fieldsInstalledPackageInfo :: [FieldDescr InstalledPackageInfo]
instance GHC.Show.Show Distribution.InstalledPackageInfo.InstalledPackageInfo
instance GHC.Read.Read Distribution.InstalledPackageInfo.InstalledPackageInfo
instance GHC.Generics.Generic Distribution.InstalledPackageInfo.InstalledPackageInfo
instance GHC.Classes.Eq Distribution.InstalledPackageInfo.InstalledPackageInfo
instance GHC.Show.Show Distribution.InstalledPackageInfo.ExposedModule
instance GHC.Read.Read Distribution.InstalledPackageInfo.ExposedModule
instance GHC.Generics.Generic Distribution.InstalledPackageInfo.ExposedModule
instance GHC.Classes.Eq Distribution.InstalledPackageInfo.ExposedModule
instance GHC.Show.Show Distribution.InstalledPackageInfo.OriginalModule
instance GHC.Read.Read Distribution.InstalledPackageInfo.OriginalModule
instance GHC.Classes.Eq Distribution.InstalledPackageInfo.OriginalModule
instance GHC.Generics.Generic Distribution.InstalledPackageInfo.OriginalModule
instance Data.Binary.Class.Binary Distribution.InstalledPackageInfo.InstalledPackageInfo
instance Distribution.Package.Package Distribution.InstalledPackageInfo.InstalledPackageInfo
instance Distribution.Package.HasUnitId Distribution.InstalledPackageInfo.InstalledPackageInfo
instance Distribution.Package.PackageInstalled Distribution.InstalledPackageInfo.InstalledPackageInfo
instance Distribution.Text.Text Distribution.InstalledPackageInfo.OriginalModule
instance Distribution.Text.Text Distribution.InstalledPackageInfo.ExposedModule
instance Data.Binary.Class.Binary Distribution.InstalledPackageInfo.OriginalModule
instance Data.Binary.Class.Binary Distribution.InstalledPackageInfo.ExposedModule
-- | This defined parsers and partial pretty printers for the
-- <tt>.cabal</tt> format. Some of the complexity in this module is due
-- to the fact that we have to be backwards compatible with old
-- <tt>.cabal</tt> files, so there's code to translate into the newer
-- structure.
module Distribution.PackageDescription.Parse
-- | Parse the given package file.
readPackageDescription :: Verbosity -> FilePath -> IO GenericPackageDescription
writePackageDescription :: FilePath -> PackageDescription -> IO ()
-- | Parses the given file into a <a>GenericPackageDescription</a>.
--
-- In Cabal 1.2 the syntax for package descriptions was changed to a
-- format with sections and possibly indented property descriptions.
parsePackageDescription :: String -> ParseResult GenericPackageDescription
showPackageDescription :: PackageDescription -> String
data ParseResult a
ParseFailed :: PError -> ParseResult a
ParseOk :: [PWarning] -> a -> ParseResult a
-- | Field descriptor. The parameter <tt>a</tt> parameterizes over where
-- the field's value is stored in.
data FieldDescr a
FieldDescr :: String -> (a -> Doc) -> (LineNo -> String -> a -> ParseResult a) -> FieldDescr a
[fieldName] :: FieldDescr a -> String
[fieldGet] :: FieldDescr a -> a -> Doc
-- | <tt>fieldSet n str x</tt> Parses the field value from the given input
-- string <tt>str</tt> and stores the result in <tt>x</tt> if the parse
-- was successful. Otherwise, reports an error on line number <tt>n</tt>.
[fieldSet] :: FieldDescr a -> LineNo -> String -> a -> ParseResult a
type LineNo = Int
readHookedBuildInfo :: Verbosity -> FilePath -> IO HookedBuildInfo
parseHookedBuildInfo :: String -> ParseResult HookedBuildInfo
writeHookedBuildInfo :: FilePath -> HookedBuildInfo -> IO ()
showHookedBuildInfo :: HookedBuildInfo -> String
pkgDescrFieldDescrs :: [FieldDescr PackageDescription]
libFieldDescrs :: [FieldDescr Library]
executableFieldDescrs :: [FieldDescr Executable]
binfoFieldDescrs :: [FieldDescr BuildInfo]
sourceRepoFieldDescrs :: [FieldDescr SourceRepo]
testSuiteFieldDescrs :: [FieldDescr TestSuiteStanza]
flagFieldDescrs :: [FieldDescr Flag]
instance GHC.Base.Functor f => GHC.Base.Functor (Distribution.PackageDescription.Parse.StT s f)
instance GHC.Base.Monad m => GHC.Base.Applicative (Distribution.PackageDescription.Parse.StT s m)
instance GHC.Base.Monad m => GHC.Base.Monad (Distribution.PackageDescription.Parse.StT s m)
-- | Pretty printing for cabal files
module Distribution.PackageDescription.PrettyPrint
-- | Writes a .cabal file from a generic package description
writeGenericPackageDescription :: FilePath -> GenericPackageDescription -> IO ()
-- | Writes a generic package description to a string
showGenericPackageDescription :: GenericPackageDescription -> String
-- | This is to do with command line handling. The Cabal command line is
-- organised into a number of named sub-commands (much like darcs). The
-- <a>CommandUI</a> abstraction represents one of these sub-commands,
-- with a name, description, a set of flags. Commands can be associated
-- with actions and run. It handles some common stuff automatically, like
-- the <tt>--help</tt> and command line completion flags. It is designed
-- to allow other tools make derived commands. This feature is used
-- heavily in <tt>cabal-install</tt>.
module Distribution.Simple.Command
data CommandUI flags
CommandUI :: String -> String -> (String -> String) -> Maybe (String -> String) -> Maybe (String -> String) -> flags -> (ShowOrParseArgs -> [OptionField flags]) -> CommandUI flags
-- | The name of the command as it would be entered on the command line.
-- For example <tt>"build"</tt>.
[commandName] :: CommandUI flags -> String
-- | A short, one line description of the command to use in help texts.
[commandSynopsis] :: CommandUI flags -> String
-- | A function that maps a program name to a usage summary for this
-- command.
[commandUsage] :: CommandUI flags -> String -> String
-- | Additional explanation of the command to use in help texts.
[commandDescription] :: CommandUI flags -> Maybe (String -> String)
-- | Post-Usage notes and examples in help texts
[commandNotes] :: CommandUI flags -> Maybe (String -> String)
-- | Initial / empty flags
[commandDefaultFlags] :: CommandUI flags -> flags
-- | All the Option fields for this command
[commandOptions] :: CommandUI flags -> ShowOrParseArgs -> [OptionField flags]
-- | Show flags in the standard long option command line format
commandShowOptions :: CommandUI flags -> flags -> [String]
data CommandParse flags
CommandHelp :: (String -> String) -> CommandParse flags
CommandList :: [String] -> CommandParse flags
CommandErrors :: [String] -> CommandParse flags
CommandReadyToGo :: flags -> CommandParse flags
-- | Parse a bunch of command line arguments
commandParseArgs :: CommandUI flags -> Bool -> [String] -> CommandParse (flags -> flags, [String])
-- | Helper function for creating globalCommand description
getNormalCommandDescriptions :: [Command action] -> [(String, String)]
helpCommandUI :: CommandUI ()
data ShowOrParseArgs
ShowArgs :: ShowOrParseArgs
ParseArgs :: ShowOrParseArgs
-- | Default "usage" documentation text for commands.
usageDefault :: String -> String -> String
-- | Create "usage" documentation from a list of parameter configurations.
usageAlternatives :: String -> [String] -> String -> String
-- | Make a Command from standard <tt>GetOpt</tt> options.
mkCommandUI :: String -> String -> [String] -> flags -> (ShowOrParseArgs -> [OptionField flags]) -> CommandUI flags
-- | Mark command as hidden. Hidden commands don't show up in the 'progname
-- help' or 'progname --help' output.
hiddenCommand :: Command action -> Command action
data Command action
commandAddAction :: CommandUI flags -> (flags -> [String] -> action) -> Command action
-- | Utility function, many commands do not accept additional flags. This
-- action fails with a helpful error message if the user supplies any
-- extra.
noExtraFlags :: [String] -> IO ()
data CommandType
NormalCommand :: CommandType
HiddenCommand :: CommandType
-- | wraps a <tt>CommandUI</tt> together with a function that turns it into
-- a <tt>Command</tt>. By hiding the type of flags for the UI allows
-- construction of a list of all UIs at the top level of the program.
-- That list can then be used for generation of manual page as well as
-- for executing the selected command.
data CommandSpec action
CommandSpec :: (CommandUI flags) -> (CommandUI flags -> Command action) -> CommandType -> CommandSpec action
commandFromSpec :: CommandSpec a -> Command a
commandsRun :: CommandUI a -> [Command action] -> [String] -> CommandParse (a, CommandParse action)
-- | We usually have a data type for storing configuration values, where
-- every field stores a configuration option, and the user sets the value
-- either via command line flags or a configuration file. An individual
-- OptionField models such a field, and we usually build a list of
-- options associated to a configuration data type.
data OptionField a
OptionField :: Name -> [OptDescr a] -> OptionField a
[optionName] :: OptionField a -> Name
[optionDescr] :: OptionField a -> [OptDescr a]
type Name = String
-- | Create an option taking a single OptDescr. No explicit Name is given
-- for the Option, the name is the first LFlag given.
option :: SFlags -> LFlags -> Description -> get -> set -> MkOptDescr get set a -> OptionField a
-- | Create an option taking several OptDescrs. You will have to give the
-- flags and description individually to the OptDescr constructor.
multiOption :: Name -> get -> set -> [get -> set -> OptDescr a] -> OptionField a
liftOption :: (b -> a) -> (a -> (b -> b)) -> OptionField a -> OptionField b
-- | to view as a FieldDescr, we sort the list of interfaces (Req > Bool
-- > Choice > Opt) and consider only the first one.
viewAsFieldDescr :: OptionField a -> FieldDescr a
-- | An OptionField takes one or more OptDescrs, describing the command
-- line interface for the field.
data OptDescr a
ReqArg :: Description -> OptFlags -> ArgPlaceHolder -> (ReadE (a -> a)) -> (a -> [String]) -> OptDescr a
OptArg :: Description -> OptFlags -> ArgPlaceHolder -> (ReadE (a -> a)) -> (a -> a) -> (a -> [Maybe String]) -> OptDescr a
ChoiceOpt :: [(Description, OptFlags, a -> a, a -> Bool)] -> OptDescr a
BoolOpt :: Description -> OptFlags -> OptFlags -> (Bool -> a -> a) -> (a -> Maybe Bool) -> OptDescr a
type Description = String
-- | Short command line option strings
type SFlags = [Char]
-- | Long command line option strings
type LFlags = [String]
type OptFlags = (SFlags, LFlags)
type ArgPlaceHolder = String
type MkOptDescr get set a = SFlags -> LFlags -> Description -> get -> set -> OptDescr a
-- | Create a string-valued command line interface.
reqArg :: Monoid b => ArgPlaceHolder -> ReadE b -> (b -> [String]) -> MkOptDescr (a -> b) (b -> a -> a) a
-- | (String -> a) variant of "reqArg"
reqArg' :: Monoid b => ArgPlaceHolder -> (String -> b) -> (b -> [String]) -> MkOptDescr (a -> b) (b -> a -> a) a
-- | Create a string-valued command line interface with a default value.
optArg :: Monoid b => ArgPlaceHolder -> ReadE b -> b -> (b -> [Maybe String]) -> MkOptDescr (a -> b) (b -> a -> a) a
-- | (String -> a) variant of "optArg"
optArg' :: Monoid b => ArgPlaceHolder -> (Maybe String -> b) -> (b -> [Maybe String]) -> MkOptDescr (a -> b) (b -> a -> a) a
noArg :: (Eq b) => b -> MkOptDescr (a -> b) (b -> a -> a) a
boolOpt :: (b -> Maybe Bool) -> (Bool -> b) -> SFlags -> SFlags -> MkOptDescr (a -> b) (b -> a -> a) a
boolOpt' :: (b -> Maybe Bool) -> (Bool -> b) -> OptFlags -> OptFlags -> MkOptDescr (a -> b) (b -> a -> a) a
-- | create a Choice option
choiceOpt :: Eq b => [(b, OptFlags, Description)] -> MkOptDescr (a -> b) (b -> a -> a) a
-- | create a Choice option out of an enumeration type. As long flags, the
-- Show output is used. As short flags, the first character which does
-- not conflict with a previous one is used.
choiceOptFromEnum :: (Bounded b, Enum b, Show b, Eq b) => MkOptDescr (a -> b) (b -> a -> a) a
instance GHC.Base.Functor Distribution.Simple.Command.CommandParse
-- | This should be a much more sophisticated abstraction than it is.
-- Currently it's just a bit of data about the compiler, like it's
-- flavour and name and version. The reason it's just data is because
-- currently it has to be in <a>Read</a> and <a>Show</a> so it can be
-- saved along with the <tt>LocalBuildInfo</tt>. The only interesting bit
-- of info it contains is a mapping between language extensions and
-- compiler command line flags. This module also defines a
-- <a>PackageDB</a> type which is used to refer to package databases.
-- Most compilers only know about a single global package collection but
-- GHC has a global and per-user one and it lets you create arbitrary
-- other package databases. We do not yet fully support this latter
-- feature.
module Distribution.Simple.Compiler
data Compiler
Compiler :: CompilerId -> AbiTag -> [CompilerId] -> [(Language, Flag)] -> [(Extension, Flag)] -> Map String String -> Compiler
-- | Compiler flavour and version.
[compilerId] :: Compiler -> CompilerId
-- | Tag for distinguishing incompatible ABI's on the same architecture/os.
[compilerAbiTag] :: Compiler -> AbiTag
-- | Other implementations that this compiler claims to be compatible with.
[compilerCompat] :: Compiler -> [CompilerId]
-- | Supported language standards.
[compilerLanguages] :: Compiler -> [(Language, Flag)]
-- | Supported extensions.
[compilerExtensions] :: Compiler -> [(Extension, Flag)]
-- | A key-value map for properties not covered by the above fields.
[compilerProperties] :: Compiler -> Map String String
showCompilerId :: Compiler -> String
showCompilerIdWithAbi :: Compiler -> String
compilerFlavor :: Compiler -> CompilerFlavor
compilerVersion :: Compiler -> Version
compilerCompatVersion :: CompilerFlavor -> Compiler -> Maybe Version
compilerInfo :: Compiler -> CompilerInfo
-- | Some compilers have a notion of a database of available packages. For
-- some there is just one global db of packages, other compilers support
-- a per-user or an arbitrary db specified at some location in the file
-- system. This can be used to build isloated environments of packages,
-- for example to build a collection of related packages without
-- installing them globally.
data PackageDB
GlobalPackageDB :: PackageDB
UserPackageDB :: PackageDB
SpecificPackageDB :: FilePath -> PackageDB
-- | We typically get packages from several databases, and stack them
-- together. This type lets us be explicit about that stacking. For
-- example typical stacks include:
--
-- <pre>
-- [GlobalPackageDB]
-- [GlobalPackageDB, UserPackageDB]
-- [GlobalPackageDB, SpecificPackageDB "package.conf.inplace"]
-- </pre>
--
-- Note that the <a>GlobalPackageDB</a> is invariably at the bottom since
-- it contains the rts, base and other special compiler-specific
-- packages.
--
-- We are not restricted to using just the above combinations. In
-- particular we can use several custom package dbs and the user package
-- db together.
--
-- When it comes to writing, the top most (last) package is used.
type PackageDBStack = [PackageDB]
-- | Return the package that we should register into. This is the package
-- db at the top of the stack.
registrationPackageDB :: PackageDBStack -> PackageDB
-- | Make package paths absolute
absolutePackageDBPaths :: PackageDBStack -> IO PackageDBStack
absolutePackageDBPath :: PackageDB -> IO PackageDB
-- | Some compilers support optimising. Some have different levels. For
-- compilers that do not the level is just capped to the level they do
-- support.
data OptimisationLevel
NoOptimisation :: OptimisationLevel
NormalOptimisation :: OptimisationLevel
MaximumOptimisation :: OptimisationLevel
flagToOptimisationLevel :: Maybe String -> OptimisationLevel
-- | Some compilers support emitting debug info. Some have different
-- levels. For compilers that do not the level is just capped to the
-- level they do support.
data DebugInfoLevel
NoDebugInfo :: DebugInfoLevel
MinimalDebugInfo :: DebugInfoLevel
NormalDebugInfo :: DebugInfoLevel
MaximalDebugInfo :: DebugInfoLevel
flagToDebugInfoLevel :: Maybe String -> DebugInfoLevel
type Flag = String
languageToFlags :: Compiler -> Maybe Language -> [Flag]
unsupportedLanguages :: Compiler -> [Language] -> [Language]
-- | For the given compiler, return the flags for the supported extensions.
extensionsToFlags :: Compiler -> [Extension] -> [Flag]
-- | For the given compiler, return the extensions it does not support.
unsupportedExtensions :: Compiler -> [Extension] -> [Extension]
-- | Does this compiler support parallel --make mode?
parmakeSupported :: Compiler -> Bool
-- | Does this compiler support reexported-modules?
reexportedModulesSupported :: Compiler -> Bool
-- | Does this compiler support thinning/renaming on package flags?
renamingPackageFlagsSupported :: Compiler -> Bool
-- | Does this compiler have unified IPIDs (so no package keys)
unifiedIPIDRequired :: Compiler -> Bool
-- | Does this compiler support package keys?
packageKeySupported :: Compiler -> Bool
-- | Does this compiler support unit IDs?
unitIdSupported :: Compiler -> Bool
-- | Does this compiler support a package database entry with:
-- "dynamic-library-dirs"?
libraryDynDirSupported :: Compiler -> Bool
-- | Some compilers (notably GHC) support profiling and can instrument
-- programs so the system can account costs to different functions. There
-- are different levels of detail that can be used for this accounting.
-- For compilers that do not support this notion or the particular detail
-- levels, this is either ignored or just capped to some similar level
-- they do support.
data ProfDetailLevel
ProfDetailNone :: ProfDetailLevel
ProfDetailDefault :: ProfDetailLevel
ProfDetailExportedFunctions :: ProfDetailLevel
ProfDetailToplevelFunctions :: ProfDetailLevel
ProfDetailAllFunctions :: ProfDetailLevel
ProfDetailOther :: String -> ProfDetailLevel
knownProfDetailLevels :: [(String, [String], ProfDetailLevel)]
flagToProfDetailLevel :: String -> ProfDetailLevel
showProfDetailLevel :: ProfDetailLevel -> String
instance GHC.Show.Show Distribution.Simple.Compiler.ProfDetailLevel
instance GHC.Read.Read Distribution.Simple.Compiler.ProfDetailLevel
instance GHC.Generics.Generic Distribution.Simple.Compiler.ProfDetailLevel
instance GHC.Classes.Eq Distribution.Simple.Compiler.ProfDetailLevel
instance GHC.Read.Read Distribution.Simple.Compiler.Compiler
instance GHC.Show.Show Distribution.Simple.Compiler.Compiler
instance GHC.Generics.Generic Distribution.Simple.Compiler.Compiler
instance GHC.Classes.Eq Distribution.Simple.Compiler.Compiler
instance GHC.Show.Show Distribution.Simple.Compiler.DebugInfoLevel
instance GHC.Read.Read Distribution.Simple.Compiler.DebugInfoLevel
instance GHC.Generics.Generic Distribution.Simple.Compiler.DebugInfoLevel
instance GHC.Classes.Eq Distribution.Simple.Compiler.DebugInfoLevel
instance GHC.Enum.Enum Distribution.Simple.Compiler.DebugInfoLevel
instance GHC.Enum.Bounded Distribution.Simple.Compiler.DebugInfoLevel
instance GHC.Show.Show Distribution.Simple.Compiler.OptimisationLevel
instance GHC.Read.Read Distribution.Simple.Compiler.OptimisationLevel
instance GHC.Generics.Generic Distribution.Simple.Compiler.OptimisationLevel
instance GHC.Classes.Eq Distribution.Simple.Compiler.OptimisationLevel
instance GHC.Enum.Enum Distribution.Simple.Compiler.OptimisationLevel
instance GHC.Enum.Bounded Distribution.Simple.Compiler.OptimisationLevel
instance GHC.Read.Read Distribution.Simple.Compiler.PackageDB
instance GHC.Show.Show Distribution.Simple.Compiler.PackageDB
instance GHC.Classes.Ord Distribution.Simple.Compiler.PackageDB
instance GHC.Generics.Generic Distribution.Simple.Compiler.PackageDB
instance GHC.Classes.Eq Distribution.Simple.Compiler.PackageDB
instance Data.Binary.Class.Binary Distribution.Simple.Compiler.Compiler
instance Data.Binary.Class.Binary Distribution.Simple.Compiler.PackageDB
instance Data.Binary.Class.Binary Distribution.Simple.Compiler.OptimisationLevel
instance Data.Binary.Class.Binary Distribution.Simple.Compiler.DebugInfoLevel
instance Data.Binary.Class.Binary Distribution.Simple.Compiler.ProfDetailLevel
-- | An index of packages.
module Distribution.Simple.PackageIndex
-- | The default package index which contains
-- <tt>InstalledPackageInfo</tt>. Normally use this.
type InstalledPackageIndex = PackageIndex InstalledPackageInfo
-- | The collection of information about packages from one or more
-- <tt>PackageDB</tt>s. These packages generally should have an instance
-- of <a>PackageInstalled</a>
--
-- Packages are uniquely identified in by their <a>UnitId</a>, they can
-- also be efficiently looked up by package name or by name and version.
data PackageIndex a
-- | Build an index out of a bunch of packages.
--
-- If there are duplicates by <a>UnitId</a> then later ones mask earlier
-- ones.
fromList :: HasUnitId a => [a] -> PackageIndex a
-- | Merge two indexes.
--
-- Packages from the second mask packages from the first if they have the
-- exact same <a>UnitId</a>.
--
-- For packages with the same source <a>PackageId</a>, packages from the
-- second are "preferred" over those from the first. Being preferred
-- means they are top result when we do a lookup by source
-- <a>PackageId</a>. This is the mechanism we use to prefer user packages
-- over global packages.
merge :: HasUnitId a => PackageIndex a -> PackageIndex a -> PackageIndex a
-- | Inserts a single package into the index.
--
-- This is equivalent to (but slightly quicker than) using <a>mappend</a>
-- or <a>merge</a> with a singleton index.
insert :: HasUnitId a => a -> PackageIndex a -> PackageIndex a
-- | Removes a single installed package from the index.
deleteUnitId :: HasUnitId a => UnitId -> PackageIndex a -> PackageIndex a
-- | Removes all packages with this source <a>PackageId</a> from the index.
deleteSourcePackageId :: HasUnitId a => PackageId -> PackageIndex a -> PackageIndex a
-- | Removes all packages with this (case-sensitive) name from the index.
deletePackageName :: HasUnitId a => PackageName -> PackageIndex a -> PackageIndex a
-- | Does a lookup by source package id (name & version).
--
-- Since multiple package DBs mask each other by <a>UnitId</a>, then we
-- get back at most one package.
lookupUnitId :: PackageIndex a -> UnitId -> Maybe a
-- | Does a lookup by source package id (name & version).
--
-- There can be multiple installed packages with the same source
-- <a>PackageId</a> but different <a>UnitId</a>. They are returned in
-- order of preference, with the most preferred first.
lookupSourcePackageId :: PackageIndex a -> PackageId -> [a]
-- | Convenient alias of <a>lookupSourcePackageId</a>, but assuming only
-- one package per package ID.
lookupPackageId :: PackageIndex a -> PackageId -> Maybe a
-- | Does a lookup by source package name.
lookupPackageName :: PackageIndex a -> PackageName -> [(Version, [a])]
-- | Does a lookup by source package name and a range of versions.
--
-- We get back any number of versions of the specified package name, all
-- satisfying the version range constraint.
lookupDependency :: PackageIndex a -> Dependency -> [(Version, [a])]
-- | Does a case-insensitive search by package name.
--
-- If there is only one package that compares case-insensitively to this
-- name then the search is unambiguous and we get back all versions of
-- that package. If several match case-insensitively but one matches
-- exactly then it is also unambiguous.
--
-- If however several match case-insensitively and none match exactly
-- then we have an ambiguous result, and we get back all the versions of
-- all the packages. The list of ambiguous results is split by exact
-- package name. So it is a non-empty list of non-empty lists.
searchByName :: PackageIndex a -> String -> SearchResult [a]
data SearchResult a
None :: SearchResult a
Unambiguous :: a -> SearchResult a
Ambiguous :: [a] -> SearchResult a
-- | Does a case-insensitive substring search by package name.
--
-- That is, all packages that contain the given string in their name.
searchByNameSubstring :: PackageIndex a -> String -> [a]
-- | Get all the packages from the index.
allPackages :: PackageIndex a -> [a]
-- | Get all the packages from the index.
--
-- They are grouped by package name (case-sensitively).
allPackagesByName :: PackageIndex a -> [(PackageName, [a])]
-- | Get all the packages from the index.
--
-- They are grouped by source package id (package name and version).
allPackagesBySourcePackageId :: HasUnitId a => PackageIndex a -> [(PackageId, [a])]
-- | All packages that have immediate dependencies that are not in the
-- index.
--
-- Returns such packages along with the dependencies that they're
-- missing.
brokenPackages :: PackageInstalled a => PackageIndex a -> [(a, [UnitId])]
-- | Tries to take the transitive closure of the package dependencies.
--
-- If the transitive closure is complete then it returns that subset of
-- the index. Otherwise it returns the broken packages as in
-- <a>brokenPackages</a>.
--
-- <ul>
-- <li>Note that if the result is <tt>Right []</tt> it is because at
-- least one of the original given <a>PackageId</a>s do not occur in the
-- index.</li>
-- </ul>
dependencyClosure :: PackageInstalled a => PackageIndex a -> [UnitId] -> Either (PackageIndex a) [(a, [UnitId])]
-- | Takes the transitive closure of the packages reverse dependencies.
--
-- <ul>
-- <li>The given <a>PackageId</a>s must be in the index.</li>
-- </ul>
reverseDependencyClosure :: PackageInstalled a => PackageIndex a -> [UnitId] -> [a]
topologicalOrder :: PackageInstalled a => PackageIndex a -> [a]
reverseTopologicalOrder :: PackageInstalled a => PackageIndex a -> [a]
-- | Given a package index where we assume we want to use all the packages
-- (use <a>dependencyClosure</a> if you need to get such a index subset)
-- find out if the dependencies within it use consistent versions of each
-- package. Return all cases where multiple packages depend on different
-- versions of some other package.
--
-- Each element in the result is a package name along with the packages
-- that depend on it and the versions they require. These are guaranteed
-- to be distinct.
dependencyInconsistencies :: PackageInstalled a => PackageIndex a -> [(PackageName, [(PackageId, Version)])]
-- | Find if there are any cycles in the dependency graph. If there are no
-- cycles the result is <tt>[]</tt>.
--
-- This actually computes the strongly connected components. So it gives
-- us a list of groups of packages where within each group they all
-- depend on each other, directly or indirectly.
dependencyCycles :: PackageInstalled a => PackageIndex a -> [[a]]
-- | Builds a graph of the package dependencies.
--
-- Dependencies on other packages that are not in the index are
-- discarded. You can check if there are any such dependencies with
-- <a>brokenPackages</a>.
dependencyGraph :: PackageInstalled a => PackageIndex a -> (Graph, Vertex -> a, UnitId -> Maybe Vertex)
-- | A rough approximation of GHC's module finder, takes a
-- <a>InstalledPackageIndex</a> and turns it into a map from module names
-- to their source packages. It's used to initialize the
-- <tt>build-deps</tt> field in <tt>cabal init</tt>.
moduleNameIndex :: InstalledPackageIndex -> Map ModuleName [InstalledPackageInfo]
-- | Backwards compatibility wrapper for Cabal pre-1.24.
-- | <i>Deprecated: Use deleteUnitId instead</i>
deleteInstalledPackageId :: HasUnitId a => UnitId -> PackageIndex a -> PackageIndex a
-- | Backwards compatibility for Cabal pre-1.24.
-- | <i>Deprecated: Use lookupUnitId instead</i>
lookupInstalledPackageId :: PackageIndex a -> UnitId -> Maybe a
instance GHC.Read.Read a => GHC.Read.Read (Distribution.Simple.PackageIndex.PackageIndex a)
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Simple.PackageIndex.PackageIndex a)
instance GHC.Generics.Generic (Distribution.Simple.PackageIndex.PackageIndex a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Distribution.Simple.PackageIndex.PackageIndex a)
instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Distribution.Simple.PackageIndex.PackageIndex a)
instance Distribution.Package.HasUnitId a => GHC.Base.Monoid (Distribution.Simple.PackageIndex.PackageIndex a)
instance Distribution.Package.HasUnitId a => Data.Semigroup.Semigroup (Distribution.Simple.PackageIndex.PackageIndex a)
module Distribution.Utils.NubList
-- | NubList : A de-duplicated list that maintains the original order.
data NubList a
-- | Smart constructor for the NubList type.
toNubList :: Ord a => [a] -> NubList a
fromNubList :: NubList a -> [a]
-- | Lift a function over lists to a function over NubLists.
overNubList :: Ord a => ([a] -> [a]) -> NubList a -> NubList a
-- | NubListR : A right-biased version of <a>NubList</a>. That is
-- <tt>toNubListR ["-XNoFoo", "-XFoo", "-XNoFoo"]</tt> will result in
-- <tt>["-XFoo", "-XNoFoo"]</tt>, unlike the normal <a>NubList</a>, which
-- is left-biased. Built on top of <a>ordNubRight</a> and
-- <a>listUnionRight</a>.
data NubListR a
-- | Smart constructor for the NubListR type.
toNubListR :: Ord a => [a] -> NubListR a
fromNubListR :: NubListR a -> [a]
-- | Lift a function over lists to a function over NubListRs.
overNubListR :: Ord a => ([a] -> [a]) -> NubListR a -> NubListR a
instance GHC.Classes.Eq a => GHC.Classes.Eq (Distribution.Utils.NubList.NubListR a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Distribution.Utils.NubList.NubList a)
instance GHC.Classes.Ord a => GHC.Base.Monoid (Distribution.Utils.NubList.NubList a)
instance GHC.Classes.Ord a => Data.Semigroup.Semigroup (Distribution.Utils.NubList.NubList a)
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Utils.NubList.NubList a)
instance (GHC.Classes.Ord a, GHC.Read.Read a) => GHC.Read.Read (Distribution.Utils.NubList.NubList a)
instance (GHC.Classes.Ord a, Data.Binary.Class.Binary a) => Data.Binary.Class.Binary (Distribution.Utils.NubList.NubList a)
instance GHC.Classes.Ord a => GHC.Base.Monoid (Distribution.Utils.NubList.NubListR a)
instance GHC.Classes.Ord a => Data.Semigroup.Semigroup (Distribution.Utils.NubList.NubListR a)
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Utils.NubList.NubListR a)
instance (GHC.Classes.Ord a, GHC.Read.Read a) => GHC.Read.Read (Distribution.Utils.NubList.NubListR a)
-- | A somewhat extended notion of the normal program search path concept.
--
-- Usually when finding executables we just want to look in the usual
-- places using the OS's usual method for doing so. In Haskell the normal
-- OS-specific method is captured by <a>findExecutable</a>. On all common
-- OSs that makes use of a <tt>PATH</tt> environment variable, (though on
-- Windows it is not just the <tt>PATH</tt>).
--
-- However it is sometimes useful to be able to look in additional
-- locations without having to change the process-global <tt>PATH</tt>
-- environment variable. So we need an extension of the usual
-- <a>findExecutable</a> that can look in additional locations, either
-- before, after or instead of the normal OS locations.
module Distribution.Simple.Program.Find
-- | A search path to use when locating executables. This is analogous to
-- the unix <tt>$PATH</tt> or win32 <tt>%PATH%</tt> but with the ability
-- to use the system default method for finding executables
-- (<a>findExecutable</a> which on unix is simply looking on the
-- <tt>$PATH</tt> but on win32 is a bit more complicated).
--
-- The default to use is <tt>[ProgSearchPathDefault]</tt> but you can add
-- extra dirs either before, after or instead of the default, e.g. here
-- we add an extra dir to search after the usual ones.
--
-- <pre>
-- ['ProgramSearchPathDefault', 'ProgramSearchPathDir' dir]
-- </pre>
type ProgramSearchPath = [ProgramSearchPathEntry]
data ProgramSearchPathEntry
-- | A specific dir
ProgramSearchPathDir :: FilePath -> ProgramSearchPathEntry
-- | The system default
ProgramSearchPathDefault :: ProgramSearchPathEntry
defaultProgramSearchPath :: ProgramSearchPath
findProgramOnSearchPath :: Verbosity -> ProgramSearchPath -> FilePath -> IO (Maybe (FilePath, [FilePath]))
-- | Interpret a <a>ProgramSearchPath</a> to construct a new <tt>$PATH</tt>
-- env var. Note that this is close but not perfect because on Windows
-- the search algorithm looks at more than just the <tt>%PATH%</tt>.
programSearchPathAsPATHVar :: ProgramSearchPath -> IO String
-- | Get the system search path. On Unix systems this is just the
-- <tt>$PATH</tt> env var, but on windows it's a bit more complicated.
getSystemSearchPath :: IO [FilePath]
instance GHC.Generics.Generic Distribution.Simple.Program.Find.ProgramSearchPathEntry
instance GHC.Classes.Eq Distribution.Simple.Program.Find.ProgramSearchPathEntry
instance Data.Binary.Class.Binary Distribution.Simple.Program.Find.ProgramSearchPathEntry
-- | This provides an abstraction which deals with configuring and running
-- programs. A <a>Program</a> is a static notion of a known program. A
-- <a>ConfiguredProgram</a> is a <a>Program</a> that has been found on
-- the current machine and is ready to be run (possibly with some
-- user-supplied default args). Configuring a program involves finding
-- its location and if necessary finding its version. There's reasonable
-- default behavior for trying to find "foo" in PATH, being able to
-- override its location, etc.
module Distribution.Simple.Program.Types
-- | Represents a program which can be configured.
--
-- Note: rather than constructing this directly, start with
-- <a>simpleProgram</a> and override any extra fields.
data Program
Program :: String -> (Verbosity -> ProgramSearchPath -> IO (Maybe (FilePath, [FilePath]))) -> (Verbosity -> FilePath -> IO (Maybe Version)) -> (Verbosity -> ConfiguredProgram -> IO ConfiguredProgram) -> Program
-- | The simple name of the program, eg. ghc
[programName] :: Program -> String
-- | A function to search for the program if its location was not specified
-- by the user. Usually this will just be a call to
-- <a>findProgramOnSearchPath</a>.
--
-- It is supplied with the prevailing search path which will typically
-- just be used as-is, but can be extended or ignored as needed.
--
-- For the purpose of change monitoring, in addition to the location
-- where the program was found, it returns all the other places that were
-- tried.
[programFindLocation] :: Program -> Verbosity -> ProgramSearchPath -> IO (Maybe (FilePath, [FilePath]))
-- | Try to find the version of the program. For many programs this is not
-- possible or is not necessary so it's OK to return Nothing.
[programFindVersion] :: Program -> Verbosity -> FilePath -> IO (Maybe Version)
-- | A function to do any additional configuration after we have located
-- the program (and perhaps identified its version). For example it could
-- add args, or environment vars.
[programPostConf] :: Program -> Verbosity -> ConfiguredProgram -> IO ConfiguredProgram
-- | A search path to use when locating executables. This is analogous to
-- the unix <tt>$PATH</tt> or win32 <tt>%PATH%</tt> but with the ability
-- to use the system default method for finding executables
-- (<a>findExecutable</a> which on unix is simply looking on the
-- <tt>$PATH</tt> but on win32 is a bit more complicated).
--
-- The default to use is <tt>[ProgSearchPathDefault]</tt> but you can add
-- extra dirs either before, after or instead of the default, e.g. here
-- we add an extra dir to search after the usual ones.
--
-- <pre>
-- ['ProgramSearchPathDefault', 'ProgramSearchPathDir' dir]
-- </pre>
type ProgramSearchPath = [ProgramSearchPathEntry]
data ProgramSearchPathEntry
-- | A specific dir
ProgramSearchPathDir :: FilePath -> ProgramSearchPathEntry
-- | The system default
ProgramSearchPathDefault :: ProgramSearchPathEntry
-- | Make a simple named program.
--
-- By default we'll just search for it in the path and not try to find
-- the version name. You can override these behaviours if necessary, eg:
--
-- <pre>
-- simpleProgram "foo" { programFindLocation = ... , programFindVersion ... }
-- </pre>
simpleProgram :: String -> Program
-- | Represents a program which has been configured and is thus ready to be
-- run.
--
-- These are usually made by configuring a <a>Program</a>, but if you
-- have to construct one directly then start with
-- <a>simpleConfiguredProgram</a> and override any extra fields.
data ConfiguredProgram
ConfiguredProgram :: String -> Maybe Version -> [String] -> [String] -> [(String, Maybe String)] -> Map String String -> ProgramLocation -> [FilePath] -> ConfiguredProgram
-- | Just the name again
[programId] :: ConfiguredProgram -> String
-- | The version of this program, if it is known.
[programVersion] :: ConfiguredProgram -> Maybe Version
-- | Default command-line args for this program. These flags will appear
-- first on the command line, so they can be overridden by subsequent
-- flags.
[programDefaultArgs] :: ConfiguredProgram -> [String]
-- | Override command-line args for this program. These flags will appear
-- last on the command line, so they override all earlier flags.
[programOverrideArgs] :: ConfiguredProgram -> [String]
-- | Override environment variables for this program. These env vars will
-- extend/override the prevailing environment of the current to form the
-- environment for the new process.
[programOverrideEnv] :: ConfiguredProgram -> [(String, Maybe String)]
-- | A key-value map listing various properties of the program, useful for
-- feature detection. Populated during the configuration step, key names
-- depend on the specific program.
[programProperties] :: ConfiguredProgram -> Map String String
-- | Location of the program. eg. <tt>/usr/bin/ghc-6.4</tt>
[programLocation] :: ConfiguredProgram -> ProgramLocation
-- | In addition to the <a>programLocation</a> where the program was found,
-- these are additional locations that were looked at. The combination of
-- ths found location and these not-found locations can be used to
-- monitor to detect when the re-configuring the program might give a
-- different result (e.g. found in a different location).
[programMonitorFiles] :: ConfiguredProgram -> [FilePath]
-- | The full path of a configured program.
programPath :: ConfiguredProgram -> FilePath
-- | Suppress any extra arguments added by the user.
suppressOverrideArgs :: ConfiguredProgram -> ConfiguredProgram
type ProgArg = String
-- | Where a program was found. Also tells us whether it's specified by
-- user or not. This includes not just the path, but the program as well.
data ProgramLocation
-- | The user gave the path to this program, eg.
-- --ghc-path=/usr/bin/ghc-6.6
UserSpecified :: FilePath -> ProgramLocation
[locationPath] :: ProgramLocation -> FilePath
-- | The program was found automatically.
FoundOnSystem :: FilePath -> ProgramLocation
[locationPath] :: ProgramLocation -> FilePath
-- | Make a simple <a>ConfiguredProgram</a>.
--
-- <pre>
-- simpleConfiguredProgram "foo" (FoundOnSystem path)
-- </pre>
simpleConfiguredProgram :: String -> ProgramLocation -> ConfiguredProgram
instance GHC.Show.Show Distribution.Simple.Program.Types.ConfiguredProgram
instance GHC.Read.Read Distribution.Simple.Program.Types.ConfiguredProgram
instance GHC.Generics.Generic Distribution.Simple.Program.Types.ConfiguredProgram
instance GHC.Classes.Eq Distribution.Simple.Program.Types.ConfiguredProgram
instance GHC.Show.Show Distribution.Simple.Program.Types.ProgramLocation
instance GHC.Read.Read Distribution.Simple.Program.Types.ProgramLocation
instance GHC.Generics.Generic Distribution.Simple.Program.Types.ProgramLocation
instance GHC.Classes.Eq Distribution.Simple.Program.Types.ProgramLocation
instance Data.Binary.Class.Binary Distribution.Simple.Program.Types.ConfiguredProgram
instance Data.Binary.Class.Binary Distribution.Simple.Program.Types.ProgramLocation
-- | This module provides a data type for program invocations and functions
-- to run them.
module Distribution.Simple.Program.Run
-- | Represents a specific invocation of a specific program.
--
-- This is used as an intermediate type between deciding how to call a
-- program and actually doing it. This provides the opportunity to the
-- caller to adjust how the program will be called. These invocations can
-- either be run directly or turned into shell or batch scripts.
data ProgramInvocation
ProgramInvocation :: FilePath -> [String] -> [(String, Maybe String)] -> Maybe FilePath -> Maybe String -> IOEncoding -> IOEncoding -> ProgramInvocation
[progInvokePath] :: ProgramInvocation -> FilePath
[progInvokeArgs] :: ProgramInvocation -> [String]
[progInvokeEnv] :: ProgramInvocation -> [(String, Maybe String)]
[progInvokeCwd] :: ProgramInvocation -> Maybe FilePath
[progInvokeInput] :: ProgramInvocation -> Maybe String
[progInvokeInputEncoding] :: ProgramInvocation -> IOEncoding
[progInvokeOutputEncoding] :: ProgramInvocation -> IOEncoding
data IOEncoding
IOEncodingText :: IOEncoding
IOEncodingUTF8 :: IOEncoding
emptyProgramInvocation :: ProgramInvocation
simpleProgramInvocation :: FilePath -> [String] -> ProgramInvocation
programInvocation :: ConfiguredProgram -> [String] -> ProgramInvocation
-- | Like the unix xargs program. Useful for when we've got very long
-- command lines that might overflow an OS limit on command line length
-- and so you need to invoke a command multiple times to get all the args
-- in.
--
-- It takes four template invocations corresponding to the simple,
-- initial, middle and last invocations. If the number of args given is
-- small enough that we can get away with just a single invocation then
-- the simple one is used:
--
-- <pre>
-- $ simple args
-- </pre>
--
-- If the number of args given means that we need to use multiple
-- invocations then the templates for the initial, middle and last
-- invocations are used:
--
-- <pre>
-- $ initial args_0
-- $ middle args_1
-- $ middle args_2
-- ...
-- $ final args_n
-- </pre>
multiStageProgramInvocation :: ProgramInvocation -> (ProgramInvocation, ProgramInvocation, ProgramInvocation) -> [String] -> [ProgramInvocation]
runProgramInvocation :: Verbosity -> ProgramInvocation -> IO ()
getProgramInvocationOutput :: Verbosity -> ProgramInvocation -> IO String
-- | Return the current environment extended with the given overrides.
getEffectiveEnvironment :: [(String, Maybe String)] -> IO (Maybe [(String, String)])
-- | The module defines all the known built-in <a>Program</a>s.
--
-- Where possible we try to find their version numbers.
module Distribution.Simple.Program.Builtin
-- | The default list of programs. These programs are typically used
-- internally to Cabal.
builtinPrograms :: [Program]
ghcProgram :: Program
ghcPkgProgram :: Program
ghcjsProgram :: Program
ghcjsPkgProgram :: Program
lhcProgram :: Program
lhcPkgProgram :: Program
hmakeProgram :: Program
jhcProgram :: Program
haskellSuiteProgram :: Program
haskellSuitePkgProgram :: Program
uhcProgram :: Program
gccProgram :: Program
arProgram :: Program
stripProgram :: Program
happyProgram :: Program
alexProgram :: Program
hsc2hsProgram :: Program
c2hsProgram :: Program
cpphsProgram :: Program
hscolourProgram :: Program
haddockProgram :: Program
greencardProgram :: Program
ldProgram :: Program
tarProgram :: Program
cppProgram :: Program
pkgConfigProgram :: Program
hpcProgram :: Program
-- | This provides a <a>ProgramDb</a> type which holds configured and
-- not-yet configured programs. It is the parameter to lots of actions
-- elsewhere in Cabal that need to look up and run programs. If we had a
-- Cabal monad, the <a>ProgramDb</a> would probably be a reader or state
-- component of it.
--
-- One nice thing about using it is that any program that is registered
-- with Cabal will get some "configure" and ".cabal" helpers like
-- --with-foo-args --foo-path= and extra-foo-args.
--
-- There's also a hook for adding programs in a Setup.lhs script. See
-- hookedPrograms in <a>UserHooks</a>. This gives a hook user the ability
-- to get the above flags and such so that they don't have to write all
-- the PATH logic inside Setup.lhs.
module Distribution.Simple.Program.Db
-- | The configuration is a collection of information about programs. It
-- contains information both about configured programs and also about
-- programs that we are yet to configure.
--
-- The idea is that we start from a collection of unconfigured programs
-- and one by one we try to configure them at which point we move them
-- into the configured collection. For unconfigured programs we record
-- not just the <a>Program</a> but also any user-provided arguments and
-- location for the program.
data ProgramDb
emptyProgramDb :: ProgramDb
defaultProgramDb :: ProgramDb
-- | The 'Read'\/'Show' and <a>Binary</a> instances do not preserve all the
-- unconfigured <tt>Programs</tt> because <a>Program</a> is not in
-- 'Read'\/'Show' because it contains functions. So to fully restore a
-- deserialised <a>ProgramDb</a> use this function to add back all the
-- known <a>Program</a>s.
--
-- <ul>
-- <li>It does not add the default programs, but you probably want them,
-- use <a>builtinPrograms</a> in addition to any extra you might
-- need.</li>
-- </ul>
restoreProgramDb :: [Program] -> ProgramDb -> ProgramDb
-- | Add a known program that we may configure later
addKnownProgram :: Program -> ProgramDb -> ProgramDb
addKnownPrograms :: [Program] -> ProgramDb -> ProgramDb
lookupKnownProgram :: String -> ProgramDb -> Maybe Program
knownPrograms :: ProgramDb -> [(Program, Maybe ConfiguredProgram)]
-- | Get the current <a>ProgramSearchPath</a> used by the <a>ProgramDb</a>.
-- This is the default list of locations where programs are looked for
-- when configuring them. This can be overridden for specific programs
-- (with <a>userSpecifyPath</a>), and specific known programs can modify
-- or ignore this search path in their own configuration code.
getProgramSearchPath :: ProgramDb -> ProgramSearchPath
-- | Change the current <a>ProgramSearchPath</a> used by the
-- <a>ProgramDb</a>. This will affect programs that are configured from
-- here on, so you should usually set it before configuring any programs.
setProgramSearchPath :: ProgramSearchPath -> ProgramDb -> ProgramDb
-- | Modify the current <a>ProgramSearchPath</a> used by the
-- <a>ProgramDb</a>. This will affect programs that are configured from
-- here on, so you should usually modify it before configuring any
-- programs.
modifyProgramSearchPath :: (ProgramSearchPath -> ProgramSearchPath) -> ProgramDb -> ProgramDb
-- | User-specify this path. Basically override any path information for
-- this program in the configuration. If it's not a known program ignore
-- it.
userSpecifyPath :: String -> FilePath -> ProgramDb -> ProgramDb
-- | Like <a>userSpecifyPath</a> but for a list of progs and their paths.
userSpecifyPaths :: [(String, FilePath)] -> ProgramDb -> ProgramDb
userMaybeSpecifyPath :: String -> Maybe FilePath -> ProgramDb -> ProgramDb
-- | User-specify the arguments for this program. Basically override any
-- args information for this program in the configuration. If it's not a
-- known program, ignore it..
userSpecifyArgs :: String -> [ProgArg] -> ProgramDb -> ProgramDb
-- | Like <a>userSpecifyPath</a> but for a list of progs and their args.
userSpecifyArgss :: [(String, [ProgArg])] -> ProgramDb -> ProgramDb
-- | Get any extra args that have been previously specified for a program.
userSpecifiedArgs :: Program -> ProgramDb -> [ProgArg]
-- | Try to find a configured program
lookupProgram :: Program -> ProgramDb -> Maybe ConfiguredProgram
-- | Update a configured program in the database.
updateProgram :: ConfiguredProgram -> ProgramDb -> ProgramDb
-- | List all configured programs.
configuredPrograms :: ProgramDb -> [ConfiguredProgram]
-- | Try to configure a specific program. If the program is already
-- included in the collection of unconfigured programs then we use any
-- user-supplied location and arguments. If the program gets configured
-- successfully it gets added to the configured collection.
--
-- Note that it is not a failure if the program cannot be configured.
-- It's only a failure if the user supplied a location and the program
-- could not be found at that location.
--
-- The reason for it not being a failure at this stage is that we don't
-- know up front all the programs we will need, so we try to configure
-- them all. To verify that a program was actually successfully
-- configured use <a>requireProgram</a>.
configureProgram :: Verbosity -> Program -> ProgramDb -> IO ProgramDb
-- | Try to configure all the known programs that have not yet been
-- configured.
configureAllKnownPrograms :: Verbosity -> ProgramDb -> IO ProgramDb
-- | Check that a program is configured and available to be run.
--
-- Additionally check that the program version number is suitable and
-- return it. For example you could require <a>AnyVersion</a> or
-- <tt><a>orLaterVersion</a> (<a>Version</a> [1,0] [])</tt>
--
-- It returns the configured program, its version number and a possibly
-- updated <a>ProgramDb</a>. If the program could not be configured or
-- the version is unsuitable, it returns an error value.
lookupProgramVersion :: Verbosity -> Program -> VersionRange -> ProgramDb -> IO (Either String (ConfiguredProgram, Version, ProgramDb))
-- | reconfigure a bunch of programs given new user-specified args. It
-- takes the same inputs as <a>userSpecifyPath</a> and
-- <a>userSpecifyArgs</a> and for all progs with a new path it calls
-- <a>configureProgram</a>.
reconfigurePrograms :: Verbosity -> [(String, FilePath)] -> [(String, [ProgArg])] -> ProgramDb -> IO ProgramDb
-- | Check that a program is configured and available to be run.
--
-- It raises an exception if the program could not be configured,
-- otherwise it returns the configured program.
requireProgram :: Verbosity -> Program -> ProgramDb -> IO (ConfiguredProgram, ProgramDb)
-- | Like <a>lookupProgramVersion</a>, but raises an exception in case of
-- error instead of returning 'Left errMsg'.
requireProgramVersion :: Verbosity -> Program -> VersionRange -> ProgramDb -> IO (ConfiguredProgram, Version, ProgramDb)
instance GHC.Show.Show Distribution.Simple.Program.Db.ProgramDb
instance GHC.Read.Read Distribution.Simple.Program.Db.ProgramDb
instance Data.Binary.Class.Binary Distribution.Simple.Program.Db.ProgramDb
-- | This provides an abstraction which deals with configuring and running
-- programs. A <a>Program</a> is a static notion of a known program. A
-- <a>ConfiguredProgram</a> is a <a>Program</a> that has been found on
-- the current machine and is ready to be run (possibly with some
-- user-supplied default args). Configuring a program involves finding
-- its location and if necessary finding its version. There is also a
-- <a>ProgramConfiguration</a> type which holds configured and not-yet
-- configured programs. It is the parameter to lots of actions elsewhere
-- in Cabal that need to look up and run programs. If we had a Cabal
-- monad, the <a>ProgramConfiguration</a> would probably be a reader or
-- state component of it.
--
-- The module also defines all the known built-in <a>Program</a>s and the
-- <a>defaultProgramConfiguration</a> which contains them all.
--
-- One nice thing about using it is that any program that is registered
-- with Cabal will get some "configure" and ".cabal" helpers like
-- --with-foo-args --foo-path= and extra-foo-args.
--
-- There's also good default behavior for trying to find "foo" in PATH,
-- being able to override its location, etc.
--
-- There's also a hook for adding programs in a Setup.lhs script. See
-- hookedPrograms in <a>UserHooks</a>. This gives a hook user the ability
-- to get the above flags and such so that they don't have to write all
-- the PATH logic inside Setup.lhs.
module Distribution.Simple.Program
-- | Represents a program which can be configured.
--
-- Note: rather than constructing this directly, start with
-- <a>simpleProgram</a> and override any extra fields.
data Program
Program :: String -> (Verbosity -> ProgramSearchPath -> IO (Maybe (FilePath, [FilePath]))) -> (Verbosity -> FilePath -> IO (Maybe Version)) -> (Verbosity -> ConfiguredProgram -> IO ConfiguredProgram) -> Program
-- | The simple name of the program, eg. ghc
[programName] :: Program -> String
-- | A function to search for the program if its location was not specified
-- by the user. Usually this will just be a call to
-- <a>findProgramOnSearchPath</a>.
--
-- It is supplied with the prevailing search path which will typically
-- just be used as-is, but can be extended or ignored as needed.
--
-- For the purpose of change monitoring, in addition to the location
-- where the program was found, it returns all the other places that were
-- tried.
[programFindLocation] :: Program -> Verbosity -> ProgramSearchPath -> IO (Maybe (FilePath, [FilePath]))
-- | Try to find the version of the program. For many programs this is not
-- possible or is not necessary so it's OK to return Nothing.
[programFindVersion] :: Program -> Verbosity -> FilePath -> IO (Maybe Version)
-- | A function to do any additional configuration after we have located
-- the program (and perhaps identified its version). For example it could
-- add args, or environment vars.
[programPostConf] :: Program -> Verbosity -> ConfiguredProgram -> IO ConfiguredProgram
-- | A search path to use when locating executables. This is analogous to
-- the unix <tt>$PATH</tt> or win32 <tt>%PATH%</tt> but with the ability
-- to use the system default method for finding executables
-- (<a>findExecutable</a> which on unix is simply looking on the
-- <tt>$PATH</tt> but on win32 is a bit more complicated).
--
-- The default to use is <tt>[ProgSearchPathDefault]</tt> but you can add
-- extra dirs either before, after or instead of the default, e.g. here
-- we add an extra dir to search after the usual ones.
--
-- <pre>
-- ['ProgramSearchPathDefault', 'ProgramSearchPathDir' dir]
-- </pre>
type ProgramSearchPath = [ProgramSearchPathEntry]
data ProgramSearchPathEntry
-- | A specific dir
ProgramSearchPathDir :: FilePath -> ProgramSearchPathEntry
-- | The system default
ProgramSearchPathDefault :: ProgramSearchPathEntry
-- | Make a simple named program.
--
-- By default we'll just search for it in the path and not try to find
-- the version name. You can override these behaviours if necessary, eg:
--
-- <pre>
-- simpleProgram "foo" { programFindLocation = ... , programFindVersion ... }
-- </pre>
simpleProgram :: String -> Program
findProgramOnSearchPath :: Verbosity -> ProgramSearchPath -> FilePath -> IO (Maybe (FilePath, [FilePath]))
defaultProgramSearchPath :: ProgramSearchPath
-- | Look for a program and try to find it's version number. It can accept
-- either an absolute path or the name of a program binary, in which case
-- we will look for the program on the path.
findProgramVersion :: String -> (String -> String) -> Verbosity -> FilePath -> IO (Maybe Version)
-- | Represents a program which has been configured and is thus ready to be
-- run.
--
-- These are usually made by configuring a <a>Program</a>, but if you
-- have to construct one directly then start with
-- <a>simpleConfiguredProgram</a> and override any extra fields.
data ConfiguredProgram
ConfiguredProgram :: String -> Maybe Version -> [String] -> [String] -> [(String, Maybe String)] -> Map String String -> ProgramLocation -> [FilePath] -> ConfiguredProgram
-- | Just the name again
[programId] :: ConfiguredProgram -> String
-- | The version of this program, if it is known.
[programVersion] :: ConfiguredProgram -> Maybe Version
-- | Default command-line args for this program. These flags will appear
-- first on the command line, so they can be overridden by subsequent
-- flags.
[programDefaultArgs] :: ConfiguredProgram -> [String]
-- | Override command-line args for this program. These flags will appear
-- last on the command line, so they override all earlier flags.
[programOverrideArgs] :: ConfiguredProgram -> [String]
-- | Override environment variables for this program. These env vars will
-- extend/override the prevailing environment of the current to form the
-- environment for the new process.
[programOverrideEnv] :: ConfiguredProgram -> [(String, Maybe String)]
-- | A key-value map listing various properties of the program, useful for
-- feature detection. Populated during the configuration step, key names
-- depend on the specific program.
[programProperties] :: ConfiguredProgram -> Map String String
-- | Location of the program. eg. <tt>/usr/bin/ghc-6.4</tt>
[programLocation] :: ConfiguredProgram -> ProgramLocation
-- | In addition to the <a>programLocation</a> where the program was found,
-- these are additional locations that were looked at. The combination of
-- ths found location and these not-found locations can be used to
-- monitor to detect when the re-configuring the program might give a
-- different result (e.g. found in a different location).
[programMonitorFiles] :: ConfiguredProgram -> [FilePath]
-- | The full path of a configured program.
programPath :: ConfiguredProgram -> FilePath
type ProgArg = String
-- | Where a program was found. Also tells us whether it's specified by
-- user or not. This includes not just the path, but the program as well.
data ProgramLocation
-- | The user gave the path to this program, eg.
-- --ghc-path=/usr/bin/ghc-6.6
UserSpecified :: FilePath -> ProgramLocation
[locationPath] :: ProgramLocation -> FilePath
-- | The program was found automatically.
FoundOnSystem :: FilePath -> ProgramLocation
[locationPath] :: ProgramLocation -> FilePath
-- | Runs the given configured program.
runProgram :: Verbosity -> ConfiguredProgram -> [ProgArg] -> IO ()
-- | Runs the given configured program and gets the output.
getProgramOutput :: Verbosity -> ConfiguredProgram -> [ProgArg] -> IO String
-- | Suppress any extra arguments added by the user.
suppressOverrideArgs :: ConfiguredProgram -> ConfiguredProgram
-- | Represents a specific invocation of a specific program.
--
-- This is used as an intermediate type between deciding how to call a
-- program and actually doing it. This provides the opportunity to the
-- caller to adjust how the program will be called. These invocations can
-- either be run directly or turned into shell or batch scripts.
data ProgramInvocation
ProgramInvocation :: FilePath -> [String] -> [(String, Maybe String)] -> Maybe FilePath -> Maybe String -> IOEncoding -> IOEncoding -> ProgramInvocation
[progInvokePath] :: ProgramInvocation -> FilePath
[progInvokeArgs] :: ProgramInvocation -> [String]
[progInvokeEnv] :: ProgramInvocation -> [(String, Maybe String)]
[progInvokeCwd] :: ProgramInvocation -> Maybe FilePath
[progInvokeInput] :: ProgramInvocation -> Maybe String
[progInvokeInputEncoding] :: ProgramInvocation -> IOEncoding
[progInvokeOutputEncoding] :: ProgramInvocation -> IOEncoding
emptyProgramInvocation :: ProgramInvocation
simpleProgramInvocation :: FilePath -> [String] -> ProgramInvocation
programInvocation :: ConfiguredProgram -> [String] -> ProgramInvocation
runProgramInvocation :: Verbosity -> ProgramInvocation -> IO ()
getProgramInvocationOutput :: Verbosity -> ProgramInvocation -> IO String
-- | The default list of programs. These programs are typically used
-- internally to Cabal.
builtinPrograms :: [Program]
type ProgramConfiguration = ProgramDb
emptyProgramConfiguration :: ProgramConfiguration
defaultProgramConfiguration :: ProgramConfiguration
restoreProgramConfiguration :: [Program] -> ProgramConfiguration -> ProgramConfiguration
-- | Add a known program that we may configure later
addKnownProgram :: Program -> ProgramDb -> ProgramDb
addKnownPrograms :: [Program] -> ProgramDb -> ProgramDb
lookupKnownProgram :: String -> ProgramDb -> Maybe Program
knownPrograms :: ProgramDb -> [(Program, Maybe ConfiguredProgram)]
-- | Get the current <a>ProgramSearchPath</a> used by the <a>ProgramDb</a>.
-- This is the default list of locations where programs are looked for
-- when configuring them. This can be overridden for specific programs
-- (with <a>userSpecifyPath</a>), and specific known programs can modify
-- or ignore this search path in their own configuration code.
getProgramSearchPath :: ProgramDb -> ProgramSearchPath
-- | Change the current <a>ProgramSearchPath</a> used by the
-- <a>ProgramDb</a>. This will affect programs that are configured from
-- here on, so you should usually set it before configuring any programs.
setProgramSearchPath :: ProgramSearchPath -> ProgramDb -> ProgramDb
-- | User-specify this path. Basically override any path information for
-- this program in the configuration. If it's not a known program ignore
-- it.
userSpecifyPath :: String -> FilePath -> ProgramDb -> ProgramDb
-- | Like <a>userSpecifyPath</a> but for a list of progs and their paths.
userSpecifyPaths :: [(String, FilePath)] -> ProgramDb -> ProgramDb
userMaybeSpecifyPath :: String -> Maybe FilePath -> ProgramDb -> ProgramDb
-- | User-specify the arguments for this program. Basically override any
-- args information for this program in the configuration. If it's not a
-- known program, ignore it..
userSpecifyArgs :: String -> [ProgArg] -> ProgramDb -> ProgramDb
-- | Like <a>userSpecifyPath</a> but for a list of progs and their args.
userSpecifyArgss :: [(String, [ProgArg])] -> ProgramDb -> ProgramDb
-- | Get any extra args that have been previously specified for a program.
userSpecifiedArgs :: Program -> ProgramDb -> [ProgArg]
-- | Try to find a configured program
lookupProgram :: Program -> ProgramDb -> Maybe ConfiguredProgram
-- | Check that a program is configured and available to be run.
--
-- Additionally check that the program version number is suitable and
-- return it. For example you could require <a>AnyVersion</a> or
-- <tt><a>orLaterVersion</a> (<a>Version</a> [1,0] [])</tt>
--
-- It returns the configured program, its version number and a possibly
-- updated <a>ProgramDb</a>. If the program could not be configured or
-- the version is unsuitable, it returns an error value.
lookupProgramVersion :: Verbosity -> Program -> VersionRange -> ProgramDb -> IO (Either String (ConfiguredProgram, Version, ProgramDb))
-- | Update a configured program in the database.
updateProgram :: ConfiguredProgram -> ProgramDb -> ProgramDb
-- | Try to configure a specific program. If the program is already
-- included in the collection of unconfigured programs then we use any
-- user-supplied location and arguments. If the program gets configured
-- successfully it gets added to the configured collection.
--
-- Note that it is not a failure if the program cannot be configured.
-- It's only a failure if the user supplied a location and the program
-- could not be found at that location.
--
-- The reason for it not being a failure at this stage is that we don't
-- know up front all the programs we will need, so we try to configure
-- them all. To verify that a program was actually successfully
-- configured use <a>requireProgram</a>.
configureProgram :: Verbosity -> Program -> ProgramDb -> IO ProgramDb
-- | Try to configure all the known programs that have not yet been
-- configured.
configureAllKnownPrograms :: Verbosity -> ProgramDb -> IO ProgramDb
-- | reconfigure a bunch of programs given new user-specified args. It
-- takes the same inputs as <a>userSpecifyPath</a> and
-- <a>userSpecifyArgs</a> and for all progs with a new path it calls
-- <a>configureProgram</a>.
reconfigurePrograms :: Verbosity -> [(String, FilePath)] -> [(String, [ProgArg])] -> ProgramDb -> IO ProgramDb
-- | Check that a program is configured and available to be run.
--
-- It raises an exception if the program could not be configured,
-- otherwise it returns the configured program.
requireProgram :: Verbosity -> Program -> ProgramDb -> IO (ConfiguredProgram, ProgramDb)
-- | Like <a>lookupProgramVersion</a>, but raises an exception in case of
-- error instead of returning 'Left errMsg'.
requireProgramVersion :: Verbosity -> Program -> VersionRange -> ProgramDb -> IO (ConfiguredProgram, Version, ProgramDb)
-- | Looks up the given program in the program database and runs it.
runDbProgram :: Verbosity -> Program -> ProgramDb -> [ProgArg] -> IO ()
-- | Looks up the given program in the program database and runs it.
getDbProgramOutput :: Verbosity -> Program -> ProgramDb -> [ProgArg] -> IO String
ghcProgram :: Program
ghcPkgProgram :: Program
ghcjsProgram :: Program
ghcjsPkgProgram :: Program
lhcProgram :: Program
lhcPkgProgram :: Program
hmakeProgram :: Program
jhcProgram :: Program
uhcProgram :: Program
gccProgram :: Program
arProgram :: Program
stripProgram :: Program
happyProgram :: Program
alexProgram :: Program
hsc2hsProgram :: Program
c2hsProgram :: Program
cpphsProgram :: Program
hscolourProgram :: Program
haddockProgram :: Program
greencardProgram :: Program
ldProgram :: Program
tarProgram :: Program
cppProgram :: Program
pkgConfigProgram :: Program
hpcProgram :: Program
rawSystemProgram :: Verbosity -> ConfiguredProgram -> [ProgArg] -> IO ()
rawSystemProgramStdout :: Verbosity -> ConfiguredProgram -> [ProgArg] -> IO String
rawSystemProgramConf :: Verbosity -> Program -> ProgramConfiguration -> [ProgArg] -> IO ()
rawSystemProgramStdoutConf :: Verbosity -> Program -> ProgramConfiguration -> [ProgArg] -> IO String
-- | <i>Deprecated: use findProgramOnSearchPath instead</i>
findProgramOnPath :: String -> Verbosity -> IO (Maybe FilePath)
-- | Look for a program on the path.
-- | <i>Deprecated: No longer used within Cabal, try
-- findProgramOnSearchPath</i>
findProgramLocation :: Verbosity -> FilePath -> IO (Maybe FilePath)
-- | This module provides an library interface to the <tt>strip</tt>
-- program.
module Distribution.Simple.Program.Strip
stripLib :: Verbosity -> Platform -> ProgramConfiguration -> FilePath -> IO ()
stripExe :: Verbosity -> Platform -> ProgramConfiguration -> FilePath -> IO ()
-- | This is a big module, but not very complicated. The code is very
-- regular and repetitive. It defines the command line interface for all
-- the Cabal commands. For each command (like <tt>configure</tt>,
-- <tt>build</tt> etc) it defines a type that holds all the flags, the
-- default set of flags and a <a>CommandUI</a> that maps command line
-- flags to and from the corresponding flags type.
--
-- All the flags types are instances of <a>Monoid</a>, see
-- <a>http://www.haskell.org/pipermail/cabal-devel/2007-December/001509.html</a>
-- for an explanation.
--
-- The types defined here get used in the front end and especially in
-- <tt>cabal-install</tt> which has to do quite a bit of manipulating
-- sets of command line flags.
--
-- This is actually relatively nice, it works quite well. The main change
-- it needs is to unify it with the code for managing sets of fields that
-- can be read and written from files. This would allow us to save
-- configure flags in config files.
module Distribution.Simple.Setup
-- | Flags that apply at the top level, not to any sub-command.
data GlobalFlags
GlobalFlags :: Flag Bool -> Flag Bool -> GlobalFlags
[globalVersion] :: GlobalFlags -> Flag Bool
[globalNumericVersion] :: GlobalFlags -> Flag Bool
emptyGlobalFlags :: GlobalFlags
defaultGlobalFlags :: GlobalFlags
globalCommand :: [Command action] -> CommandUI GlobalFlags
-- | Flags to <tt>configure</tt> command.
--
-- IMPORTANT: every time a new flag is added, <a>filterConfigureFlags</a>
-- should be updated.
data ConfigFlags
ConfigFlags :: Last' ProgramConfiguration -> [(String, FilePath)] -> [(String, [String])] -> NubList FilePath -> Flag CompilerFlavor -> Flag FilePath -> Flag FilePath -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag ProfDetailLevel -> Flag ProfDetailLevel -> [String] -> Flag OptimisationLevel -> Flag PathTemplate -> Flag PathTemplate -> InstallDirs (Flag PathTemplate) -> Flag FilePath -> [FilePath] -> [FilePath] -> [FilePath] -> Flag String -> Flag FilePath -> Flag Verbosity -> Flag Bool -> [Maybe PackageDB] -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> [Dependency] -> [(PackageName, UnitId)] -> FlagAssignment -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag String -> Flag Bool -> Flag DebugInfoLevel -> Maybe AllowNewer -> ConfigFlags
-- | All programs that <tt>cabal</tt> may run
[configPrograms_] :: ConfigFlags -> Last' ProgramConfiguration
-- | user specified programs paths
[configProgramPaths] :: ConfigFlags -> [(String, FilePath)]
-- | user specified programs args
[configProgramArgs] :: ConfigFlags -> [(String, [String])]
-- | Extend the $PATH
[configProgramPathExtra] :: ConfigFlags -> NubList FilePath
-- | The "flavor" of the compiler, such as GHC or JHC.
[configHcFlavor] :: ConfigFlags -> Flag CompilerFlavor
-- | given compiler location
[configHcPath] :: ConfigFlags -> Flag FilePath
-- | given hc-pkg location
[configHcPkg] :: ConfigFlags -> Flag FilePath
-- | Enable vanilla library
[configVanillaLib] :: ConfigFlags -> Flag Bool
-- | Enable profiling in the library
[configProfLib] :: ConfigFlags -> Flag Bool
-- | Build shared library
[configSharedLib] :: ConfigFlags -> Flag Bool
-- | Enable dynamic linking of the executables.
[configDynExe] :: ConfigFlags -> Flag Bool
-- | Enable profiling in the executables.
[configProfExe] :: ConfigFlags -> Flag Bool
-- | Enable profiling in the library and executables.
[configProf] :: ConfigFlags -> Flag Bool
-- | Profiling detail level in the library and executables.
[configProfDetail] :: ConfigFlags -> Flag ProfDetailLevel
-- | Profiling detail level in the library
[configProfLibDetail] :: ConfigFlags -> Flag ProfDetailLevel
-- | Extra arguments to <tt>configure</tt>
[configConfigureArgs] :: ConfigFlags -> [String]
-- | Enable optimization.
[configOptimization] :: ConfigFlags -> Flag OptimisationLevel
-- | Installed executable prefix.
[configProgPrefix] :: ConfigFlags -> Flag PathTemplate
-- | Installed executable suffix.
[configProgSuffix] :: ConfigFlags -> Flag PathTemplate
-- | Installation paths
[configInstallDirs] :: ConfigFlags -> InstallDirs (Flag PathTemplate)
[configScratchDir] :: ConfigFlags -> Flag FilePath
-- | path to search for extra libraries
[configExtraLibDirs] :: ConfigFlags -> [FilePath]
-- | path to search for extra frameworks (OS X only)
[configExtraFrameworkDirs] :: ConfigFlags -> [FilePath]
-- | path to search for header files
[configExtraIncludeDirs] :: ConfigFlags -> [FilePath]
-- | explicit IPID to be used
[configIPID] :: ConfigFlags -> Flag String
-- | "dist" prefix
[configDistPref] :: ConfigFlags -> Flag FilePath
-- | verbosity level
[configVerbosity] :: ConfigFlags -> Flag Verbosity
-- | The --user/--global flag
[configUserInstall] :: ConfigFlags -> Flag Bool
-- | Which package DBs to use
[configPackageDBs] :: ConfigFlags -> [Maybe PackageDB]
-- | Enable compiling library for GHCi
[configGHCiLib] :: ConfigFlags -> Flag Bool
-- | Enable -split-objs with GHC
[configSplitObjs] :: ConfigFlags -> Flag Bool
-- | Enable executable stripping
[configStripExes] :: ConfigFlags -> Flag Bool
-- | Enable library stripping
[configStripLibs] :: ConfigFlags -> Flag Bool
-- | Additional constraints for dependencies.
[configConstraints] :: ConfigFlags -> [Dependency]
-- | The packages depended on.
[configDependencies] :: ConfigFlags -> [(PackageName, UnitId)]
[configConfigurationsFlags] :: ConfigFlags -> FlagAssignment
-- | Enable test suite compilation
[configTests] :: ConfigFlags -> Flag Bool
-- | Enable benchmark compilation
[configBenchmarks] :: ConfigFlags -> Flag Bool
-- | Enable program coverage
[configCoverage] :: ConfigFlags -> Flag Bool
-- | Enable program coverage (deprecated)
[configLibCoverage] :: ConfigFlags -> Flag Bool
-- | All direct dependencies and flags are provided on the command line by
-- the user via the '--dependency' and '--flags' options.
[configExactConfiguration] :: ConfigFlags -> Flag Bool
-- | Halt and show an error message indicating an error in flag assignment
[configFlagError] :: ConfigFlags -> Flag String
-- | Enable relocatable package built
[configRelocatable] :: ConfigFlags -> Flag Bool
-- | Emit debug info.
[configDebugInfo] :: ConfigFlags -> Flag DebugInfoLevel
-- | Ignore upper bounds on all or some dependencies. Wrapped in
-- <a>Maybe</a> to distinguish between "default" and "explicitly
-- disabled".
[configAllowNewer] :: ConfigFlags -> Maybe AllowNewer
emptyConfigFlags :: ConfigFlags
defaultConfigFlags :: ProgramConfiguration -> ConfigFlags
configureCommand :: ProgramConfiguration -> CommandUI ConfigFlags
-- | More convenient version of <a>configPrograms</a>. Results in an
-- <a>error</a> if internal invariant is violated.
configPrograms :: ConfigFlags -> ProgramConfiguration
-- | Policy for relaxing upper bounds in dependencies. For example, given
-- 'build-depends: array >= 0.3 && < 0.5', are we allowed
-- to relax the upper bound and choose a version of <tt>array</tt> that
-- is greater or equal to 0.5? By default the upper bounds are always
-- strictly honored.
data AllowNewer
-- | Default: honor the upper bounds in all dependencies, never choose
-- versions newer than allowed.
AllowNewerNone :: AllowNewer
-- | Ignore upper bounds in dependencies on the given packages.
AllowNewerSome :: [AllowNewerDep] -> AllowNewer
-- | Ignore upper bounds in dependencies on all packages.
AllowNewerAll :: AllowNewer
-- | Dependencies can be relaxed either for all packages in the install
-- plan, or only for some packages.
data AllowNewerDep
AllowNewerDep :: PackageName -> AllowNewerDep
AllowNewerDepScoped :: PackageName -> PackageName -> AllowNewerDep
-- | Convert <a>AllowNewer</a> to a boolean.
isAllowNewer :: AllowNewer -> Bool
configAbsolutePaths :: ConfigFlags -> IO ConfigFlags
readPackageDbList :: String -> [Maybe PackageDB]
showPackageDbList :: [Maybe PackageDB] -> [String]
-- | Flags to <tt>copy</tt>: (destdir, copy-prefix (backwards compat),
-- verbosity)
data CopyFlags
CopyFlags :: Flag CopyDest -> Flag FilePath -> Flag Verbosity -> CopyFlags
[copyDest] :: CopyFlags -> Flag CopyDest
[copyDistPref] :: CopyFlags -> Flag FilePath
[copyVerbosity] :: CopyFlags -> Flag Verbosity
emptyCopyFlags :: CopyFlags
defaultCopyFlags :: CopyFlags
copyCommand :: CommandUI CopyFlags
-- | Flags to <tt>install</tt>: (package db, verbosity)
data InstallFlags
InstallFlags :: Flag PackageDB -> Flag FilePath -> Flag Bool -> Flag Bool -> Flag Verbosity -> InstallFlags
[installPackageDB] :: InstallFlags -> Flag PackageDB
[installDistPref] :: InstallFlags -> Flag FilePath
[installUseWrapper] :: InstallFlags -> Flag Bool
[installInPlace] :: InstallFlags -> Flag Bool
[installVerbosity] :: InstallFlags -> Flag Verbosity
emptyInstallFlags :: InstallFlags
defaultInstallFlags :: InstallFlags
installCommand :: CommandUI InstallFlags
-- | When we build haddock documentation, there are two cases:
--
-- <ol>
-- <li>We build haddocks only for the current development version,
-- intended for local use and not for distribution. In this case, we
-- store the generated documentation in
-- <tt><a>dist</a><i>doc</i>html/<a>name</a></tt>.</li>
-- <li>We build haddocks for intended for uploading them to hackage. In
-- this case, we need to follow the layout that hackage expects from
-- documentation tarballs, and we might also want to use different flags
-- than for development builds, so in this case we store the generated
-- documentation in
-- <tt><a>dist</a><i>doc</i>html/<a>id</a>-docs</tt>.</li>
-- </ol>
data HaddockTarget
ForHackage :: HaddockTarget
ForDevelopment :: HaddockTarget
data HaddockFlags
HaddockFlags :: [(String, FilePath)] -> [(String, [String])] -> Flag Bool -> Flag Bool -> Flag String -> Flag HaddockTarget -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag FilePath -> Flag Bool -> Flag FilePath -> Flag PathTemplate -> Flag FilePath -> Flag Bool -> Flag Verbosity -> HaddockFlags
[haddockProgramPaths] :: HaddockFlags -> [(String, FilePath)]
[haddockProgramArgs] :: HaddockFlags -> [(String, [String])]
[haddockHoogle] :: HaddockFlags -> Flag Bool
[haddockHtml] :: HaddockFlags -> Flag Bool
[haddockHtmlLocation] :: HaddockFlags -> Flag String
[haddockForHackage] :: HaddockFlags -> Flag HaddockTarget
[haddockExecutables] :: HaddockFlags -> Flag Bool
[haddockTestSuites] :: HaddockFlags -> Flag Bool
[haddockBenchmarks] :: HaddockFlags -> Flag Bool
[haddockInternal] :: HaddockFlags -> Flag Bool
[haddockCss] :: HaddockFlags -> Flag FilePath
[haddockHscolour] :: HaddockFlags -> Flag Bool
[haddockHscolourCss] :: HaddockFlags -> Flag FilePath
[haddockContents] :: HaddockFlags -> Flag PathTemplate
[haddockDistPref] :: HaddockFlags -> Flag FilePath
[haddockKeepTempFiles] :: HaddockFlags -> Flag Bool
[haddockVerbosity] :: HaddockFlags -> Flag Verbosity
emptyHaddockFlags :: HaddockFlags
defaultHaddockFlags :: HaddockFlags
haddockCommand :: CommandUI HaddockFlags
data HscolourFlags
HscolourFlags :: Flag FilePath -> Flag Bool -> Flag Bool -> Flag Bool -> Flag FilePath -> Flag Verbosity -> HscolourFlags
[hscolourCSS] :: HscolourFlags -> Flag FilePath
[hscolourExecutables] :: HscolourFlags -> Flag Bool
[hscolourTestSuites] :: HscolourFlags -> Flag Bool
[hscolourBenchmarks] :: HscolourFlags -> Flag Bool
[hscolourDistPref] :: HscolourFlags -> Flag FilePath
[hscolourVerbosity] :: HscolourFlags -> Flag Verbosity
emptyHscolourFlags :: HscolourFlags
defaultHscolourFlags :: HscolourFlags
hscolourCommand :: CommandUI HscolourFlags
data BuildFlags
BuildFlags :: [(String, FilePath)] -> [(String, [String])] -> Flag FilePath -> Flag Verbosity -> Flag (Maybe Int) -> [String] -> BuildFlags
[buildProgramPaths] :: BuildFlags -> [(String, FilePath)]
[buildProgramArgs] :: BuildFlags -> [(String, [String])]
[buildDistPref] :: BuildFlags -> Flag FilePath
[buildVerbosity] :: BuildFlags -> Flag Verbosity
[buildNumJobs] :: BuildFlags -> Flag (Maybe Int)
[buildArgs] :: BuildFlags -> [String]
emptyBuildFlags :: BuildFlags
defaultBuildFlags :: BuildFlags
buildCommand :: ProgramConfiguration -> CommandUI BuildFlags
-- | <i>Deprecated: Use buildVerbosity instead</i>
buildVerbose :: BuildFlags -> Verbosity
data ReplFlags
ReplFlags :: [(String, FilePath)] -> [(String, [String])] -> Flag FilePath -> Flag Verbosity -> Flag Bool -> ReplFlags
[replProgramPaths] :: ReplFlags -> [(String, FilePath)]
[replProgramArgs] :: ReplFlags -> [(String, [String])]
[replDistPref] :: ReplFlags -> Flag FilePath
[replVerbosity] :: ReplFlags -> Flag Verbosity
[replReload] :: ReplFlags -> Flag Bool
defaultReplFlags :: ReplFlags
replCommand :: ProgramConfiguration -> CommandUI ReplFlags
data CleanFlags
CleanFlags :: Flag Bool -> Flag FilePath -> Flag Verbosity -> CleanFlags
[cleanSaveConf] :: CleanFlags -> Flag Bool
[cleanDistPref] :: CleanFlags -> Flag FilePath
[cleanVerbosity] :: CleanFlags -> Flag Verbosity
emptyCleanFlags :: CleanFlags
defaultCleanFlags :: CleanFlags
cleanCommand :: CommandUI CleanFlags
-- | Flags to <tt>register</tt> and <tt>unregister</tt>: (user package,
-- gen-script, in-place, verbosity)
data RegisterFlags
RegisterFlags :: Flag PackageDB -> Flag Bool -> Flag (Maybe FilePath) -> Flag Bool -> Flag FilePath -> Flag Bool -> Flag Verbosity -> RegisterFlags
[regPackageDB] :: RegisterFlags -> Flag PackageDB
[regGenScript] :: RegisterFlags -> Flag Bool
[regGenPkgConf] :: RegisterFlags -> Flag (Maybe FilePath)
[regInPlace] :: RegisterFlags -> Flag Bool
[regDistPref] :: RegisterFlags -> Flag FilePath
[regPrintId] :: RegisterFlags -> Flag Bool
[regVerbosity] :: RegisterFlags -> Flag Verbosity
emptyRegisterFlags :: RegisterFlags
defaultRegisterFlags :: RegisterFlags
registerCommand :: CommandUI RegisterFlags
unregisterCommand :: CommandUI RegisterFlags
-- | Flags to <tt>sdist</tt>: (snapshot, verbosity)
data SDistFlags
SDistFlags :: Flag Bool -> Flag FilePath -> Flag FilePath -> Flag FilePath -> Flag Verbosity -> SDistFlags
[sDistSnapshot] :: SDistFlags -> Flag Bool
[sDistDirectory] :: SDistFlags -> Flag FilePath
[sDistDistPref] :: SDistFlags -> Flag FilePath
[sDistListSources] :: SDistFlags -> Flag FilePath
[sDistVerbosity] :: SDistFlags -> Flag Verbosity
emptySDistFlags :: SDistFlags
defaultSDistFlags :: SDistFlags
sdistCommand :: CommandUI SDistFlags
data TestFlags
TestFlags :: Flag FilePath -> Flag Verbosity -> Flag PathTemplate -> Flag PathTemplate -> Flag TestShowDetails -> Flag Bool -> [PathTemplate] -> TestFlags
[testDistPref] :: TestFlags -> Flag FilePath
[testVerbosity] :: TestFlags -> Flag Verbosity
[testHumanLog] :: TestFlags -> Flag PathTemplate
[testMachineLog] :: TestFlags -> Flag PathTemplate
[testShowDetails] :: TestFlags -> Flag TestShowDetails
[testKeepTix] :: TestFlags -> Flag Bool
[testOptions] :: TestFlags -> [PathTemplate]
emptyTestFlags :: TestFlags
defaultTestFlags :: TestFlags
testCommand :: CommandUI TestFlags
data TestShowDetails
Never :: TestShowDetails
Failures :: TestShowDetails
Always :: TestShowDetails
Streaming :: TestShowDetails
Direct :: TestShowDetails
data BenchmarkFlags
BenchmarkFlags :: Flag FilePath -> Flag Verbosity -> [PathTemplate] -> BenchmarkFlags
[benchmarkDistPref] :: BenchmarkFlags -> Flag FilePath
[benchmarkVerbosity] :: BenchmarkFlags -> Flag Verbosity
[benchmarkOptions] :: BenchmarkFlags -> [PathTemplate]
emptyBenchmarkFlags :: BenchmarkFlags
defaultBenchmarkFlags :: BenchmarkFlags
benchmarkCommand :: CommandUI BenchmarkFlags
-- | The location prefix for the <i>copy</i> command.
data CopyDest
NoCopyDest :: CopyDest
CopyTo :: FilePath -> CopyDest
-- | Arguments to pass to a <tt>configure</tt> script, e.g. generated by
-- <tt>autoconf</tt>.
configureArgs :: Bool -> ConfigFlags -> [String]
configureOptions :: ShowOrParseArgs -> [OptionField ConfigFlags]
configureCCompiler :: Verbosity -> ProgramConfiguration -> IO (FilePath, [String])
configureLinker :: Verbosity -> ProgramConfiguration -> IO (FilePath, [String])
buildOptions :: ProgramConfiguration -> ShowOrParseArgs -> [OptionField BuildFlags]
haddockOptions :: ShowOrParseArgs -> [OptionField HaddockFlags]
installDirsOptions :: [OptionField (InstallDirs (Flag PathTemplate))]
-- | For each known program <tt>PROG</tt> in <tt>progConf</tt>, produce a
-- <tt>PROG-options</tt> <a>OptionField</a>.
programConfigurationOptions :: ProgramConfiguration -> ShowOrParseArgs -> (flags -> [(String, [String])]) -> ([(String, [String])] -> (flags -> flags)) -> [OptionField flags]
-- | Like <a>programConfigurationPaths</a>, but allows to customise the
-- option name.
programConfigurationPaths' :: (String -> String) -> ProgramConfiguration -> ShowOrParseArgs -> (flags -> [(String, FilePath)]) -> ([(String, FilePath)] -> (flags -> flags)) -> [OptionField flags]
-- | Helper function to split a string into a list of arguments. It's
-- supposed to handle quoted things sensibly, eg:
--
-- <pre>
-- splitArgs "--foo=\"C:\Program Files\Bar\" --baz"
-- = ["--foo=C:\Program Files\Bar", "--baz"]
-- </pre>
splitArgs :: String -> [String]
defaultDistPref :: FilePath
optionDistPref :: (flags -> Flag FilePath) -> (Flag FilePath -> flags -> flags) -> ShowOrParseArgs -> OptionField flags
-- | All flags are monoids, they come in two flavours:
--
-- <ol>
-- <li>list flags eg</li>
-- </ol>
--
-- <pre>
-- --ghc-option=foo --ghc-option=bar
-- </pre>
--
-- gives us all the values ["foo", "bar"]
--
-- <ol>
-- <li>singular value flags, eg:</li>
-- </ol>
--
-- <pre>
-- --enable-foo --disable-foo
-- </pre>
--
-- gives us Just False So this Flag type is for the latter singular kind
-- of flag. Its monoid instance gives us the behaviour where it starts
-- out as <a>NoFlag</a> and later flags override earlier ones.
data Flag a
Flag :: a -> Flag a
NoFlag :: Flag a
toFlag :: a -> Flag a
fromFlag :: Flag a -> a
fromFlagOrDefault :: a -> Flag a -> a
flagToMaybe :: Flag a -> Maybe a
flagToList :: Flag a -> [a]
boolOpt :: SFlags -> SFlags -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
boolOpt' :: OptFlags -> OptFlags -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
trueArg :: MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
falseArg :: MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
optionVerbosity :: (flags -> Flag Verbosity) -> (Flag Verbosity -> flags -> flags) -> OptionField flags
optionNumJobs :: (flags -> Flag (Maybe Int)) -> (Flag (Maybe Int) -> flags -> flags) -> OptionField flags
readPToMaybe :: ReadP a a -> String -> Maybe a
instance GHC.Generics.Generic Distribution.Simple.Setup.BenchmarkFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.TestFlags
instance GHC.Show.Show Distribution.Simple.Setup.TestShowDetails
instance GHC.Enum.Bounded Distribution.Simple.Setup.TestShowDetails
instance GHC.Enum.Enum Distribution.Simple.Setup.TestShowDetails
instance GHC.Classes.Ord Distribution.Simple.Setup.TestShowDetails
instance GHC.Classes.Eq Distribution.Simple.Setup.TestShowDetails
instance GHC.Generics.Generic Distribution.Simple.Setup.ReplFlags
instance GHC.Show.Show Distribution.Simple.Setup.ReplFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.BuildFlags
instance GHC.Show.Show Distribution.Simple.Setup.BuildFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.CleanFlags
instance GHC.Show.Show Distribution.Simple.Setup.CleanFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.HaddockFlags
instance GHC.Show.Show Distribution.Simple.Setup.HaddockFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.HaddockTarget
instance GHC.Show.Show Distribution.Simple.Setup.HaddockTarget
instance GHC.Classes.Eq Distribution.Simple.Setup.HaddockTarget
instance GHC.Generics.Generic Distribution.Simple.Setup.HscolourFlags
instance GHC.Show.Show Distribution.Simple.Setup.HscolourFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.RegisterFlags
instance GHC.Show.Show Distribution.Simple.Setup.RegisterFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.SDistFlags
instance GHC.Show.Show Distribution.Simple.Setup.SDistFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.InstallFlags
instance GHC.Show.Show Distribution.Simple.Setup.InstallFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.CopyFlags
instance GHC.Show.Show Distribution.Simple.Setup.CopyFlags
instance GHC.Show.Show Distribution.Simple.Setup.ConfigFlags
instance GHC.Read.Read Distribution.Simple.Setup.ConfigFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.ConfigFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.AllowNewer
instance GHC.Show.Show Distribution.Simple.Setup.AllowNewer
instance GHC.Read.Read Distribution.Simple.Setup.AllowNewer
instance GHC.Classes.Eq Distribution.Simple.Setup.AllowNewer
instance GHC.Generics.Generic Distribution.Simple.Setup.AllowNewerDep
instance GHC.Show.Show Distribution.Simple.Setup.AllowNewerDep
instance GHC.Read.Read Distribution.Simple.Setup.AllowNewerDep
instance GHC.Classes.Eq Distribution.Simple.Setup.AllowNewerDep
instance GHC.Generics.Generic Distribution.Simple.Setup.GlobalFlags
instance GHC.Read.Read a => GHC.Read.Read (Distribution.Simple.Setup.Flag a)
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Simple.Setup.Flag a)
instance GHC.Generics.Generic (Distribution.Simple.Setup.Flag a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Distribution.Simple.Setup.Flag a)
instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Distribution.Simple.Setup.Flag a)
instance GHC.Base.Functor Distribution.Simple.Setup.Flag
instance GHC.Base.Monoid (Distribution.Simple.Setup.Flag a)
instance Data.Semigroup.Semigroup (Distribution.Simple.Setup.Flag a)
instance GHC.Enum.Bounded a => GHC.Enum.Bounded (Distribution.Simple.Setup.Flag a)
instance GHC.Enum.Enum a => GHC.Enum.Enum (Distribution.Simple.Setup.Flag a)
instance GHC.Base.Monoid Distribution.Simple.Setup.GlobalFlags
instance Data.Semigroup.Semigroup Distribution.Simple.Setup.GlobalFlags
instance Distribution.Text.Text Distribution.Simple.Setup.AllowNewerDep
instance Data.Binary.Class.Binary Distribution.Simple.Setup.AllowNewer
instance Data.Binary.Class.Binary Distribution.Simple.Setup.AllowNewerDep
instance Data.Semigroup.Semigroup Distribution.Simple.Setup.AllowNewer
instance GHC.Base.Monoid Distribution.Simple.Setup.AllowNewer
instance Data.Binary.Class.Binary Distribution.Simple.Setup.ConfigFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.ConfigFlags
instance Data.Semigroup.Semigroup Distribution.Simple.Setup.ConfigFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.CopyFlags
instance Data.Semigroup.Semigroup Distribution.Simple.Setup.CopyFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.InstallFlags
instance Data.Semigroup.Semigroup Distribution.Simple.Setup.InstallFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.SDistFlags
instance Data.Semigroup.Semigroup Distribution.Simple.Setup.SDistFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.RegisterFlags
instance Data.Semigroup.Semigroup Distribution.Simple.Setup.RegisterFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.HscolourFlags
instance Data.Semigroup.Semigroup Distribution.Simple.Setup.HscolourFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.HaddockFlags
instance Data.Semigroup.Semigroup Distribution.Simple.Setup.HaddockFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.CleanFlags
instance Data.Semigroup.Semigroup Distribution.Simple.Setup.CleanFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.BuildFlags
instance Data.Semigroup.Semigroup Distribution.Simple.Setup.BuildFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.ReplFlags
instance Data.Semigroup.Semigroup Distribution.Simple.Setup.ReplFlags
instance Distribution.Text.Text Distribution.Simple.Setup.TestShowDetails
instance GHC.Base.Monoid Distribution.Simple.Setup.TestShowDetails
instance Data.Semigroup.Semigroup Distribution.Simple.Setup.TestShowDetails
instance GHC.Base.Monoid Distribution.Simple.Setup.TestFlags
instance Data.Semigroup.Semigroup Distribution.Simple.Setup.TestFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.BenchmarkFlags
instance Data.Semigroup.Semigroup Distribution.Simple.Setup.BenchmarkFlags
-- | This is an alternative build system that delegates everything to the
-- <tt>make</tt> program. All the commands just end up calling
-- <tt>make</tt> with appropriate arguments. The intention was to allow
-- preexisting packages that used makefiles to be wrapped into Cabal
-- packages. In practice essentially all such packages were converted
-- over to the "Simple" build system instead. Consequently this module is
-- not used much and it certainly only sees cursory maintenance and no
-- testing. Perhaps at some point we should stop pretending that it
-- works.
--
-- Uses the parsed command-line from <a>Distribution.Simple.Setup</a> in
-- order to build Haskell tools using a back-end build system based on
-- make. Obviously we assume that there is a configure script, and that
-- after the ConfigCmd has been run, there is a Makefile. Further
-- assumptions:
--
-- <ul>
-- <li><i>ConfigCmd</i> We assume the configure script accepts
-- <tt>--with-hc</tt>, <tt>--with-hc-pkg</tt>, <tt>--prefix</tt>,
-- <tt>--bindir</tt>, <tt>--libdir</tt>, <tt>--libexecdir</tt>,
-- <tt>--datadir</tt>.</li>
-- <li><i>BuildCmd</i> We assume that the default Makefile target will
-- build everything.</li>
-- <li><i>InstallCmd</i> We assume there is an <tt>install</tt> target.
-- Note that we assume that this does *not* register the package!</li>
-- <li><i>CopyCmd</i> We assume there is a <tt>copy</tt> target, and a
-- variable <tt>$(destdir)</tt>. The <tt>copy</tt> target should probably
-- just invoke <tt>make install</tt> recursively (e.g. <tt>$(MAKE)
-- install prefix=$(destdir)/$(prefix) bindir=$(destdir)/$(bindir)</tt>.
-- The reason we can't invoke <tt>make install</tt> directly here is that
-- we don't know the value of <tt>$(prefix)</tt>.</li>
-- <li><i>SDistCmd</i> We assume there is a <tt>dist</tt> target.</li>
-- <li><i>RegisterCmd</i> We assume there is a <tt>register</tt> target
-- and a variable <tt>$(user)</tt>.</li>
-- <li><i>UnregisterCmd</i> We assume there is an <tt>unregister</tt>
-- target.</li>
-- <li><i>HaddockCmd</i> We assume there is a <tt>docs</tt> or
-- <tt>doc</tt> target.</li>
-- </ul>
module Distribution.Make
-- | Indicates the license under which a package's source code is released.
-- Versions of the licenses not listed here will be rejected by Hackage
-- and cause <tt>cabal check</tt> to issue a warning.
data License
-- | GNU General Public License, <a>version 2</a> or <a>version 3</a>.
GPL :: (Maybe Version) -> License
-- | <a>GNU Affero General Public License, version 3</a>.
AGPL :: (Maybe Version) -> License
-- | GNU Lesser General Public License, <a>version 2.1</a> or <a>version
-- 3</a>.
LGPL :: (Maybe Version) -> License
-- | <a>2-clause BSD license</a>.
BSD2 :: License
-- | <a>3-clause BSD license</a>.
BSD3 :: License
-- | <a>4-clause BSD license</a>. This license has not been approved by the
-- OSI and is incompatible with the GNU GPL. It is provided for
-- historical reasons and should be avoided.
BSD4 :: License
-- | <a>MIT license</a>.
MIT :: License
-- | <a>ISC license</a>
ISC :: License
-- | <a>Mozilla Public License, version 2.0</a>.
MPL :: Version -> License
-- | <a>Apache License, version 2.0</a>.
Apache :: (Maybe Version) -> License
-- | The author of a package disclaims any copyright to its source code and
-- dedicates it to the public domain. This is not a software license.
-- Please note that it is not possible to dedicate works to the public
-- domain in every jurisdiction, nor is a work that is in the public
-- domain in one jurisdiction necessarily in the public domain elsewhere.
PublicDomain :: License
-- | Explicitly 'All Rights Reserved', eg for proprietary software. The
-- package may not be legally modified or redistributed by anyone but the
-- rightsholder.
AllRightsReserved :: License
-- | No license specified which legally defaults to 'All Rights Reserved'.
-- The package may not be legally modified or redistributed by anyone but
-- the rightsholder.
UnspecifiedLicense :: License
-- | Any other software license.
OtherLicense :: License
-- | Indicates an erroneous license name.
UnknownLicense :: String -> License
-- | A <a>Version</a> represents the version of a software entity.
--
-- An instance of <a>Eq</a> is provided, which implements exact equality
-- modulo reordering of the tags in the <a>versionTags</a> field.
--
-- An instance of <a>Ord</a> is also provided, which gives lexicographic
-- ordering on the <a>versionBranch</a> fields (i.e. 2.1 > 2.0, 1.2.3
-- > 1.2.2, etc.). This is expected to be sufficient for many uses,
-- but note that you may need to use a more specific ordering for your
-- versioning scheme. For example, some versioning schemes may include
-- pre-releases which have tags <tt>"pre1"</tt>, <tt>"pre2"</tt>, and so
-- on, and these would need to be taken into account when determining
-- ordering. In some cases, date ordering may be more appropriate, so the
-- application would have to look for <tt>date</tt> tags in the
-- <a>versionTags</a> field and compare those. The bottom line is, don't
-- always assume that <a>compare</a> and other <a>Ord</a> operations are
-- the right thing for every <a>Version</a>.
--
-- Similarly, concrete representations of versions may differ. One
-- possible concrete representation is provided (see <a>showVersion</a>
-- and <a>parseVersion</a>), but depending on the application a different
-- concrete representation may be more appropriate.
data Version :: *
Version :: [Int] -> [String] -> Version
-- | The numeric branch for this version. This reflects the fact that most
-- software versions are tree-structured; there is a main trunk which is
-- tagged with versions at various points (1,2,3...), and the first
-- branch off the trunk after version 3 is 3.1, the second branch off the
-- trunk after version 3 is 3.2, and so on. The tree can be branched
-- arbitrarily, just by adding more digits.
--
-- We represent the branch as a list of <a>Int</a>, so version 3.2.1
-- becomes [3,2,1]. Lexicographic ordering (i.e. the default instance of
-- <a>Ord</a> for <tt>[Int]</tt>) gives the natural ordering of branches.
[versionBranch] :: Version -> [Int]
-- | A version can be tagged with an arbitrary list of strings. The
-- interpretation of the list of tags is entirely dependent on the entity
-- that this version applies to.
[versionTags] :: Version -> [String]
defaultMain :: IO ()
defaultMainArgs :: [String] -> IO ()
-- | <i>Deprecated: it ignores its PackageDescription arg</i>
defaultMainNoRead :: PackageDescription -> IO ()
-- | Once a package has been configured we have resolved conditionals and
-- dependencies, configured the compiler and other needed external
-- programs. The <a>LocalBuildInfo</a> is used to hold all this
-- information. It holds the install dirs, the compiler, the exact
-- package dependencies, the configured programs, the package database to
-- use and a bunch of miscellaneous configure flags. It gets saved and
-- reloaded from a file (<tt>dist/setup-config</tt>). It gets passed in
-- to very many subsequent build actions.
module Distribution.Simple.LocalBuildInfo
-- | Data cached after configuration step. See also <a>ConfigFlags</a>.
data LocalBuildInfo
LocalBuildInfo :: ConfigFlags -> FlagAssignment -> [String] -> InstallDirTemplates -> Compiler -> Platform -> FilePath -> [(ComponentName, ComponentLocalBuildInfo, [ComponentName])] -> InstalledPackageIndex -> Maybe FilePath -> PackageDescription -> ProgramConfiguration -> PackageDBStack -> Bool -> Bool -> Bool -> Bool -> Bool -> ProfDetailLevel -> ProfDetailLevel -> OptimisationLevel -> DebugInfoLevel -> Bool -> Bool -> Bool -> Bool -> PathTemplate -> PathTemplate -> Bool -> LocalBuildInfo
-- | Options passed to the configuration step. Needed to re-run
-- configuration when .cabal is out of date
[configFlags] :: LocalBuildInfo -> ConfigFlags
-- | The final set of flags which were picked for this package
[flagAssignment] :: LocalBuildInfo -> FlagAssignment
-- | Extra args on the command line for the configuration step. Needed to
-- re-run configuration when .cabal is out of date
[extraConfigArgs] :: LocalBuildInfo -> [String]
-- | The installation directories for the various different kinds of files
-- TODO: inplaceDirTemplates :: InstallDirs FilePath
[installDirTemplates] :: LocalBuildInfo -> InstallDirTemplates
-- | The compiler we're building with
[compiler] :: LocalBuildInfo -> Compiler
-- | The platform we're building for
[hostPlatform] :: LocalBuildInfo -> Platform
-- | Where to build the package.
[buildDir] :: LocalBuildInfo -> FilePath
-- | All the components to build, ordered by topological sort, and with
-- their dependencies over the intrapackage dependency graph
[componentsConfigs] :: LocalBuildInfo -> [(ComponentName, ComponentLocalBuildInfo, [ComponentName])]
-- | All the info about the installed packages that the current package
-- depends on (directly or indirectly).
[installedPkgs] :: LocalBuildInfo -> InstalledPackageIndex
-- | the filename containing the .cabal file, if available
[pkgDescrFile] :: LocalBuildInfo -> Maybe FilePath
-- | The resolved package description, that does not contain any
-- conditionals.
[localPkgDescr] :: LocalBuildInfo -> PackageDescription
-- | Location and args for all programs
[withPrograms] :: LocalBuildInfo -> ProgramConfiguration
-- | What package database to use, global/user
[withPackageDB] :: LocalBuildInfo -> PackageDBStack
-- | Whether to build normal libs.
[withVanillaLib] :: LocalBuildInfo -> Bool
-- | Whether to build profiling versions of libs.
[withProfLib] :: LocalBuildInfo -> Bool
-- | Whether to build shared versions of libs.
[withSharedLib] :: LocalBuildInfo -> Bool
-- | Whether to link executables dynamically
[withDynExe] :: LocalBuildInfo -> Bool
-- | Whether to build executables for profiling.
[withProfExe] :: LocalBuildInfo -> Bool
-- | Level of automatic profile detail.
[withProfLibDetail] :: LocalBuildInfo -> ProfDetailLevel
-- | Level of automatic profile detail.
[withProfExeDetail] :: LocalBuildInfo -> ProfDetailLevel
-- | Whether to build with optimization (if available).
[withOptimization] :: LocalBuildInfo -> OptimisationLevel
-- | Whether to emit debug info (if available).
[withDebugInfo] :: LocalBuildInfo -> DebugInfoLevel
-- | Whether to build libs suitable for use with GHCi.
[withGHCiLib] :: LocalBuildInfo -> Bool
-- | Use -split-objs with GHC, if available
[splitObjs] :: LocalBuildInfo -> Bool
-- | Whether to strip executables during install
[stripExes] :: LocalBuildInfo -> Bool
-- | Whether to strip libraries during install
[stripLibs] :: LocalBuildInfo -> Bool
-- | Prefix to be prepended to installed executables
[progPrefix] :: LocalBuildInfo -> PathTemplate
-- | Suffix to be appended to installed executables
[progSuffix] :: LocalBuildInfo -> PathTemplate
[relocatable] :: LocalBuildInfo -> Bool
-- | External package dependencies for the package as a whole. This is the
-- union of the individual <a>componentPackageDeps</a>, less any internal
-- deps.
externalPackageDeps :: LocalBuildInfo -> [(UnitId, PackageId)]
-- | Extract the <a>ComponentId</a> from the library component of a
-- <a>LocalBuildInfo</a> if it exists, or make a fake component ID based
-- on the package ID.
localComponentId :: LocalBuildInfo -> ComponentId
-- | Extract the <a>UnitId</a> from the library component of a
-- <a>LocalBuildInfo</a> if it exists, or make a fake unit ID based on
-- the package ID.
localUnitId :: LocalBuildInfo -> UnitId
-- | Extract the compatibility <a>ComponentId</a> from the library
-- component of a <a>LocalBuildInfo</a> if it exists, or make a fake
-- compatibility package key based on the package ID.
localCompatPackageKey :: LocalBuildInfo -> String
data Component
CLib :: Library -> Component
CExe :: Executable -> Component
CTest :: TestSuite -> Component
CBench :: Benchmark -> Component
data ComponentName
CLibName :: ComponentName
CExeName :: String -> ComponentName
CTestName :: String -> ComponentName
CBenchName :: String -> ComponentName
showComponentName :: ComponentName -> String
data ComponentLocalBuildInfo
LibComponentLocalBuildInfo :: [(UnitId, PackageId)] -> UnitId -> String -> [ExposedModule] -> Map PackageName ModuleRenaming -> ComponentLocalBuildInfo
-- | Resolved internal and external package dependencies for this
-- component. The <a>BuildInfo</a> specifies a set of build dependencies
-- that must be satisfied in terms of version ranges. This field fixes
-- those dependencies to the specific versions available on this machine
-- for this compiler.
[componentPackageDeps] :: ComponentLocalBuildInfo -> [(UnitId, PackageId)]
[componentUnitId] :: ComponentLocalBuildInfo -> UnitId
[componentCompatPackageKey] :: ComponentLocalBuildInfo -> String
[componentExposedModules] :: ComponentLocalBuildInfo -> [ExposedModule]
[componentPackageRenaming] :: ComponentLocalBuildInfo -> Map PackageName ModuleRenaming
ExeComponentLocalBuildInfo :: [(UnitId, PackageId)] -> Map PackageName ModuleRenaming -> ComponentLocalBuildInfo
-- | Resolved internal and external package dependencies for this
-- component. The <a>BuildInfo</a> specifies a set of build dependencies
-- that must be satisfied in terms of version ranges. This field fixes
-- those dependencies to the specific versions available on this machine
-- for this compiler.
[componentPackageDeps] :: ComponentLocalBuildInfo -> [(UnitId, PackageId)]
[componentPackageRenaming] :: ComponentLocalBuildInfo -> Map PackageName ModuleRenaming
TestComponentLocalBuildInfo :: [(UnitId, PackageId)] -> Map PackageName ModuleRenaming -> ComponentLocalBuildInfo
-- | Resolved internal and external package dependencies for this
-- component. The <a>BuildInfo</a> specifies a set of build dependencies
-- that must be satisfied in terms of version ranges. This field fixes
-- those dependencies to the specific versions available on this machine
-- for this compiler.
[componentPackageDeps] :: ComponentLocalBuildInfo -> [(UnitId, PackageId)]
[componentPackageRenaming] :: ComponentLocalBuildInfo -> Map PackageName ModuleRenaming
BenchComponentLocalBuildInfo :: [(UnitId, PackageId)] -> Map PackageName ModuleRenaming -> ComponentLocalBuildInfo
-- | Resolved internal and external package dependencies for this
-- component. The <a>BuildInfo</a> specifies a set of build dependencies
-- that must be satisfied in terms of version ranges. This field fixes
-- those dependencies to the specific versions available on this machine
-- for this compiler.
[componentPackageDeps] :: ComponentLocalBuildInfo -> [(UnitId, PackageId)]
[componentPackageRenaming] :: ComponentLocalBuildInfo -> Map PackageName ModuleRenaming
foldComponent :: (Library -> a) -> (Executable -> a) -> (TestSuite -> a) -> (Benchmark -> a) -> Component -> a
componentName :: Component -> ComponentName
componentBuildInfo :: Component -> BuildInfo
componentEnabled :: Component -> Bool
componentDisabledReason :: Component -> Maybe ComponentDisabledReason
data ComponentDisabledReason
DisabledComponent :: ComponentDisabledReason
DisabledAllTests :: ComponentDisabledReason
DisabledAllBenchmarks :: ComponentDisabledReason
-- | All the components in the package (libs, exes, or test suites).
pkgComponents :: PackageDescription -> [Component]
-- | All the components in the package that are buildable and enabled. Thus
-- this excludes non-buildable components and test suites or benchmarks
-- that have been disabled.
pkgEnabledComponents :: PackageDescription -> [Component]
lookupComponent :: PackageDescription -> ComponentName -> Maybe Component
getComponent :: PackageDescription -> ComponentName -> Component
getComponentLocalBuildInfo :: LocalBuildInfo -> ComponentName -> ComponentLocalBuildInfo
allComponentsInBuildOrder :: LocalBuildInfo -> [(ComponentName, ComponentLocalBuildInfo)]
componentsInBuildOrder :: LocalBuildInfo -> [ComponentName] -> [(ComponentName, ComponentLocalBuildInfo)]
checkComponentsCyclic :: Ord key => [(node, key, [key])] -> Maybe [(node, key, [key])]
-- | Determine the directories containing the dynamic libraries of the
-- transitive dependencies of the component we are building.
--
-- When wanted, and possible, returns paths relative to the installDirs
-- <a>prefix</a>
depLibraryPaths :: Bool -> Bool -> LocalBuildInfo -> ComponentLocalBuildInfo -> IO [FilePath]
-- | Perform the action on each buildable <a>Library</a> or
-- <a>Executable</a> (Component) in the PackageDescription, subject to
-- the build order specified by the <tt>compBuildOrder</tt> field of the
-- given <a>LocalBuildInfo</a>
withAllComponentsInBuildOrder :: PackageDescription -> LocalBuildInfo -> (Component -> ComponentLocalBuildInfo -> IO ()) -> IO ()
withComponentsInBuildOrder :: PackageDescription -> LocalBuildInfo -> [ComponentName] -> (Component -> ComponentLocalBuildInfo -> IO ()) -> IO ()
-- | <i>Deprecated: Use withAllComponentsInBuildOrder</i>
withComponentsLBI :: PackageDescription -> LocalBuildInfo -> (Component -> ComponentLocalBuildInfo -> IO ()) -> IO ()
-- | If the package description has a library section, call the given
-- function with the library build info as argument. Extended version of
-- <a>withLib</a> that also gives corresponding build info.
withLibLBI :: PackageDescription -> LocalBuildInfo -> (Library -> ComponentLocalBuildInfo -> IO ()) -> IO ()
-- | Perform the action on each buildable <a>Executable</a> in the package
-- description. Extended version of <a>withExe</a> that also gives
-- corresponding build info.
withExeLBI :: PackageDescription -> LocalBuildInfo -> (Executable -> ComponentLocalBuildInfo -> IO ()) -> IO ()
withTestLBI :: PackageDescription -> LocalBuildInfo -> (TestSuite -> ComponentLocalBuildInfo -> IO ()) -> IO ()
-- | See <a>absoluteInstallDirs</a>
absoluteInstallDirs :: PackageDescription -> LocalBuildInfo -> CopyDest -> InstallDirs FilePath
-- | See <a>prefixRelativeInstallDirs</a>
prefixRelativeInstallDirs :: PackageId -> LocalBuildInfo -> InstallDirs (Maybe FilePath)
substPathTemplate :: PackageId -> LocalBuildInfo -> PathTemplate -> FilePath
instance GHC.Show.Show Distribution.Simple.LocalBuildInfo.LocalBuildInfo
instance GHC.Read.Read Distribution.Simple.LocalBuildInfo.LocalBuildInfo
instance GHC.Generics.Generic Distribution.Simple.LocalBuildInfo.LocalBuildInfo
instance GHC.Show.Show Distribution.Simple.LocalBuildInfo.ComponentLocalBuildInfo
instance GHC.Read.Read Distribution.Simple.LocalBuildInfo.ComponentLocalBuildInfo
instance GHC.Generics.Generic Distribution.Simple.LocalBuildInfo.ComponentLocalBuildInfo
instance GHC.Show.Show Distribution.Simple.LocalBuildInfo.ComponentName
instance GHC.Read.Read Distribution.Simple.LocalBuildInfo.ComponentName
instance GHC.Classes.Ord Distribution.Simple.LocalBuildInfo.ComponentName
instance GHC.Generics.Generic Distribution.Simple.LocalBuildInfo.ComponentName
instance GHC.Classes.Eq Distribution.Simple.LocalBuildInfo.ComponentName
instance GHC.Read.Read Distribution.Simple.LocalBuildInfo.Component
instance GHC.Classes.Eq Distribution.Simple.LocalBuildInfo.Component
instance GHC.Show.Show Distribution.Simple.LocalBuildInfo.Component
instance Data.Binary.Class.Binary Distribution.Simple.LocalBuildInfo.LocalBuildInfo
instance Data.Binary.Class.Binary Distribution.Simple.LocalBuildInfo.ComponentName
instance Data.Binary.Class.Binary Distribution.Simple.LocalBuildInfo.ComponentLocalBuildInfo
-- | Generate cabal_macros.h - CPP macros for package version testing
--
-- When using CPP you get
--
-- <pre>
-- VERSION_<package>
-- MIN_VERSION_<package>(A,B,C)
-- </pre>
--
-- for each <i>package</i> in <tt>build-depends</tt>, which is true if
-- the version of <i>package</i> in use is <tt>>= A.B.C</tt>, using
-- the normal ordering on version numbers.
module Distribution.Simple.Build.Macros
-- | The contents of the <tt>cabal_macros.h</tt> for the given configured
-- package.
generate :: PackageDescription -> LocalBuildInfo -> String
-- | Helper function that generates just the <tt>VERSION_pkg</tt> and
-- <tt>MIN_VERSION_pkg</tt> macros for a list of package ids (usually
-- used with the specific deps of a configured package).
generatePackageVersionMacros :: [PackageIdentifier] -> String
-- | A bunch of dirs, paths and file names used for intermediate build
-- steps.
module Distribution.Simple.BuildPaths
defaultDistPref :: FilePath
srcPref :: FilePath -> FilePath
-- | This is the name of the directory in which the generated haddocks
-- should be stored. It does not include the
-- <tt><a>dist</a><i>doc</i>html</tt> prefix.
haddockDirName :: HaddockTarget -> PackageDescription -> FilePath
hscolourPref :: HaddockTarget -> FilePath -> PackageDescription -> FilePath
-- | The directory to which generated haddock documentation should be
-- written.
haddockPref :: HaddockTarget -> FilePath -> PackageDescription -> FilePath
-- | The directory in which we put auto-generated modules
autogenModulesDir :: LocalBuildInfo -> String
-- | The name of the auto-generated module associated with a package
autogenModuleName :: PackageDescription -> ModuleName
cppHeaderName :: String
haddockName :: PackageDescription -> FilePath
mkLibName :: UnitId -> String
mkProfLibName :: UnitId -> String
mkSharedLibName :: CompilerId -> UnitId -> String
-- | Default extension for executable files on the current platform.
-- (typically <tt>""</tt> on Unix and <tt>"exe"</tt> on Windows or OS/2)
exeExtension :: String
-- | Extension for object files. For GHC the extension is <tt>"o"</tt>.
objExtension :: String
-- | Extension for dynamically linked (or shared) libraries (typically
-- <tt>"so"</tt> on Unix and <tt>"dll"</tt> on Windows)
dllExtension :: String
-- | Generating the Paths_pkgname module.
--
-- This is a module that Cabal generates for the benefit of packages. It
-- enables them to find their version number and find any installed data
-- files at runtime. This code should probably be split off into another
-- module.
module Distribution.Simple.Build.PathsModule
generate :: PackageDescription -> LocalBuildInfo -> String
-- | Generates the name of the environment variable controlling the path
-- component of interest.
pkgPathEnvVar :: PackageDescription -> String -> String
-- | Handling for user-specified build targets
module Distribution.Simple.BuildTarget
-- | A fully resolved build target.
data BuildTarget
-- | A specific component
BuildTargetComponent :: ComponentName -> BuildTarget
-- | A specific module within a specific component.
BuildTargetModule :: ComponentName -> ModuleName -> BuildTarget
-- | A specific file within a specific component.
BuildTargetFile :: ComponentName -> FilePath -> BuildTarget
-- | Read a list of user-supplied build target strings and resolve them to
-- <a>BuildTarget</a>s according to a <a>PackageDescription</a>. If there
-- are problems with any of the targets e.g. they don't exist or are
-- misformatted, throw an <tt>IOException</tt>.
readBuildTargets :: PackageDescription -> [String] -> IO [BuildTarget]
showBuildTarget :: QualLevel -> PackageId -> BuildTarget -> String
data QualLevel
QL1 :: QualLevel
QL2 :: QualLevel
QL3 :: QualLevel
buildTargetComponentName :: BuildTarget -> ComponentName
-- | Various ways that a user may specify a build target.
data UserBuildTarget
readUserBuildTargets :: [String] -> ([UserBuildTargetProblem], [UserBuildTarget])
showUserBuildTarget :: UserBuildTarget -> String
data UserBuildTargetProblem
UserBuildTargetUnrecognised :: String -> UserBuildTargetProblem
reportUserBuildTargetProblems :: [UserBuildTargetProblem] -> IO ()
-- | Given a bunch of user-specified targets, try to resolve what it is
-- they refer to.
resolveBuildTargets :: PackageDescription -> [(UserBuildTarget, Bool)] -> ([BuildTargetProblem], [BuildTarget])
data BuildTargetProblem
-- | <ul>
-- <li><i>expected thing</i> (actually got)</li>
-- </ul>
BuildTargetExpected :: UserBuildTarget -> [String] -> String -> BuildTargetProblem
-- | <ul>
-- <li><i>(no such thing, actually got)</i></li>
-- </ul>
BuildTargetNoSuch :: UserBuildTarget -> [(String, String)] -> BuildTargetProblem
BuildTargetAmbiguous :: UserBuildTarget -> [(UserBuildTarget, BuildTarget)] -> BuildTargetProblem
reportBuildTargetProblems :: [BuildTargetProblem] -> IO ()
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Simple.BuildTarget.MaybeAmbiguous a)
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Simple.BuildTarget.Match a)
instance GHC.Classes.Eq Distribution.Simple.BuildTarget.MatchError
instance GHC.Show.Show Distribution.Simple.BuildTarget.MatchError
instance GHC.Show.Show Distribution.Simple.BuildTarget.ComponentKind
instance GHC.Classes.Ord Distribution.Simple.BuildTarget.ComponentKind
instance GHC.Classes.Eq Distribution.Simple.BuildTarget.ComponentKind
instance GHC.Show.Show Distribution.Simple.BuildTarget.QualLevel
instance GHC.Enum.Enum Distribution.Simple.BuildTarget.QualLevel
instance GHC.Show.Show Distribution.Simple.BuildTarget.BuildTargetProblem
instance GHC.Show.Show Distribution.Simple.BuildTarget.UserBuildTargetProblem
instance GHC.Generics.Generic Distribution.Simple.BuildTarget.BuildTarget
instance GHC.Show.Show Distribution.Simple.BuildTarget.BuildTarget
instance GHC.Classes.Eq Distribution.Simple.BuildTarget.BuildTarget
instance GHC.Classes.Ord Distribution.Simple.BuildTarget.UserBuildTarget
instance GHC.Classes.Eq Distribution.Simple.BuildTarget.UserBuildTarget
instance GHC.Show.Show Distribution.Simple.BuildTarget.UserBuildTarget
instance Data.Binary.Class.Binary Distribution.Simple.BuildTarget.BuildTarget
instance GHC.Base.Alternative Distribution.Simple.BuildTarget.Match
instance GHC.Base.MonadPlus Distribution.Simple.BuildTarget.Match
instance GHC.Base.Functor Distribution.Simple.BuildTarget.Match
instance GHC.Base.Applicative Distribution.Simple.BuildTarget.Match
instance GHC.Base.Monad Distribution.Simple.BuildTarget.Match
module Distribution.Simple.HaskellSuite
configure :: Verbosity -> Maybe FilePath -> Maybe FilePath -> ProgramConfiguration -> IO (Compiler, Maybe Platform, ProgramConfiguration)
hstoolVersion :: Verbosity -> FilePath -> IO (Maybe Version)
numericVersion :: Verbosity -> FilePath -> IO (Maybe Version)
getCompilerVersion :: Verbosity -> ConfiguredProgram -> IO (String, Version)
getExtensions :: Verbosity -> ConfiguredProgram -> IO [(Extension, Flag)]
getLanguages :: Verbosity -> ConfiguredProgram -> IO [(Language, Flag)]
getInstalledPackages :: Verbosity -> PackageDBStack -> ProgramConfiguration -> IO InstalledPackageIndex
buildLib :: Verbosity -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO ()
installLib :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> FilePath -> PackageDescription -> Library -> ComponentLocalBuildInfo -> IO ()
registerPackage :: Verbosity -> ProgramConfiguration -> PackageDBStack -> InstalledPackageInfo -> IO ()
initPackageDB :: Verbosity -> ProgramConfiguration -> FilePath -> IO ()
packageDbOpt :: PackageDB -> String
-- | This module contains most of the JHC-specific code for configuring,
-- building and installing packages.
module Distribution.Simple.JHC
configure :: Verbosity -> Maybe FilePath -> Maybe FilePath -> ProgramConfiguration -> IO (Compiler, Maybe Platform, ProgramConfiguration)
getInstalledPackages :: Verbosity -> PackageDBStack -> ProgramConfiguration -> IO InstalledPackageIndex
-- | Building a package for JHC. Currently C source files are not
-- supported.
buildLib :: Verbosity -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO ()
-- | Building an executable for JHC. Currently C source files are not
-- supported.
buildExe :: Verbosity -> PackageDescription -> LocalBuildInfo -> Executable -> ComponentLocalBuildInfo -> IO ()
installLib :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> FilePath -> PackageDescription -> Library -> ComponentLocalBuildInfo -> IO ()
installExe :: Verbosity -> FilePath -> FilePath -> (FilePath, FilePath) -> PackageDescription -> Executable -> IO ()
-- | This module provides an library interface to the <tt>ar</tt> program.
module Distribution.Simple.Program.Ar
-- | Call <tt>ar</tt> to create a library archive from a bunch of object
-- files.
createArLibArchive :: Verbosity -> LocalBuildInfo -> FilePath -> [FilePath] -> IO ()
-- | Like the unix xargs program. Useful for when we've got very long
-- command lines that might overflow an OS limit on command line length
-- and so you need to invoke a command multiple times to get all the args
-- in.
--
-- It takes four template invocations corresponding to the simple,
-- initial, middle and last invocations. If the number of args given is
-- small enough that we can get away with just a single invocation then
-- the simple one is used:
--
-- <pre>
-- $ simple args
-- </pre>
--
-- If the number of args given means that we need to use multiple
-- invocations then the templates for the initial, middle and last
-- invocations are used:
--
-- <pre>
-- $ initial args_0
-- $ middle args_1
-- $ middle args_2
-- ...
-- $ final args_n
-- </pre>
multiStageProgramInvocation :: ProgramInvocation -> (ProgramInvocation, ProgramInvocation, ProgramInvocation) -> [String] -> [ProgramInvocation]
module Distribution.Simple.Test.Log
-- | Logs all test results for a package, broken down first by test suite
-- and then by test case.
data PackageLog
PackageLog :: PackageId -> CompilerId -> Platform -> [TestSuiteLog] -> PackageLog
[package] :: PackageLog -> PackageId
[compiler] :: PackageLog -> CompilerId
[platform] :: PackageLog -> Platform
[testSuites] :: PackageLog -> [TestSuiteLog]
data TestLogs
TestLog :: String -> Options -> Result -> TestLogs
[testName] :: TestLogs -> String
[testOptionsReturned] :: TestLogs -> Options
[testResult] :: TestLogs -> Result
GroupLogs :: String -> [TestLogs] -> TestLogs
-- | Logs test suite results, itemized by test case.
data TestSuiteLog
TestSuiteLog :: String -> TestLogs -> FilePath -> TestSuiteLog
[testSuiteName] :: TestSuiteLog -> String
[testLogs] :: TestSuiteLog -> TestLogs
[logFile] :: TestSuiteLog -> FilePath
-- | Count the number of pass, fail, and error test results in a
-- <a>TestLogs</a> tree.
countTestResults :: TestLogs -> (Int, Int, Int)
-- | A <a>PackageLog</a> with package and platform information specified.
localPackageLog :: PackageDescription -> LocalBuildInfo -> PackageLog
-- | Print a summary to the console after all test suites have been run
-- indicating the number of successful test suites and cases. Returns
-- <a>True</a> if all test suites passed and <a>False</a> otherwise.
summarizePackage :: Verbosity -> PackageLog -> IO Bool
-- | Print a summary of the test suite's results on the console,
-- suppressing output for certain verbosity or test filter levels.
summarizeSuiteFinish :: TestSuiteLog -> String
summarizeSuiteStart :: String -> String
-- | Print a summary of a single test case's result to the console,
-- supressing output for certain verbosity or test filter levels.
summarizeTest :: Verbosity -> TestShowDetails -> TestLogs -> IO ()
-- | From a <a>TestSuiteLog</a>, determine if the test suite encountered
-- errors.
suiteError :: TestLogs -> Bool
-- | From a <a>TestSuiteLog</a>, determine if the test suite failed.
suiteFailed :: TestLogs -> Bool
-- | From a <a>TestSuiteLog</a>, determine if the test suite passed.
suitePassed :: TestLogs -> Bool
testSuiteLogPath :: PathTemplate -> PackageDescription -> LocalBuildInfo -> String -> TestLogs -> FilePath
instance GHC.Classes.Eq Distribution.Simple.Test.Log.PackageLog
instance GHC.Show.Show Distribution.Simple.Test.Log.PackageLog
instance GHC.Read.Read Distribution.Simple.Test.Log.PackageLog
instance GHC.Classes.Eq Distribution.Simple.Test.Log.TestSuiteLog
instance GHC.Show.Show Distribution.Simple.Test.Log.TestSuiteLog
instance GHC.Read.Read Distribution.Simple.Test.Log.TestSuiteLog
instance GHC.Classes.Eq Distribution.Simple.Test.Log.TestLogs
instance GHC.Show.Show Distribution.Simple.Test.Log.TestLogs
instance GHC.Read.Read Distribution.Simple.Test.Log.TestLogs
-- | This module contains most of the UHC-specific code for configuring,
-- building and installing packages.
--
-- Thanks to the authors of the other implementation-specific files, in
-- particular to Isaac Jones, Duncan Coutts and Henning Thielemann, for
-- inspiration on how to design this module.
module Distribution.Simple.UHC
configure :: Verbosity -> Maybe FilePath -> Maybe FilePath -> ProgramConfiguration -> IO (Compiler, Maybe Platform, ProgramConfiguration)
getInstalledPackages :: Verbosity -> Compiler -> PackageDBStack -> ProgramConfiguration -> IO InstalledPackageIndex
buildLib :: Verbosity -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO ()
buildExe :: Verbosity -> PackageDescription -> LocalBuildInfo -> Executable -> ComponentLocalBuildInfo -> IO ()
installLib :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> FilePath -> PackageDescription -> Library -> ComponentLocalBuildInfo -> IO ()
registerPackage :: Verbosity -> Compiler -> ProgramConfiguration -> PackageDBStack -> InstalledPackageInfo -> IO ()
inplacePackageDbPath :: LocalBuildInfo -> FilePath
module Distribution.Simple.Program.GHC
-- | A structured set of GHC options/flags
data GhcOptions
GhcOptions :: Flag GhcMode -> NubListR String -> NubListR String -> NubListR FilePath -> NubListR ModuleName -> Flag FilePath -> Flag FilePath -> Flag Bool -> NubListR FilePath -> Flag String -> PackageDBStack -> NubListR (UnitId, PackageId, ModuleRenaming) -> Flag Bool -> Flag Bool -> NubListR FilePath -> NubListR FilePath -> NubListR String -> NubListR String -> NubListR String -> Flag Bool -> Flag Bool -> NubListR String -> NubListR String -> NubListR FilePath -> NubListR FilePath -> NubListR FilePath -> Flag Language -> NubListR Extension -> Map Extension String -> Flag GhcOptimisation -> Flag Bool -> Flag Bool -> Flag GhcProfAuto -> Flag Bool -> Flag (Maybe Int) -> Flag FilePath -> NubListR FilePath -> Flag String -> Flag String -> Flag String -> Flag String -> Flag FilePath -> Flag FilePath -> Flag FilePath -> Flag FilePath -> Flag GhcDynLinkMode -> Flag Bool -> Flag Bool -> Flag String -> NubListR FilePath -> Flag Verbosity -> Flag Bool -> GhcOptions
-- | The major mode for the ghc invocation.
[ghcOptMode] :: GhcOptions -> Flag GhcMode
-- | Any extra options to pass directly to ghc. These go at the end and
-- hence override other stuff.
[ghcOptExtra] :: GhcOptions -> NubListR String
-- | Extra default flags to pass directly to ghc. These go at the beginning
-- and so can be overridden by other stuff.
[ghcOptExtraDefault] :: GhcOptions -> NubListR String
-- | The main input files; could be .hs, .hi, .c, .o, depending on mode.
[ghcOptInputFiles] :: GhcOptions -> NubListR FilePath
-- | The names of input Haskell modules, mainly for <tt>--make</tt> mode.
[ghcOptInputModules] :: GhcOptions -> NubListR ModuleName
-- | Location for output file; the <tt>ghc -o</tt> flag.
[ghcOptOutputFile] :: GhcOptions -> Flag FilePath
-- | Location for dynamic output file in <a>GhcStaticAndDynamic</a> mode;
-- the <tt>ghc -dyno</tt> flag.
[ghcOptOutputDynFile] :: GhcOptions -> Flag FilePath
-- | Start with an empty search path for Haskell source files; the <tt>ghc
-- -i</tt> flag (<tt>-i</tt> on it's own with no path argument).
[ghcOptSourcePathClear] :: GhcOptions -> Flag Bool
-- | Search path for Haskell source files; the <tt>ghc -i</tt> flag.
[ghcOptSourcePath] :: GhcOptions -> NubListR FilePath
-- | The unit ID the modules will belong to; the <tt>ghc -this-unit-id</tt>
-- flag (or <tt>-this-package-key</tt> or <tt>-package-name</tt> on older
-- versions of GHC). This is a <a>String</a> because we assume you've
-- already figured out what the correct format for this string is (we
-- need to handle backwards compatibility.)
[ghcOptThisUnitId] :: GhcOptions -> Flag String
-- | GHC package databases to use, the <tt>ghc -package-conf</tt> flag.
[ghcOptPackageDBs] :: GhcOptions -> PackageDBStack
-- | The GHC packages to use. For compatability with old and new ghc, this
-- requires both the short and long form of the package id; the <tt>ghc
-- -package</tt> or <tt>ghc -package-id</tt> flags.
[ghcOptPackages] :: GhcOptions -> NubListR (UnitId, PackageId, ModuleRenaming)
-- | Start with a clean package set; the <tt>ghc -hide-all-packages</tt>
-- flag
[ghcOptHideAllPackages] :: GhcOptions -> Flag Bool
-- | Don't automatically link in Haskell98 etc; the <tt>ghc
-- -no-auto-link-packages</tt> flag.
[ghcOptNoAutoLinkPackages] :: GhcOptions -> Flag Bool
-- | Names of libraries to link in; the <tt>ghc -l</tt> flag.
[ghcOptLinkLibs] :: GhcOptions -> NubListR FilePath
-- | Search path for libraries to link in; the <tt>ghc -L</tt> flag.
[ghcOptLinkLibPath] :: GhcOptions -> NubListR FilePath
-- | Options to pass through to the linker; the <tt>ghc -optl</tt> flag.
[ghcOptLinkOptions] :: GhcOptions -> NubListR String
-- | OSX only: frameworks to link in; the <tt>ghc -framework</tt> flag.
[ghcOptLinkFrameworks] :: GhcOptions -> NubListR String
-- | OSX only: Search path for frameworks to link in; the <tt>ghc
-- -framework-path</tt> flag.
[ghcOptLinkFrameworkDirs] :: GhcOptions -> NubListR String
-- | Don't do the link step, useful in make mode; the <tt>ghc -no-link</tt>
-- flag.
[ghcOptNoLink] :: GhcOptions -> Flag Bool
-- | Don't link in the normal RTS <tt>main</tt> entry point; the <tt>ghc
-- -no-hs-main</tt> flag.
[ghcOptLinkNoHsMain] :: GhcOptions -> Flag Bool
-- | Options to pass through to the C compiler; the <tt>ghc -optc</tt>
-- flag.
[ghcOptCcOptions] :: GhcOptions -> NubListR String
-- | Options to pass through to CPP; the <tt>ghc -optP</tt> flag.
[ghcOptCppOptions] :: GhcOptions -> NubListR String
-- | Search path for CPP includes like header files; the <tt>ghc -I</tt>
-- flag.
[ghcOptCppIncludePath] :: GhcOptions -> NubListR FilePath
-- | Extra header files to include at CPP stage; the <tt>ghc
-- -optP-include</tt> flag.
[ghcOptCppIncludes] :: GhcOptions -> NubListR FilePath
-- | Extra header files to include for old-style FFI; the <tt>ghc
-- -#include</tt> flag.
[ghcOptFfiIncludes] :: GhcOptions -> NubListR FilePath
-- | The base language; the <tt>ghc -XHaskell98</tt> or
-- <tt>-XHaskell2010</tt> flag.
[ghcOptLanguage] :: GhcOptions -> Flag Language
-- | The language extensions; the <tt>ghc -X</tt> flag.
[ghcOptExtensions] :: GhcOptions -> NubListR Extension
-- | A GHC version-dependent mapping of extensions to flags. This must be
-- set to be able to make use of the <a>ghcOptExtensions</a>.
[ghcOptExtensionMap] :: GhcOptions -> Map Extension String
-- | What optimisation level to use; the <tt>ghc -O</tt> flag.
[ghcOptOptimisation] :: GhcOptions -> Flag GhcOptimisation
-- | Emit debug info; the <tt>ghc -g</tt> flag.
[ghcOptDebugInfo] :: GhcOptions -> Flag Bool
-- | Compile in profiling mode; the <tt>ghc -prof</tt> flag.
[ghcOptProfilingMode] :: GhcOptions -> Flag Bool
-- | Automatically add profiling cost centers; the <tt>ghc
-- -fprof-auto*</tt> flags.
[ghcOptProfilingAuto] :: GhcOptions -> Flag GhcProfAuto
-- | Use the "split object files" feature; the <tt>ghc -split-objs</tt>
-- flag.
[ghcOptSplitObjs] :: GhcOptions -> Flag Bool
-- | Run N jobs simultaneously (if possible).
[ghcOptNumJobs] :: GhcOptions -> Flag (Maybe Int)
-- | Enable coverage analysis; the <tt>ghc -fhpc -hpcdir</tt> flags.
[ghcOptHPCDir] :: GhcOptions -> Flag FilePath
-- | Extra GHCi startup scripts; the <tt>-ghci-script</tt> flag
[ghcOptGHCiScripts] :: GhcOptions -> NubListR FilePath
[ghcOptHiSuffix] :: GhcOptions -> Flag String
[ghcOptObjSuffix] :: GhcOptions -> Flag String
-- | only in <a>GhcStaticAndDynamic</a> mode
[ghcOptDynHiSuffix] :: GhcOptions -> Flag String
-- | only in <a>GhcStaticAndDynamic</a> mode
[ghcOptDynObjSuffix] :: GhcOptions -> Flag String
[ghcOptHiDir] :: GhcOptions -> Flag FilePath
[ghcOptObjDir] :: GhcOptions -> Flag FilePath
[ghcOptOutputDir] :: GhcOptions -> Flag FilePath
[ghcOptStubDir] :: GhcOptions -> Flag FilePath
[ghcOptDynLinkMode] :: GhcOptions -> Flag GhcDynLinkMode
[ghcOptShared] :: GhcOptions -> Flag Bool
[ghcOptFPic] :: GhcOptions -> Flag Bool
[ghcOptDylibName] :: GhcOptions -> Flag String
[ghcOptRPaths] :: GhcOptions -> NubListR FilePath
-- | Get GHC to be quiet or verbose with what it's doing; the <tt>ghc
-- -v</tt> flag.
[ghcOptVerbosity] :: GhcOptions -> Flag Verbosity
-- | Let GHC know that it is Cabal that's calling it. Modifies some of the
-- GHC error messages.
[ghcOptCabal] :: GhcOptions -> Flag Bool
data GhcMode
-- | <pre>
-- ghc -c
-- </pre>
GhcModeCompile :: GhcMode
-- | <pre>
-- ghc
-- </pre>
GhcModeLink :: GhcMode
-- | <pre>
-- ghc --make
-- </pre>
GhcModeMake :: GhcMode
-- | <tt>ghci</tt> / <tt>ghc --interactive</tt>
GhcModeInteractive :: GhcMode
-- | <tt>ghc --abi-hash</tt> | GhcModeDepAnalysis -- ^ <tt>ghc -M</tt> |
-- GhcModeEvaluate -- ^ <tt>ghc -e</tt>
GhcModeAbiHash :: GhcMode
data GhcOptimisation
-- | <pre>
-- -O0
-- </pre>
GhcNoOptimisation :: GhcOptimisation
-- | <pre>
-- -O
-- </pre>
GhcNormalOptimisation :: GhcOptimisation
-- | <pre>
-- -O2
-- </pre>
GhcMaximumOptimisation :: GhcOptimisation
-- | e.g. <tt>-Odph</tt>
GhcSpecialOptimisation :: String -> GhcOptimisation
data GhcDynLinkMode
-- | <pre>
-- -static
-- </pre>
GhcStaticOnly :: GhcDynLinkMode
-- | <pre>
-- -dynamic
-- </pre>
GhcDynamicOnly :: GhcDynLinkMode
-- | <pre>
-- -static -dynamic-too
-- </pre>
GhcStaticAndDynamic :: GhcDynLinkMode
data GhcProfAuto
-- | <pre>
-- -fprof-auto
-- </pre>
GhcProfAutoAll :: GhcProfAuto
-- | <pre>
-- -fprof-auto-top
-- </pre>
GhcProfAutoToplevel :: GhcProfAuto
-- | <pre>
-- -fprof-auto-exported
-- </pre>
GhcProfAutoExported :: GhcProfAuto
ghcInvocation :: ConfiguredProgram -> Compiler -> Platform -> GhcOptions -> ProgramInvocation
renderGhcOptions :: Compiler -> Platform -> GhcOptions -> [String]
runGHC :: Verbosity -> ConfiguredProgram -> Compiler -> Platform -> GhcOptions -> IO ()
instance GHC.Generics.Generic Distribution.Simple.Program.GHC.GhcOptions
instance GHC.Show.Show Distribution.Simple.Program.GHC.GhcOptions
instance GHC.Classes.Eq Distribution.Simple.Program.GHC.GhcProfAuto
instance GHC.Show.Show Distribution.Simple.Program.GHC.GhcProfAuto
instance GHC.Classes.Eq Distribution.Simple.Program.GHC.GhcDynLinkMode
instance GHC.Show.Show Distribution.Simple.Program.GHC.GhcDynLinkMode
instance GHC.Classes.Eq Distribution.Simple.Program.GHC.GhcOptimisation
instance GHC.Show.Show Distribution.Simple.Program.GHC.GhcOptimisation
instance GHC.Classes.Eq Distribution.Simple.Program.GHC.GhcMode
instance GHC.Show.Show Distribution.Simple.Program.GHC.GhcMode
instance GHC.Base.Monoid Distribution.Simple.Program.GHC.GhcOptions
instance Data.Semigroup.Semigroup Distribution.Simple.Program.GHC.GhcOptions
-- | This module provides an library interface to the <tt>hc-pkg</tt>
-- program. Currently only GHC, GHCJS and LHC have hc-pkg programs.
module Distribution.Simple.Program.HcPkg
-- | Information about the features and capabilities of an <tt>hc-pkg</tt>
-- program.
data HcPkgInfo
HcPkgInfo :: ConfiguredProgram -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> HcPkgInfo
[hcPkgProgram] :: HcPkgInfo -> ConfiguredProgram
-- | no package DB stack supported
[noPkgDbStack] :: HcPkgInfo -> Bool
-- | hc-pkg does not support verbosity flags
[noVerboseFlag] :: HcPkgInfo -> Bool
-- | use package-conf option instead of package-db
[flagPackageConf] :: HcPkgInfo -> Bool
-- | supports directory style package databases
[supportsDirDbs] :: HcPkgInfo -> Bool
-- | requires directory style package databases
[requiresDirDbs] :: HcPkgInfo -> Bool
-- | supports --enable-multi-instance flag
[nativeMultiInstance] :: HcPkgInfo -> Bool
-- | supports multi-instance via recache
[recacheMultiInstance] :: HcPkgInfo -> Bool
-- | Call <tt>hc-pkg</tt> to initialise a package database at the location
-- {path}.
--
-- <pre>
-- hc-pkg init {path}
-- </pre>
init :: HcPkgInfo -> Verbosity -> Bool -> FilePath -> IO ()
-- | Run <tt>hc-pkg</tt> using a given package DB stack, directly
-- forwarding the provided command-line arguments to it.
invoke :: HcPkgInfo -> Verbosity -> PackageDBStack -> [String] -> IO ()
-- | Call <tt>hc-pkg</tt> to register a package.
--
-- <pre>
-- hc-pkg register {filename | -} [--user | --global | --package-db]
-- </pre>
register :: HcPkgInfo -> Verbosity -> PackageDBStack -> Either FilePath InstalledPackageInfo -> IO ()
-- | Call <tt>hc-pkg</tt> to re-register a package.
--
-- <pre>
-- hc-pkg register {filename | -} [--user | --global | --package-db]
-- </pre>
reregister :: HcPkgInfo -> Verbosity -> PackageDBStack -> Either FilePath InstalledPackageInfo -> IO ()
registerMultiInstance :: HcPkgInfo -> Verbosity -> PackageDBStack -> InstalledPackageInfo -> IO ()
-- | Call <tt>hc-pkg</tt> to unregister a package
--
-- <pre>
-- hc-pkg unregister [pkgid] [--user | --global | --package-db]
-- </pre>
unregister :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> IO ()
-- | Call <tt>hc-pkg</tt> to recache the registered packages.
--
-- <pre>
-- hc-pkg recache [--user | --global | --package-db]
-- </pre>
recache :: HcPkgInfo -> Verbosity -> PackageDB -> IO ()
-- | Call <tt>hc-pkg</tt> to expose a package.
--
-- <pre>
-- hc-pkg expose [pkgid] [--user | --global | --package-db]
-- </pre>
expose :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> IO ()
-- | Call <tt>hc-pkg</tt> to hide a package.
--
-- <pre>
-- hc-pkg hide [pkgid] [--user | --global | --package-db]
-- </pre>
hide :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> IO ()
-- | Call <tt>hc-pkg</tt> to get all the details of all the packages in the
-- given package database.
dump :: HcPkgInfo -> Verbosity -> PackageDB -> IO [InstalledPackageInfo]
-- | Call <tt>hc-pkg</tt> to retrieve a specific package
--
-- <pre>
-- hc-pkg describe [pkgid] [--user | --global | --package-db]
-- </pre>
describe :: HcPkgInfo -> Verbosity -> PackageDBStack -> PackageId -> IO [InstalledPackageInfo]
-- | Call <tt>hc-pkg</tt> to get the source package Id of all the packages
-- in the given package database.
--
-- This is much less information than with <a>dump</a>, but also rather
-- quicker. Note in particular that it does not include the
-- <a>UnitId</a>, just the source <a>PackageId</a> which is not
-- necessarily unique in any package db.
list :: HcPkgInfo -> Verbosity -> PackageDB -> IO [PackageId]
initInvocation :: HcPkgInfo -> Verbosity -> FilePath -> ProgramInvocation
registerInvocation :: HcPkgInfo -> Verbosity -> PackageDBStack -> Either FilePath InstalledPackageInfo -> ProgramInvocation
reregisterInvocation :: HcPkgInfo -> Verbosity -> PackageDBStack -> Either FilePath InstalledPackageInfo -> ProgramInvocation
registerMultiInstanceInvocation :: HcPkgInfo -> Verbosity -> PackageDBStack -> Either FilePath InstalledPackageInfo -> ProgramInvocation
unregisterInvocation :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> ProgramInvocation
recacheInvocation :: HcPkgInfo -> Verbosity -> PackageDB -> ProgramInvocation
exposeInvocation :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> ProgramInvocation
hideInvocation :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> ProgramInvocation
dumpInvocation :: HcPkgInfo -> Verbosity -> PackageDB -> ProgramInvocation
describeInvocation :: HcPkgInfo -> Verbosity -> PackageDBStack -> PackageId -> ProgramInvocation
listInvocation :: HcPkgInfo -> Verbosity -> PackageDB -> ProgramInvocation
-- | This is a fairly large module. It contains most of the GHC-specific
-- code for configuring, building and installing packages. It also
-- exports a function for finding out what packages are already
-- installed. Configuring involves finding the <tt>ghc</tt> and
-- <tt>ghc-pkg</tt> programs, finding what language extensions this
-- version of ghc supports and returning a <a>Compiler</a> value.
--
-- <a>getInstalledPackages</a> involves calling the <tt>ghc-pkg</tt>
-- program to find out what packages are installed.
--
-- Building is somewhat complex as there is quite a bit of information to
-- take into account. We have to build libs and programs, possibly for
-- profiling and shared libs. We have to support building libraries that
-- will be usable by GHCi and also ghc's <tt>-split-objs</tt> feature. We
-- have to compile any C files using ghc. Linking, especially for
-- <tt>split-objs</tt> is remarkably complex, partly because there tend
-- to be 1,000's of <tt>.o</tt> files and this can often be more than we
-- can pass to the <tt>ld</tt> or <tt>ar</tt> programs in one go.
--
-- Installing for libs and exes involves finding the right files and
-- copying them to the right places. One of the more tricky things about
-- this module is remembering the layout of files in the build directory
-- (which is not explicitly documented) and thus what search dirs are
-- used for various kinds of files.
module Distribution.Simple.LHC
configure :: Verbosity -> Maybe FilePath -> Maybe FilePath -> ProgramConfiguration -> IO (Compiler, Maybe Platform, ProgramConfiguration)
getInstalledPackages :: Verbosity -> PackageDBStack -> ProgramConfiguration -> IO InstalledPackageIndex
-- | Build a library with LHC.
buildLib :: Verbosity -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO ()
-- | Build an executable with LHC.
buildExe :: Verbosity -> PackageDescription -> LocalBuildInfo -> Executable -> ComponentLocalBuildInfo -> IO ()
-- | Install for ghc, .hi, .a and, if --with-ghci given, .o
installLib :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> FilePath -> PackageDescription -> Library -> ComponentLocalBuildInfo -> IO ()
-- | Install executables for GHC.
installExe :: Verbosity -> LocalBuildInfo -> InstallDirs FilePath -> FilePath -> (FilePath, FilePath) -> PackageDescription -> Executable -> IO ()
registerPackage :: Verbosity -> ProgramConfiguration -> PackageDBStack -> InstalledPackageInfo -> IO ()
hcPkgInfo :: ProgramConfiguration -> HcPkgInfo
ghcOptions :: LocalBuildInfo -> BuildInfo -> ComponentLocalBuildInfo -> FilePath -> [String]
ghcVerbosityOptions :: Verbosity -> [String]
-- | This module provides an library interface to the <tt>hpc</tt> program.
module Distribution.Simple.Program.Hpc
-- | Invoke hpc with the given parameters.
--
-- Prior to HPC version 0.7 (packaged with GHC 7.8), hpc did not handle
-- multiple .mix paths correctly, so we print a warning, and only pass it
-- the first path in the list. This means that e.g. test suites that
-- import their library as a dependency can still work, but those that
-- include the library modules directly (in other-modules) don't.
markup :: ConfiguredProgram -> Version -> Verbosity -> FilePath -> [FilePath] -> FilePath -> [ModuleName] -> IO ()
union :: ConfiguredProgram -> Verbosity -> [FilePath] -> FilePath -> [ModuleName] -> IO ()
-- | This module provides functions for locating various HPC-related paths
-- and a function for adding the necessary options to a
-- PackageDescription to build test suites with HPC enabled.
module Distribution.Simple.Hpc
data Way
Vanilla :: Way
Prof :: Way
Dyn :: Way
-- | Attempt to guess the way the test suites in this package were compiled
-- and linked with the library so the correct module interfaces are
-- found.
guessWay :: LocalBuildInfo -> Way
htmlDir :: FilePath -> Way -> FilePath -> FilePath
mixDir :: FilePath -> Way -> FilePath -> FilePath
tixDir :: FilePath -> Way -> FilePath -> FilePath
-- | Path to the .tix file containing a test suite's sum statistics.
tixFilePath :: FilePath -> Way -> FilePath -> FilePath
-- | Generate the HTML markup for all of a package's test suites.
markupPackage :: Verbosity -> LocalBuildInfo -> FilePath -> String -> [TestSuite] -> IO ()
-- | Generate the HTML markup for a test suite.
markupTest :: Verbosity -> LocalBuildInfo -> FilePath -> String -> TestSuite -> IO ()
instance GHC.Show.Show Distribution.Simple.Hpc.Way
instance GHC.Read.Read Distribution.Simple.Hpc.Way
instance GHC.Classes.Eq Distribution.Simple.Hpc.Way
instance GHC.Enum.Enum Distribution.Simple.Hpc.Way
instance GHC.Enum.Bounded Distribution.Simple.Hpc.Way
-- | This module provides an library interface to the <tt>ld</tt> linker
-- program.
module Distribution.Simple.Program.Ld
-- | Call <tt>ld -r</tt> to link a bunch of object files together.
combineObjectFiles :: Verbosity -> ConfiguredProgram -> FilePath -> [FilePath] -> IO ()
-- | This is a fairly large module. It contains most of the GHC-specific
-- code for configuring, building and installing packages. It also
-- exports a function for finding out what packages are already
-- installed. Configuring involves finding the <tt>ghc</tt> and
-- <tt>ghc-pkg</tt> programs, finding what language extensions this
-- version of ghc supports and returning a <a>Compiler</a> value.
--
-- <a>getInstalledPackages</a> involves calling the <tt>ghc-pkg</tt>
-- program to find out what packages are installed.
--
-- Building is somewhat complex as there is quite a bit of information to
-- take into account. We have to build libs and programs, possibly for
-- profiling and shared libs. We have to support building libraries that
-- will be usable by GHCi and also ghc's <tt>-split-objs</tt> feature. We
-- have to compile any C files using ghc. Linking, especially for
-- <tt>split-objs</tt> is remarkably complex, partly because there tend
-- to be 1,000's of <tt>.o</tt> files and this can often be more than we
-- can pass to the <tt>ld</tt> or <tt>ar</tt> programs in one go.
--
-- Installing for libs and exes involves finding the right files and
-- copying them to the right places. One of the more tricky things about
-- this module is remembering the layout of files in the build directory
-- (which is not explicitly documented) and thus what search dirs are
-- used for various kinds of files.
module Distribution.Simple.GHC
getGhcInfo :: Verbosity -> ConfiguredProgram -> IO [(String, String)]
configure :: Verbosity -> Maybe FilePath -> Maybe FilePath -> ProgramConfiguration -> IO (Compiler, Maybe Platform, ProgramConfiguration)
-- | Given a package DB stack, return all installed packages.
getInstalledPackages :: Verbosity -> Compiler -> PackageDBStack -> ProgramConfiguration -> IO InstalledPackageIndex
getInstalledPackagesMonitorFiles :: Verbosity -> Platform -> ProgramConfiguration -> [PackageDB] -> IO [FilePath]
-- | Given a single package DB, return all installed packages.
getPackageDBContents :: Verbosity -> PackageDB -> ProgramConfiguration -> IO InstalledPackageIndex
-- | Build a library with GHC.
buildLib :: Verbosity -> Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO ()
-- | Build an executable with GHC.
buildExe :: Verbosity -> Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Executable -> ComponentLocalBuildInfo -> IO ()
-- | Build a library with GHC.
replLib :: Verbosity -> Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO ()
-- | Build an executable with GHC.
replExe :: Verbosity -> Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Executable -> ComponentLocalBuildInfo -> IO ()
-- | Start a REPL without loading any source files.
startInterpreter :: Verbosity -> ProgramConfiguration -> Compiler -> Platform -> PackageDBStack -> IO ()
-- | Install for ghc, .hi, .a and, if --with-ghci given, .o
installLib :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> FilePath -> PackageDescription -> Library -> ComponentLocalBuildInfo -> IO ()
-- | Install executables for GHC.
installExe :: Verbosity -> LocalBuildInfo -> InstallDirs FilePath -> FilePath -> (FilePath, FilePath) -> PackageDescription -> Executable -> IO ()
-- | Extracts a String representing a hash of the ABI of a built library.
-- It can fail if the library has not yet been built.
libAbiHash :: Verbosity -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO String
hcPkgInfo :: ProgramConfiguration -> HcPkgInfo
registerPackage :: Verbosity -> ProgramConfiguration -> Bool -> PackageDBStack -> InstalledPackageInfo -> IO ()
componentGhcOptions :: Verbosity -> LocalBuildInfo -> BuildInfo -> ComponentLocalBuildInfo -> FilePath -> GhcOptions
componentCcGhcOptions :: Verbosity -> LocalBuildInfo -> BuildInfo -> ComponentLocalBuildInfo -> FilePath -> FilePath -> GhcOptions
getLibDir :: Verbosity -> LocalBuildInfo -> IO FilePath
isDynamic :: Compiler -> Bool
-- | Return the <a>FilePath</a> to the global GHC package database.
getGlobalPackageDB :: Verbosity -> ConfiguredProgram -> IO FilePath
pkgRoot :: Verbosity -> LocalBuildInfo -> PackageDB -> IO FilePath
module Distribution.Simple.GHCJS
configure :: Verbosity -> Maybe FilePath -> Maybe FilePath -> ProgramConfiguration -> IO (Compiler, Maybe Platform, ProgramConfiguration)
-- | Given a package DB stack, return all installed packages.
getInstalledPackages :: Verbosity -> PackageDBStack -> ProgramConfiguration -> IO InstalledPackageIndex
-- | Given a single package DB, return all installed packages.
getPackageDBContents :: Verbosity -> PackageDB -> ProgramConfiguration -> IO InstalledPackageIndex
buildLib :: Verbosity -> Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO ()
buildExe :: Verbosity -> Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Executable -> ComponentLocalBuildInfo -> IO ()
replLib :: Verbosity -> Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO ()
replExe :: Verbosity -> Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Executable -> ComponentLocalBuildInfo -> IO ()
-- | Start a REPL without loading any source files.
startInterpreter :: Verbosity -> ProgramConfiguration -> Compiler -> Platform -> PackageDBStack -> IO ()
-- | Install for ghc, .hi, .a and, if --with-ghci given, .o
installLib :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> FilePath -> PackageDescription -> Library -> ComponentLocalBuildInfo -> IO ()
installExe :: Verbosity -> LocalBuildInfo -> InstallDirs FilePath -> FilePath -> (FilePath, FilePath) -> PackageDescription -> Executable -> IO ()
libAbiHash :: Verbosity -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO String
hcPkgInfo :: ProgramConfiguration -> HcPkgInfo
registerPackage :: Verbosity -> ProgramConfiguration -> Bool -> PackageDBStack -> InstalledPackageInfo -> IO ()
componentGhcOptions :: Verbosity -> LocalBuildInfo -> BuildInfo -> ComponentLocalBuildInfo -> FilePath -> GhcOptions
getLibDir :: Verbosity -> LocalBuildInfo -> IO FilePath
isDynamic :: Compiler -> Bool
-- | Return the <a>FilePath</a> to the global GHC package database.
getGlobalPackageDB :: Verbosity -> ConfiguredProgram -> IO FilePath
-- | Get the JavaScript file name and command and arguments to run a
-- program compiled by GHCJS the exe should be the base program name
-- without exe extension
runCmd :: ProgramConfiguration -> FilePath -> (FilePath, FilePath, [String])
-- | This is the entry point into installing a built package. Performs the
-- "<tt>./setup install</tt>" and "<tt>./setup copy</tt>" actions. It
-- moves files into place based on the prefix argument. It does the
-- generic bits and then calls compiler-specific functions to do the
-- rest.
module Distribution.Simple.Install
-- | Perform the "<tt>./setup install</tt>" and "<tt>./setup copy</tt>"
-- actions. Move files into place based on the prefix argument.
install :: PackageDescription -> LocalBuildInfo -> CopyFlags -> IO ()
-- | This module provides an library interface to the <tt>hc-pkg</tt>
-- program. Currently only GHC and LHC have hc-pkg programs.
module Distribution.Simple.Program.Script
-- | Generate a system script, either POSIX shell script or Windows batch
-- file as appropriate for the given system.
invocationAsSystemScript :: OS -> ProgramInvocation -> String
-- | Generate a POSIX shell script that invokes a program.
invocationAsShellScript :: ProgramInvocation -> String
-- | Generate a Windows batch file that invokes a program.
invocationAsBatchFile :: ProgramInvocation -> String
-- | This module deals with registering and unregistering packages. There
-- are a couple ways it can do this, one is to do it directly. Another is
-- to generate a script that can be run later to do it. The idea here
-- being that the user is shielded from the details of what command to
-- use for package registration for a particular compiler. In practice
-- this aspect was not especially popular so we also provide a way to
-- simply generate the package registration file which then must be
-- manually passed to <tt>ghc-pkg</tt>. It is possible to generate
-- registration information for where the package is to be installed, or
-- alternatively to register the package in place in the build tree. The
-- latter is occasionally handy, and will become more important when we
-- try to build multi-package systems.
--
-- This module does not delegate anything to the per-compiler modules but
-- just mixes it all in in this module, which is rather unsatisfactory.
-- The script generation and the unregister feature are not well used or
-- tested.
module Distribution.Simple.Register
register :: PackageDescription -> LocalBuildInfo -> RegisterFlags -> IO ()
unregister :: PackageDescription -> LocalBuildInfo -> RegisterFlags -> IO ()
initPackageDB :: Verbosity -> Compiler -> ProgramConfiguration -> FilePath -> IO ()
doesPackageDBExist :: FilePath -> IO Bool
-- | Create an empty package DB at the specified location.
createPackageDB :: Verbosity -> Compiler -> ProgramConfiguration -> Bool -> FilePath -> IO ()
deletePackageDB :: FilePath -> IO ()
-- | Run <tt>hc-pkg</tt> using a given package DB stack, directly
-- forwarding the provided command-line arguments to it.
invokeHcPkg :: Verbosity -> Compiler -> ProgramConfiguration -> PackageDBStack -> [String] -> IO ()
registerPackage :: Verbosity -> Compiler -> ProgramConfiguration -> Bool -> PackageDBStack -> InstalledPackageInfo -> IO ()
generateRegistrationInfo :: Verbosity -> PackageDescription -> Library -> LocalBuildInfo -> ComponentLocalBuildInfo -> Bool -> Bool -> FilePath -> PackageDB -> IO InstalledPackageInfo
-- | Construct <a>InstalledPackageInfo</a> for a library that is in place
-- in the build tree.
--
-- This function knows about the layout of in place packages.
inplaceInstalledPackageInfo :: FilePath -> FilePath -> PackageDescription -> AbiHash -> Library -> LocalBuildInfo -> ComponentLocalBuildInfo -> InstalledPackageInfo
-- | Construct <a>InstalledPackageInfo</a> for the final install location
-- of a library package.
--
-- This function knows about the layout of installed packages.
absoluteInstalledPackageInfo :: PackageDescription -> AbiHash -> Library -> LocalBuildInfo -> ComponentLocalBuildInfo -> InstalledPackageInfo
-- | Construct <a>InstalledPackageInfo</a> for a library in a package,
-- given a set of installation directories.
generalInstalledPackageInfo :: ([FilePath] -> [FilePath]) -> PackageDescription -> AbiHash -> Library -> LocalBuildInfo -> ComponentLocalBuildInfo -> InstallDirs FilePath -> InstalledPackageInfo
module Distribution.Compat.CreatePipe
createPipe :: IO (Handle, Handle)
module Distribution.Simple.Test.ExeV10
runTest :: PackageDescription -> LocalBuildInfo -> TestFlags -> TestSuite -> IO TestSuiteLog
module Distribution.Simple.Test.LibV09
runTest :: PackageDescription -> LocalBuildInfo -> TestFlags -> TestSuite -> IO TestSuiteLog
-- | Source code for library test suite stub executable
simpleTestStub :: ModuleName -> String
-- | The filename of the source file for the stub executable associated
-- with a library <tt>TestSuite</tt>.
stubFilePath :: TestSuite -> FilePath
-- | Main function for test stubs. Once, it was written directly into the
-- stub, but minimizing the amount of code actually in the stub maximizes
-- the number of detectable errors when Cabal is compiled.
stubMain :: IO [Test] -> IO ()
-- | The name of the stub executable associated with a library
-- <tt>TestSuite</tt>.
stubName :: TestSuite -> FilePath
-- | From a test stub, write the <a>TestSuiteLog</a> to temporary file for
-- the calling Cabal process to read.
stubWriteLog :: FilePath -> String -> TestLogs -> IO ()
-- | Write the source file for a library <tt>TestSuite</tt> stub
-- executable.
writeSimpleTestStub :: TestSuite -> FilePath -> IO ()
-- | This defines a <a>PreProcessor</a> abstraction which represents a
-- pre-processor that can transform one kind of file into another. There
-- is also a <a>PPSuffixHandler</a> which is a combination of a file
-- extension and a function for configuring a <a>PreProcessor</a>. It
-- defines a bunch of known built-in preprocessors like <tt>cpp</tt>,
-- <tt>cpphs</tt>, <tt>c2hs</tt>, <tt>hsc2hs</tt>, <tt>happy</tt>,
-- <tt>alex</tt> etc and lists them in <a>knownSuffixHandlers</a>. On top
-- of this it provides a function for actually preprocessing some sources
-- given a bunch of known suffix handlers. This module is not as good as
-- it could be, it could really do with a rewrite to address some of the
-- problems we have with pre-processors.
module Distribution.Simple.PreProcess
-- | Apply preprocessors to the sources from <a>hsSourceDirs</a> for a
-- given component (lib, exe, or test suite).
preprocessComponent :: PackageDescription -> Component -> LocalBuildInfo -> Bool -> Verbosity -> [PPSuffixHandler] -> IO ()
-- | Find any extra C sources generated by preprocessing that need to be
-- added to the component (addresses issue #238).
preprocessExtras :: Component -> LocalBuildInfo -> IO [FilePath]
-- | Standard preprocessors: GreenCard, c2hs, hsc2hs, happy, alex and
-- cpphs.
knownSuffixHandlers :: [PPSuffixHandler]
-- | Convenience function; get the suffixes of these preprocessors.
ppSuffixes :: [PPSuffixHandler] -> [String]
-- | A preprocessor for turning non-Haskell files with the given extension
-- into plain Haskell source files.
type PPSuffixHandler = (String, BuildInfo -> LocalBuildInfo -> PreProcessor)
-- | The interface to a preprocessor, which may be implemented using an
-- external program, but need not be. The arguments are the name of the
-- input file, the name of the output file and a verbosity level. Here is
-- a simple example that merely prepends a comment to the given source
-- file:
--
-- <pre>
-- ppTestHandler :: PreProcessor
-- ppTestHandler =
-- PreProcessor {
-- platformIndependent = True,
-- runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity ->
-- do info verbosity (inFile++" has been preprocessed to "++outFile)
-- stuff <- readFile inFile
-- writeFile outFile ("-- preprocessed as a test\n\n" ++ stuff)
-- return ExitSuccess
-- </pre>
--
-- We split the input and output file names into a base directory and the
-- rest of the file name. The input base dir is the path in the list of
-- search dirs that this file was found in. The output base dir is the
-- build dir where all the generated source files are put.
--
-- The reason for splitting it up this way is that some pre-processors
-- don't simply generate one output .hs file from one input file but have
-- dependencies on other generated files (notably c2hs, where building
-- one .hs file may require reading other .chi files, and then compiling
-- the .hs file may require reading a generated .h file). In these cases
-- the generated files need to embed relative path names to each other
-- (eg the generated .hs file mentions the .h file in the FFI imports).
-- This path must be relative to the base directory where the generated
-- files are located, it cannot be relative to the top level of the build
-- tree because the compilers do not look for .h files relative to there,
-- ie we do not use "-I .", instead we use "-I dist/build" (or whatever
-- dist dir has been set by the user)
--
-- Most pre-processors do not care of course, so mkSimplePreProcessor and
-- runSimplePreProcessor functions handle the simple case.
data PreProcessor
PreProcessor :: Bool -> ((FilePath, FilePath) -> (FilePath, FilePath) -> Verbosity -> IO ()) -> PreProcessor
[platformIndependent] :: PreProcessor -> Bool
[runPreProcessor] :: PreProcessor -> (FilePath, FilePath) -> (FilePath, FilePath) -> Verbosity -> IO ()
mkSimplePreProcessor :: (FilePath -> FilePath -> Verbosity -> IO ()) -> (FilePath, FilePath) -> (FilePath, FilePath) -> Verbosity -> IO ()
runSimplePreProcessor :: PreProcessor -> FilePath -> FilePath -> Verbosity -> IO ()
ppCpp :: BuildInfo -> LocalBuildInfo -> PreProcessor
ppCpp' :: [String] -> BuildInfo -> LocalBuildInfo -> PreProcessor
ppGreenCard :: BuildInfo -> LocalBuildInfo -> PreProcessor
ppC2hs :: BuildInfo -> LocalBuildInfo -> PreProcessor
ppHsc2hs :: BuildInfo -> LocalBuildInfo -> PreProcessor
ppHappy :: BuildInfo -> LocalBuildInfo -> PreProcessor
ppAlex :: BuildInfo -> LocalBuildInfo -> PreProcessor
ppUnlit :: PreProcessor
platformDefines :: LocalBuildInfo -> [String]
-- | This deals with the <i>configure</i> phase. It provides the
-- <a>configure</a> action which is given the package description and
-- configure flags. It then tries to: configure the compiler; resolves
-- any conditionals in the package description; resolve the package
-- dependencies; check if all the extensions used by this package are
-- supported by the compiler; check that all the build tools are
-- available (including version checks if appropriate); checks for any
-- required <tt>pkg-config</tt> packages (updating the <a>BuildInfo</a>
-- with the results)
--
-- Then based on all this it saves the info in the <a>LocalBuildInfo</a>
-- and writes it out to the <tt>dist/setup-config</tt> file. It also
-- displays various details to the user, the amount of information
-- displayed depending on the verbosity level.
module Distribution.Simple.Configure
-- | Perform the "<tt>./setup configure</tt>" action. Returns the
-- <tt>.setup-config</tt> file.
configure :: (GenericPackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo
-- | After running configure, output the <a>LocalBuildInfo</a> to the
-- <a>localBuildInfoFile</a>.
writePersistBuildConfig :: FilePath -> LocalBuildInfo -> IO ()
-- | Read the <a>localBuildInfoFile</a>. Throw an exception if the file is
-- missing, if the file cannot be read, or if the file was created by an
-- older version of Cabal.
getConfigStateFile :: FilePath -> IO LocalBuildInfo
-- | Read the <a>localBuildInfoFile</a>. Throw an exception if the file is
-- missing, if the file cannot be read, or if the file was created by an
-- older version of Cabal.
getPersistBuildConfig :: FilePath -> IO LocalBuildInfo
-- | Check that localBuildInfoFile is up-to-date with respect to the .cabal
-- file.
checkPersistBuildConfigOutdated :: FilePath -> FilePath -> IO Bool
-- | Try to read the <a>localBuildInfoFile</a>.
tryGetPersistBuildConfig :: FilePath -> IO (Either ConfigStateFileError LocalBuildInfo)
-- | Try to read the <a>localBuildInfoFile</a>.
maybeGetPersistBuildConfig :: FilePath -> IO (Maybe LocalBuildInfo)
-- | Return the "dist/" prefix, or the default prefix. The prefix is taken
-- from (in order of highest to lowest preference) the override prefix,
-- the "CABAL_BUILDDIR" environment variable, or the default prefix.
findDistPref :: FilePath -> Flag FilePath -> IO FilePath
-- | Return the "dist/" prefix, or the default prefix. The prefix is taken
-- from (in order of highest to lowest preference) the override prefix,
-- the "CABAL_BUILDDIR" environment variable, or <a>defaultDistPref</a>
-- is used. Call this function to resolve a <tt>*DistPref</tt> flag
-- whenever it is not known to be set. (The <tt>*DistPref</tt> flags are
-- always set to a definite value before invoking <tt>UserHooks</tt>.)
findDistPrefOrDefault :: Flag FilePath -> IO FilePath
-- | This method computes a default, "good enough" <a>ComponentId</a> for a
-- package. The intent is that cabal-install (or the user) will specify a
-- more detailed IPID via the <tt>--ipid</tt> flag if necessary.
computeComponentId :: PackageIdentifier -> ComponentName -> [ComponentId] -> FlagAssignment -> ComponentId
-- | In GHC 8.0, the string we pass to GHC to use for symbol names for a
-- package can be an arbitrary, IPID-compatible string. However, prior to
-- GHC 8.0 there are some restrictions on what format this string can be
-- (due to how ghc-pkg parsed the key):
--
-- <ol>
-- <li>In GHC 7.10, the string had either be of the form foo_ABCD, where
-- foo is a non-semantic alphanumeric/hyphenated prefix and ABCD is two
-- base-64 encoded 64-bit integers, or a GHC 7.8 style identifier.</li>
-- <li>In GHC 7.8, the string had to be a valid package identifier like
-- foo-0.1.</li>
-- </ol>
--
-- So, the problem is that Cabal, in general, has a general IPID, but
-- needs to figure out a package key / package ID that the old ghc-pkg
-- will actually accept. But there's an EVERY WORSE problem: if ghc-pkg
-- decides to parse an identifier foo-0.1-xxx as if it were a package
-- identifier, which means it will SILENTLY DROP the "xxx" (because it's
-- a tag, and Cabal does not allow tags.) So we must CONNIVE to ensure
-- that we don't pick something that looks like this.
--
-- So this function attempts to define a mapping into the old formats.
--
-- The mapping for GHC 7.8 and before:
--
-- <ul>
-- <li>For CLibName, we unconditionally use the
-- <a>PackageIdentifier</a>.</li>
-- <li>For sub-components, we create a new <a>PackageIdentifier</a> which
-- is encoded in the following way. The test suite "qux" in package
-- "foobar-0.2" gets this package identifier "z-foobar-z-test-qux-0.2".
-- These package IDs have the form:cpid ::= "z-" package-id "-z-"
-- component-type "-" component-name component-type ::= "test" | "bench"
-- | "exe" | "lib" package-id and component-name have "-" ( "z" + ) "-"
-- segments encoded by adding an extra "z".</li>
-- </ul>
--
-- The mapping for GHC 7.10:
--
-- <ul>
-- <li>For CLibName: If the IPID is of the form foo-0.1-ABCDEF where
-- foo_ABCDEF would validly parse as a package key, we pass
-- <a>ABCDEF</a>. (NB: not all hashes parse this way, because GHC 7.10
-- mandated that these hashes be two base-62 encoded 64 bit integers),
-- but hashes that Cabal generated using <a>computeComponentId</a> are
-- guaranteed to have this form.If it is not of this form, we rehash the
-- IPID into the correct form and pass that.</li>
-- <li>For sub-components, we rehash the IPID into the correct format and
-- pass that.</li>
-- </ul>
computeCompatPackageKey :: Compiler -> PackageIdentifier -> ComponentName -> UnitId -> (PackageName, String)
-- | Get the path of <tt>dist/setup-config</tt>.
localBuildInfoFile :: FilePath -> FilePath
-- | List all installed packages in the given package databases.
getInstalledPackages :: Verbosity -> Compiler -> PackageDBStack -> ProgramConfiguration -> IO InstalledPackageIndex
-- | A set of files (or directories) that can be monitored to detect when
-- there might have been a change in the installed packages.
getInstalledPackagesMonitorFiles :: Verbosity -> Compiler -> PackageDBStack -> ProgramConfiguration -> Platform -> IO [FilePath]
-- | Like <a>getInstalledPackages</a>, but for a single package DB.
--
-- NB: Why isn't this always a fall through to
-- <a>getInstalledPackages</a>? That is because
-- <a>getInstalledPackages</a> performs some sanity checks on the package
-- database stack in question. However, when sandboxes are involved these
-- sanity checks are not desirable.
getPackageDBContents :: Verbosity -> Compiler -> PackageDB -> ProgramConfiguration -> IO InstalledPackageIndex
-- | <i>Deprecated: <a>configCompiler</a> is deprecated. Use
-- <a>configCompilerEx</a> instead.</i>
configCompiler :: Maybe CompilerFlavor -> Maybe FilePath -> Maybe FilePath -> ProgramConfiguration -> Verbosity -> IO (Compiler, ProgramConfiguration)
-- | <i>Deprecated: configCompilerAux is deprecated. Use
-- <a>configCompilerAuxEx</a> instead.</i>
configCompilerAux :: ConfigFlags -> IO (Compiler, ProgramConfiguration)
configCompilerEx :: Maybe CompilerFlavor -> Maybe FilePath -> Maybe FilePath -> ProgramConfiguration -> Verbosity -> IO (Compiler, Platform, ProgramConfiguration)
configCompilerAuxEx :: ConfigFlags -> IO (Compiler, Platform, ProgramConfiguration)
-- | Compute the effective value of the profiling flags
-- <tt>--enable-library-profiling</tt> and
-- <tt>--enable-executable-profiling</tt> from the specified
-- <a>ConfigFlags</a>. This may be useful for external Cabal tools which
-- need to interact with Setup in a backwards-compatible way: the most
-- predictable mechanism for enabling profiling across many legacy
-- versions is to NOT use <tt>--enable-profiling</tt> and use those two
-- flags instead.
--
-- Note that <tt>--enable-executable-profiling</tt> also affects
-- profiling of benchmarks and (non-detailed) test suites.
computeEffectiveProfiling :: ConfigFlags -> (Bool, Bool)
-- | Makes a <a>BuildInfo</a> from C compiler and linker flags.
--
-- This can be used with the output from configuration programs like
-- pkg-config and similar package-specific programs like mysql-config,
-- freealut-config etc. For example:
--
-- <pre>
-- ccflags <- rawSystemProgramStdoutConf verbosity prog conf ["--cflags"]
-- ldflags <- rawSystemProgramStdoutConf verbosity prog conf ["--libs"]
-- return (ccldOptionsBuildInfo (words ccflags) (words ldflags))
-- </pre>
ccLdOptionsBuildInfo :: [String] -> [String] -> BuildInfo
checkForeignDeps :: PackageDescription -> LocalBuildInfo -> Verbosity -> IO ()
-- | The user interface specifies the package dbs to use with a combination
-- of <tt>--global</tt>, <tt>--user</tt> and
-- <tt>--package-db=global|user|clear|$file</tt>. This function combines
-- the global/user flag and interprets the package-db flag into a single
-- package db stack.
interpretPackageDbFlags :: Bool -> [Maybe PackageDB] -> PackageDBStack
-- | The errors that can be thrown when reading the <tt>setup-config</tt>
-- file.
data ConfigStateFileError
-- | No header found.
ConfigStateFileNoHeader :: ConfigStateFileError
-- | Incorrect header.
ConfigStateFileBadHeader :: ConfigStateFileError
-- | Cannot parse file contents.
ConfigStateFileNoParse :: ConfigStateFileError
-- | No file!
ConfigStateFileMissing :: ConfigStateFileError
-- | Mismatched version.
ConfigStateFileBadVersion :: PackageIdentifier -> PackageIdentifier -> (Either ConfigStateFileError LocalBuildInfo) -> ConfigStateFileError
-- | Read the <a>localBuildInfoFile</a>, returning either an error or the
-- local build info.
tryGetConfigStateFile :: FilePath -> IO (Either ConfigStateFileError LocalBuildInfo)
platformDefines :: LocalBuildInfo -> [String]
-- | Relax the dependencies of this package if needed.
relaxPackageDeps :: AllowNewer -> GenericPackageDescription -> GenericPackageDescription
instance GHC.Show.Show Distribution.Simple.Configure.ConfigStateFileError
instance GHC.Exception.Exception Distribution.Simple.Configure.ConfigStateFileError
-- | This is the entry point to actually building the modules in a package.
-- It doesn't actually do much itself, most of the work is delegated to
-- compiler-specific actions. It does do some non-compiler specific bits
-- like running pre-processors.
module Distribution.Simple.Build
-- | Build the libraries and executables in this package.
build :: PackageDescription -> LocalBuildInfo -> BuildFlags -> [PPSuffixHandler] -> IO ()
repl :: PackageDescription -> LocalBuildInfo -> ReplFlags -> [PPSuffixHandler] -> [String] -> IO ()
-- | Start an interpreter without loading any package files.
startInterpreter :: Verbosity -> ProgramDb -> Compiler -> Platform -> PackageDBStack -> IO ()
initialBuildSteps :: FilePath -> PackageDescription -> LocalBuildInfo -> Verbosity -> IO ()
-- | Generate and write out the Paths_<a>pkg</a>.hs and cabal_macros.h
-- files
writeAutogenFiles :: Verbosity -> PackageDescription -> LocalBuildInfo -> IO ()
-- | This module deals with the <tt>haddock</tt> and <tt>hscolour</tt>
-- commands. It uses information about installed packages (from
-- <tt>ghc-pkg</tt>) to find the locations of documentation for dependent
-- packages, so it can create links.
--
-- The <tt>hscolour</tt> support allows generating HTML versions of the
-- original source, with coloured syntax highlighting.
module Distribution.Simple.Haddock
haddock :: PackageDescription -> LocalBuildInfo -> [PPSuffixHandler] -> HaddockFlags -> IO ()
hscolour :: PackageDescription -> LocalBuildInfo -> [PPSuffixHandler] -> HscolourFlags -> IO ()
-- | Given a list of <a>InstalledPackageInfo</a>s, return a list of
-- interfaces and HTML paths, and an optional warning for packages with
-- missing documentation.
haddockPackagePaths :: [InstalledPackageInfo] -> Maybe (InstalledPackageInfo -> FilePath) -> IO ([(FilePath, Maybe FilePath)], Maybe String)
instance GHC.Generics.Generic Distribution.Simple.Haddock.HaddockArgs
instance GHC.Classes.Ord Distribution.Simple.Haddock.Directory
instance GHC.Classes.Eq Distribution.Simple.Haddock.Directory
instance GHC.Show.Show Distribution.Simple.Haddock.Directory
instance GHC.Read.Read Distribution.Simple.Haddock.Directory
instance GHC.Base.Monoid Distribution.Simple.Haddock.HaddockArgs
instance Data.Semigroup.Semigroup Distribution.Simple.Haddock.HaddockArgs
instance GHC.Base.Monoid Distribution.Simple.Haddock.Directory
instance Data.Semigroup.Semigroup Distribution.Simple.Haddock.Directory
-- | This handles the <tt>sdist</tt> command. The module exports an
-- <a>sdist</a> action but also some of the phases that make it up so
-- that other tools can use just the bits they need. In particular the
-- preparation of the tree of files to go into the source tarball is
-- separated from actually building the source tarball.
--
-- The <a>createArchive</a> action uses the external <tt>tar</tt> program
-- and assumes that it accepts the <tt>-z</tt> flag. Neither of these
-- assumptions are valid on Windows. The <a>sdist</a> action now also
-- does some distribution QA checks.
module Distribution.Simple.SrcDist
-- | Create a source distribution.
sdist :: PackageDescription -> Maybe LocalBuildInfo -> SDistFlags -> (FilePath -> FilePath) -> [PPSuffixHandler] -> IO ()
printPackageProblems :: Verbosity -> PackageDescription -> IO ()
-- | Prepare a directory tree of source files.
prepareTree :: Verbosity -> PackageDescription -> Maybe LocalBuildInfo -> FilePath -> [PPSuffixHandler] -> IO ()
-- | Create an archive from a tree of source files, and clean up the tree.
createArchive :: CreateArchiveFun
-- | Prepare a directory tree of source files for a snapshot version. It is
-- expected that the appropriate snapshot version has already been set in
-- the package description, eg using <a>snapshotPackage</a> or
-- <a>snapshotVersion</a>.
prepareSnapshotTree :: Verbosity -> PackageDescription -> Maybe LocalBuildInfo -> FilePath -> [PPSuffixHandler] -> IO ()
-- | Modifies a <a>PackageDescription</a> by appending a snapshot number
-- corresponding to the given date.
snapshotPackage :: UTCTime -> PackageDescription -> PackageDescription
-- | Modifies a <a>Version</a> by appending a snapshot number corresponding
-- to the given date.
snapshotVersion :: UTCTime -> Version -> Version
-- | Given a date produce a corresponding integer representation. For
-- example given a date <tt>18<i>03</i>2008</tt> produce the number
-- <tt>20080318</tt>.
dateToSnapshotNumber :: UTCTime -> Int
-- | List all source files of a package. Returns a tuple of lists: first
-- component is a list of ordinary files, second one is a list of those
-- files that may be executable.
listPackageSources :: Verbosity -> PackageDescription -> [PPSuffixHandler] -> IO ([FilePath], [FilePath])
-- | This defines the API that <tt>Setup.hs</tt> scripts can use to
-- customise the way the build works. This module just defines the
-- <a>UserHooks</a> type. The predefined sets of hooks that implement the
-- <tt>Simple</tt>, <tt>Make</tt> and <tt>Configure</tt> build systems
-- are defined in <a>Distribution.Simple</a>. The <a>UserHooks</a> is a
-- big record of functions. There are 3 for each action, a pre, post and
-- the action itself. There are few other miscellaneous hooks, ones to
-- extend the set of programs and preprocessors and one to override the
-- function used to read the <tt>.cabal</tt> file.
--
-- This hooks type is widely agreed to not be the right solution. Partly
-- this is because changes to it usually break custom <tt>Setup.hs</tt>
-- files and yet many internal code changes do require changes to the
-- hooks. For example we cannot pass any extra parameters to most of the
-- functions that implement the various phases because it would involve
-- changing the types of the corresponding hook. At some point it will
-- have to be replaced.
module Distribution.Simple.UserHooks
-- | Hooks allow authors to add specific functionality before and after a
-- command is run, and also to specify additional preprocessors.
--
-- <ul>
-- <li>WARNING: The hooks interface is under rather constant flux as we
-- try to understand users needs. Setup files that depend on this
-- interface may break in future releases.</li>
-- </ul>
data UserHooks
UserHooks :: (Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO ()) -> IO (Maybe GenericPackageDescription) -> [PPSuffixHandler] -> [Program] -> (Args -> ConfigFlags -> IO HookedBuildInfo) -> ((GenericPackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo) -> (Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> BuildFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO ()) -> (Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> ReplFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> ReplFlags -> [String] -> IO ()) -> (Args -> ReplFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> CleanFlags -> IO HookedBuildInfo) -> (PackageDescription -> () -> UserHooks -> CleanFlags -> IO ()) -> (Args -> CleanFlags -> PackageDescription -> () -> IO ()) -> (Args -> CopyFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> CopyFlags -> IO ()) -> (Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> InstallFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> InstallFlags -> IO ()) -> (Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> SDistFlags -> IO HookedBuildInfo) -> (PackageDescription -> Maybe LocalBuildInfo -> UserHooks -> SDistFlags -> IO ()) -> (Args -> SDistFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO ()) -> (Args -> RegisterFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()) -> (Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> RegisterFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()) -> (Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> HscolourFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> HscolourFlags -> IO ()) -> (Args -> HscolourFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> HaddockFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> HaddockFlags -> IO ()) -> (Args -> HaddockFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> TestFlags -> IO HookedBuildInfo) -> (Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> TestFlags -> IO ()) -> (Args -> TestFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> BenchmarkFlags -> IO HookedBuildInfo) -> (Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> BenchmarkFlags -> IO ()) -> (Args -> BenchmarkFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> UserHooks
-- | Used for <tt>./setup test</tt>
-- | <i>Deprecated: Please use the new testing interface instead!</i>
[runTests] :: UserHooks -> Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Read the description file
[readDesc] :: UserHooks -> IO (Maybe GenericPackageDescription)
-- | Custom preprocessors in addition to and overriding
-- <a>knownSuffixHandlers</a>.
[hookedPreProcessors] :: UserHooks -> [PPSuffixHandler]
-- | These programs are detected at configure time. Arguments for them are
-- added to the configure command.
[hookedPrograms] :: UserHooks -> [Program]
-- | Hook to run before configure command
[preConf] :: UserHooks -> Args -> ConfigFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during configure.
[confHook] :: UserHooks -> (GenericPackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo
-- | Hook to run after configure command
[postConf] :: UserHooks -> Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before build command. Second arg indicates verbosity
-- level.
[preBuild] :: UserHooks -> Args -> BuildFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during build.
[buildHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO ()
-- | Hook to run after build command. Second arg indicates verbosity level.
[postBuild] :: UserHooks -> Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before repl command. Second arg indicates verbosity level.
[preRepl] :: UserHooks -> Args -> ReplFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during interpretation.
[replHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> ReplFlags -> [String] -> IO ()
-- | Hook to run after repl command. Second arg indicates verbosity level.
[postRepl] :: UserHooks -> Args -> ReplFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before clean command. Second arg indicates verbosity
-- level.
[preClean] :: UserHooks -> Args -> CleanFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during clean.
[cleanHook] :: UserHooks -> PackageDescription -> () -> UserHooks -> CleanFlags -> IO ()
-- | Hook to run after clean command. Second arg indicates verbosity level.
[postClean] :: UserHooks -> Args -> CleanFlags -> PackageDescription -> () -> IO ()
-- | Hook to run before copy command
[preCopy] :: UserHooks -> Args -> CopyFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during copy.
[copyHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> CopyFlags -> IO ()
-- | Hook to run after copy command
[postCopy] :: UserHooks -> Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before install command
[preInst] :: UserHooks -> Args -> InstallFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during install.
[instHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> InstallFlags -> IO ()
-- | Hook to run after install command. postInst should be run on the
-- target, not on the build machine.
[postInst] :: UserHooks -> Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before sdist command. Second arg indicates verbosity
-- level.
[preSDist] :: UserHooks -> Args -> SDistFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during sdist.
[sDistHook] :: UserHooks -> PackageDescription -> Maybe LocalBuildInfo -> UserHooks -> SDistFlags -> IO ()
-- | Hook to run after sdist command. Second arg indicates verbosity level.
[postSDist] :: UserHooks -> Args -> SDistFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO ()
-- | Hook to run before register command
[preReg] :: UserHooks -> Args -> RegisterFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during registration.
[regHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()
-- | Hook to run after register command
[postReg] :: UserHooks -> Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before unregister command
[preUnreg] :: UserHooks -> Args -> RegisterFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during unregistration.
[unregHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()
-- | Hook to run after unregister command
[postUnreg] :: UserHooks -> Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before hscolour command. Second arg indicates verbosity
-- level.
[preHscolour] :: UserHooks -> Args -> HscolourFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during hscolour.
[hscolourHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> HscolourFlags -> IO ()
-- | Hook to run after hscolour command. Second arg indicates verbosity
-- level.
[postHscolour] :: UserHooks -> Args -> HscolourFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before haddock command. Second arg indicates verbosity
-- level.
[preHaddock] :: UserHooks -> Args -> HaddockFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during haddock.
[haddockHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> HaddockFlags -> IO ()
-- | Hook to run after haddock command. Second arg indicates verbosity
-- level.
[postHaddock] :: UserHooks -> Args -> HaddockFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before test command.
[preTest] :: UserHooks -> Args -> TestFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during test.
[testHook] :: UserHooks -> Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> TestFlags -> IO ()
-- | Hook to run after test command.
[postTest] :: UserHooks -> Args -> TestFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before bench command.
[preBench] :: UserHooks -> Args -> BenchmarkFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during bench.
[benchHook] :: UserHooks -> Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> BenchmarkFlags -> IO ()
-- | Hook to run after bench command.
[postBench] :: UserHooks -> Args -> BenchmarkFlags -> PackageDescription -> LocalBuildInfo -> IO ()
type Args = [String]
-- | Empty <a>UserHooks</a> which do nothing.
emptyUserHooks :: UserHooks
-- | This is the entry point into running the benchmarks in a built
-- package. It performs the "<tt>./setup bench</tt>" action. It runs
-- benchmarks designated in the package description.
module Distribution.Simple.Bench
-- | Perform the "<tt>./setup bench</tt>" action.
bench :: Args -> PackageDescription -> LocalBuildInfo -> BenchmarkFlags -> IO ()
-- | This is the entry point into testing a built package. It performs the
-- "<tt>./setup test</tt>" action. It runs test suites designated in the
-- package description and reports on the results.
module Distribution.Simple.Test
-- | Perform the "<tt>./setup test</tt>" action.
test :: Args -> PackageDescription -> LocalBuildInfo -> TestFlags -> IO ()
-- | This is the command line front end to the Simple build system. When
-- given the parsed command-line args and package information, is able to
-- perform basic commands like configure, build, install, register, etc.
--
-- This module exports the main functions that Setup.hs scripts use. It
-- re-exports the <a>UserHooks</a> type, the standard entry points like
-- <a>defaultMain</a> and <a>defaultMainWithHooks</a> and the predefined
-- sets of <a>UserHooks</a> that custom <tt>Setup.hs</tt> scripts can
-- extend to add their own behaviour.
--
-- This module isn't called "Simple" because it's simple. Far from it.
-- It's called "Simple" because it does complicated things to simple
-- software.
--
-- The original idea was that there could be different build systems that
-- all presented the same compatible command line interfaces. There is
-- still a <a>Distribution.Make</a> system but in practice no packages
-- use it.
module Distribution.Simple
-- | A simple implementation of <tt>main</tt> for a Cabal setup script. It
-- reads the package description file using IO, and performs the action
-- specified on the command line.
defaultMain :: IO ()
-- | Like <a>defaultMain</a>, but accepts the package description as input
-- rather than using IO to read it.
defaultMainNoRead :: GenericPackageDescription -> IO ()
-- | A version of <a>defaultMain</a> that is passed the command line
-- arguments, rather than getting them from the environment.
defaultMainArgs :: [String] -> IO ()
-- | Hooks allow authors to add specific functionality before and after a
-- command is run, and also to specify additional preprocessors.
--
-- <ul>
-- <li>WARNING: The hooks interface is under rather constant flux as we
-- try to understand users needs. Setup files that depend on this
-- interface may break in future releases.</li>
-- </ul>
data UserHooks
UserHooks :: (Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO ()) -> IO (Maybe GenericPackageDescription) -> [PPSuffixHandler] -> [Program] -> (Args -> ConfigFlags -> IO HookedBuildInfo) -> ((GenericPackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo) -> (Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> BuildFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO ()) -> (Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> ReplFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> ReplFlags -> [String] -> IO ()) -> (Args -> ReplFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> CleanFlags -> IO HookedBuildInfo) -> (PackageDescription -> () -> UserHooks -> CleanFlags -> IO ()) -> (Args -> CleanFlags -> PackageDescription -> () -> IO ()) -> (Args -> CopyFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> CopyFlags -> IO ()) -> (Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> InstallFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> InstallFlags -> IO ()) -> (Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> SDistFlags -> IO HookedBuildInfo) -> (PackageDescription -> Maybe LocalBuildInfo -> UserHooks -> SDistFlags -> IO ()) -> (Args -> SDistFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO ()) -> (Args -> RegisterFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()) -> (Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> RegisterFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()) -> (Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> HscolourFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> HscolourFlags -> IO ()) -> (Args -> HscolourFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> HaddockFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> HaddockFlags -> IO ()) -> (Args -> HaddockFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> TestFlags -> IO HookedBuildInfo) -> (Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> TestFlags -> IO ()) -> (Args -> TestFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> BenchmarkFlags -> IO HookedBuildInfo) -> (Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> BenchmarkFlags -> IO ()) -> (Args -> BenchmarkFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> UserHooks
-- | Used for <tt>./setup test</tt>
-- | <i>Deprecated: Please use the new testing interface instead!</i>
[runTests] :: UserHooks -> Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Read the description file
[readDesc] :: UserHooks -> IO (Maybe GenericPackageDescription)
-- | Custom preprocessors in addition to and overriding
-- <a>knownSuffixHandlers</a>.
[hookedPreProcessors] :: UserHooks -> [PPSuffixHandler]
-- | These programs are detected at configure time. Arguments for them are
-- added to the configure command.
[hookedPrograms] :: UserHooks -> [Program]
-- | Hook to run before configure command
[preConf] :: UserHooks -> Args -> ConfigFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during configure.
[confHook] :: UserHooks -> (GenericPackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo
-- | Hook to run after configure command
[postConf] :: UserHooks -> Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before build command. Second arg indicates verbosity
-- level.
[preBuild] :: UserHooks -> Args -> BuildFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during build.
[buildHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO ()
-- | Hook to run after build command. Second arg indicates verbosity level.
[postBuild] :: UserHooks -> Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before repl command. Second arg indicates verbosity level.
[preRepl] :: UserHooks -> Args -> ReplFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during interpretation.
[replHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> ReplFlags -> [String] -> IO ()
-- | Hook to run after repl command. Second arg indicates verbosity level.
[postRepl] :: UserHooks -> Args -> ReplFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before clean command. Second arg indicates verbosity
-- level.
[preClean] :: UserHooks -> Args -> CleanFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during clean.
[cleanHook] :: UserHooks -> PackageDescription -> () -> UserHooks -> CleanFlags -> IO ()
-- | Hook to run after clean command. Second arg indicates verbosity level.
[postClean] :: UserHooks -> Args -> CleanFlags -> PackageDescription -> () -> IO ()
-- | Hook to run before copy command
[preCopy] :: UserHooks -> Args -> CopyFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during copy.
[copyHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> CopyFlags -> IO ()
-- | Hook to run after copy command
[postCopy] :: UserHooks -> Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before install command
[preInst] :: UserHooks -> Args -> InstallFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during install.
[instHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> InstallFlags -> IO ()
-- | Hook to run after install command. postInst should be run on the
-- target, not on the build machine.
[postInst] :: UserHooks -> Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before sdist command. Second arg indicates verbosity
-- level.
[preSDist] :: UserHooks -> Args -> SDistFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during sdist.
[sDistHook] :: UserHooks -> PackageDescription -> Maybe LocalBuildInfo -> UserHooks -> SDistFlags -> IO ()
-- | Hook to run after sdist command. Second arg indicates verbosity level.
[postSDist] :: UserHooks -> Args -> SDistFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO ()
-- | Hook to run before register command
[preReg] :: UserHooks -> Args -> RegisterFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during registration.
[regHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()
-- | Hook to run after register command
[postReg] :: UserHooks -> Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before unregister command
[preUnreg] :: UserHooks -> Args -> RegisterFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during unregistration.
[unregHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()
-- | Hook to run after unregister command
[postUnreg] :: UserHooks -> Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before hscolour command. Second arg indicates verbosity
-- level.
[preHscolour] :: UserHooks -> Args -> HscolourFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during hscolour.
[hscolourHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> HscolourFlags -> IO ()
-- | Hook to run after hscolour command. Second arg indicates verbosity
-- level.
[postHscolour] :: UserHooks -> Args -> HscolourFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before haddock command. Second arg indicates verbosity
-- level.
[preHaddock] :: UserHooks -> Args -> HaddockFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during haddock.
[haddockHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> HaddockFlags -> IO ()
-- | Hook to run after haddock command. Second arg indicates verbosity
-- level.
[postHaddock] :: UserHooks -> Args -> HaddockFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before test command.
[preTest] :: UserHooks -> Args -> TestFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during test.
[testHook] :: UserHooks -> Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> TestFlags -> IO ()
-- | Hook to run after test command.
[postTest] :: UserHooks -> Args -> TestFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-- | Hook to run before bench command.
[preBench] :: UserHooks -> Args -> BenchmarkFlags -> IO HookedBuildInfo
-- | Over-ride this hook to get different behavior during bench.
[benchHook] :: UserHooks -> Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> BenchmarkFlags -> IO ()
-- | Hook to run after bench command.
[postBench] :: UserHooks -> Args -> BenchmarkFlags -> PackageDescription -> LocalBuildInfo -> IO ()
type Args = [String]
-- | A customizable version of <a>defaultMain</a>.
defaultMainWithHooks :: UserHooks -> IO ()
-- | A customizable version of <a>defaultMain</a> that also takes the
-- command line arguments.
defaultMainWithHooksArgs :: UserHooks -> [String] -> IO ()
-- | Hooks that correspond to a plain instantiation of the "simple" build
-- system
simpleUserHooks :: UserHooks
autoconfUserHooks :: UserHooks
-- | Basic autoconf <a>UserHooks</a>:
--
-- <ul>
-- <li><a>postConf</a> runs <tt>./configure</tt>, if present.</li>
-- <li>the pre-hooks <a>preBuild</a>, <a>preClean</a>, <a>preCopy</a>,
-- <a>preInst</a>, <a>preReg</a> and <a>preUnreg</a> read additional
-- build information from <i>package</i><tt>.buildinfo</tt>, if
-- present.</li>
-- </ul>
--
-- Thus <tt>configure</tt> can use local system information to generate
-- <i>package</i><tt>.buildinfo</tt> and possibly other files.
-- | <i>Deprecated: Use simpleUserHooks or autoconfUserHooks, unless you
-- need Cabal-1.2 compatibility in which case you must stick with
-- defaultUserHooks</i>
defaultUserHooks :: UserHooks
-- | Empty <a>UserHooks</a> which do nothing.
emptyUserHooks :: UserHooks
-- | Optional auxiliary package information file
-- (<i>pkgname</i><tt>.buildinfo</tt>)
defaultHookedPackageDesc :: IO (Maybe FilePath)
|