版博士V2.0程序
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 

794 行
20 KiB

  1. import { getApplicativeMonoid } from './Applicative';
  2. import { ap as ap_, apFirst as apFirst_, apS as apS_, apSecond as apSecond_, getApplySemigroup as getApplySemigroup_ } from './Apply';
  3. import { bind as bind_, chainFirst as chainFirst_ } from './Chain';
  4. import { compact as compact_, separate as separate_ } from './Compactable';
  5. import * as E from './Either';
  6. import * as ET from './EitherT';
  7. import { filter as filter_, filterMap as filterMap_, partition as partition_, partitionMap as partitionMap_ } from './Filterable';
  8. import { chainEitherK as chainEitherK_, chainOptionK as chainOptionK_, filterOrElse as filterOrElse_, fromEitherK as fromEitherK_, fromOption as fromOption_, fromOptionK as fromOptionK_, fromPredicate as fromPredicate_, chainFirstEitherK as chainFirstEitherK_ } from './FromEither';
  9. import { ask as ask_, asks as asks_, chainFirstReaderK as chainFirstReaderK_, chainReaderK as chainReaderK_, fromReaderK as fromReaderK_ } from './FromReader';
  10. import { flow, identity, pipe, SK } from './function';
  11. import { let as let__, bindTo as bindTo_, flap as flap_ } from './Functor';
  12. import * as _ from './internal';
  13. import * as R from './Reader';
  14. // -------------------------------------------------------------------------------------
  15. // constructors
  16. // -------------------------------------------------------------------------------------
  17. /**
  18. * @category constructors
  19. * @since 2.0.0
  20. */
  21. export var left = /*#__PURE__*/ ET.left(R.Pointed);
  22. /**
  23. * @category constructors
  24. * @since 2.0.0
  25. */
  26. export var right = /*#__PURE__*/ ET.right(R.Pointed);
  27. /**
  28. * @category constructors
  29. * @since 2.0.0
  30. */
  31. export var rightReader =
  32. /*#__PURE__*/ ET.rightF(R.Functor);
  33. /**
  34. * @category constructors
  35. * @since 2.0.0
  36. */
  37. export var leftReader = /*#__PURE__*/ ET.leftF(R.Functor);
  38. // -------------------------------------------------------------------------------------
  39. // conversions
  40. // -------------------------------------------------------------------------------------
  41. /**
  42. * @category conversions
  43. * @since 2.0.0
  44. */
  45. export var fromEither = R.of;
  46. /**
  47. * @category conversions
  48. * @since 2.11.0
  49. */
  50. export var fromReader = rightReader;
  51. /**
  52. * @category pattern matching
  53. * @since 2.10.0
  54. */
  55. export var match = /*#__PURE__*/ ET.match(R.Functor);
  56. /**
  57. * Less strict version of [`match`](#match).
  58. *
  59. * The `W` suffix (short for **W**idening) means that the handler return types will be merged.
  60. *
  61. * @category pattern matching
  62. * @since 2.10.0
  63. */
  64. export var matchW = match;
  65. /**
  66. * The `E` suffix (short for **E**ffect) means that the handlers return an effect (`Reader`).
  67. *
  68. * @category pattern matching
  69. * @since 2.10.0
  70. */
  71. export var matchE = /*#__PURE__*/ ET.matchE(R.Monad);
  72. /**
  73. * Alias of [`matchE`](#matche).
  74. *
  75. * @category pattern matching
  76. * @since 2.0.0
  77. */
  78. export var fold = matchE;
  79. /**
  80. * Less strict version of [`matchE`](#matche).
  81. *
  82. * The `W` suffix (short for **W**idening) means that the handler return types will be merged.
  83. *
  84. * @category pattern matching
  85. * @since 2.10.0
  86. */
  87. export var matchEW = matchE;
  88. /**
  89. * Alias of [`matchEW`](#matchew).
  90. *
  91. * @category pattern matching
  92. * @since 2.10.0
  93. */
  94. export var foldW = matchEW;
  95. /**
  96. * @category error handling
  97. * @since 2.0.0
  98. */
  99. export var getOrElse =
  100. /*#__PURE__*/ ET.getOrElse(R.Monad);
  101. /**
  102. * Less strict version of [`getOrElse`](#getorelse).
  103. *
  104. * The `W` suffix (short for **W**idening) means that the handler return type will be merged.
  105. *
  106. * @category error handling
  107. * @since 2.6.0
  108. */
  109. export var getOrElseW = getOrElse;
  110. /**
  111. * @category conversions
  112. * @since 2.10.0
  113. */
  114. export var toUnion = /*#__PURE__*/ ET.toUnion(R.Functor);
  115. // -------------------------------------------------------------------------------------
  116. // combinators
  117. // -------------------------------------------------------------------------------------
  118. /**
  119. * Changes the value of the local context during the execution of the action `ma` (similar to `Contravariant`'s
  120. * `contramap`).
  121. *
  122. * @since 2.0.0
  123. */
  124. export var local = R.local;
  125. /**
  126. * Less strict version of [`asksReaderEither`](#asksreadereither).
  127. *
  128. * The `W` suffix (short for **W**idening) means that the environment types will be merged.
  129. *
  130. * @category constructors
  131. * @since 2.11.0
  132. */
  133. export var asksReaderEitherW = R.asksReaderW;
  134. /**
  135. * Effectfully accesses the environment.
  136. *
  137. * @category constructors
  138. * @since 2.11.0
  139. */
  140. export var asksReaderEither = asksReaderEitherW;
  141. /**
  142. * @category error handling
  143. * @since 2.0.0
  144. */
  145. export var orElse = /*#__PURE__*/ ET.orElse(R.Monad);
  146. /**
  147. * Less strict version of [`orElse`](#orelse).
  148. *
  149. * The `W` suffix (short for **W**idening) means that the environment types and the return types will be merged.
  150. *
  151. * @category error handling
  152. * @since 2.10.0
  153. */
  154. export var orElseW = orElse;
  155. /**
  156. * @category error handling
  157. * @since 2.11.0
  158. */
  159. export var orElseFirst = /*#__PURE__*/ ET.orElseFirst(R.Monad);
  160. /**
  161. * The `W` suffix (short for **W**idening) means that the environment types and the return types will be merged.
  162. *
  163. * @category error handling
  164. * @since 2.11.0
  165. */
  166. export var orElseFirstW = orElseFirst;
  167. /**
  168. * @category error handling
  169. * @since 2.11.0
  170. */
  171. export var orLeft = /*#__PURE__*/ ET.orLeft(R.Monad);
  172. /**
  173. * @since 2.0.0
  174. */
  175. export var swap = /*#__PURE__*/ ET.swap(R.Functor);
  176. /* istanbul ignore next */
  177. var _map = function (fa, f) { return pipe(fa, map(f)); };
  178. /* istanbul ignore next */
  179. var _bimap = function (fa, f, g) { return pipe(fa, bimap(f, g)); };
  180. /* istanbul ignore next */
  181. var _mapLeft = function (fa, f) { return pipe(fa, mapLeft(f)); };
  182. /* istanbul ignore next */
  183. var _ap = function (fab, fa) { return pipe(fab, ap(fa)); };
  184. /* istanbul ignore next */
  185. var _chain = function (ma, f) { return pipe(ma, chain(f)); };
  186. /* istanbul ignore next */
  187. var _alt = function (fa, that) { return pipe(fa, alt(that)); };
  188. /**
  189. * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F<A>) => F<B>` whose argument and return types
  190. * use the type constructor `F` to represent some computational context.
  191. *
  192. * @category mapping
  193. * @since 2.0.0
  194. */
  195. export var map =
  196. /*#__PURE__*/ ET.map(R.Functor);
  197. /**
  198. * Map a pair of functions over the two last type arguments of the bifunctor.
  199. *
  200. * @category mapping
  201. * @since 2.0.0
  202. */
  203. export var bimap = /*#__PURE__*/ ET.bimap(R.Functor);
  204. /**
  205. * Map a function over the second type argument of a bifunctor.
  206. *
  207. * @category error handling
  208. * @since 2.0.0
  209. */
  210. export var mapLeft =
  211. /*#__PURE__*/ ET.mapLeft(R.Functor);
  212. /**
  213. * @since 2.0.0
  214. */
  215. export var ap = /*#__PURE__*/ ET.ap(R.Apply);
  216. /**
  217. * Less strict version of [`ap`](#ap).
  218. *
  219. * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged.
  220. *
  221. * @since 2.8.0
  222. */
  223. export var apW = ap;
  224. /**
  225. * @category constructors
  226. * @since 2.8.5
  227. */
  228. export var of = right;
  229. /**
  230. * Composes computations in sequence, using the return value of one computation to determine the next computation.
  231. *
  232. * @category sequencing
  233. * @since 2.0.0
  234. */
  235. export var chain = /*#__PURE__*/ ET.chain(R.Monad);
  236. /**
  237. * Less strict version of [`chain`](#chain).
  238. *
  239. * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged.
  240. *
  241. * @category sequencing
  242. * @since 2.6.0
  243. */
  244. export var chainW = chain;
  245. /**
  246. * Less strict version of [`flatten`](#flatten).
  247. *
  248. * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged.
  249. *
  250. * @category sequencing
  251. * @since 2.11.0
  252. */
  253. export var flattenW = /*#__PURE__*/ chainW(identity);
  254. /**
  255. * @category sequencing
  256. * @since 2.0.0
  257. */
  258. export var flatten = flattenW;
  259. /**
  260. * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to
  261. * types of kind `* -> *`.
  262. *
  263. * @category error handling
  264. * @since 2.0.0
  265. */
  266. export var alt =
  267. /*#__PURE__*/ ET.alt(R.Monad);
  268. /**
  269. * Less strict version of [`alt`](#alt).
  270. *
  271. * The `W` suffix (short for **W**idening) means that the environment, the error and the return types will be merged.
  272. *
  273. * @category error handling
  274. * @since 2.9.0
  275. */
  276. export var altW = alt;
  277. /**
  278. * @since 2.7.0
  279. */
  280. export var throwError = left;
  281. /**
  282. * @category type lambdas
  283. * @since 2.0.0
  284. */
  285. export var URI = 'ReaderEither';
  286. /**
  287. * @category filtering
  288. * @since 2.10.0
  289. */
  290. export var getCompactable = function (M) {
  291. var C = E.getCompactable(M);
  292. return {
  293. URI: URI,
  294. _E: undefined,
  295. compact: compact_(R.Functor, C),
  296. separate: separate_(R.Functor, C, E.Functor)
  297. };
  298. };
  299. /**
  300. * @category filtering
  301. * @since 2.10.0
  302. */
  303. export function getFilterable(M) {
  304. var F = E.getFilterable(M);
  305. var C = getCompactable(M);
  306. var filter = filter_(R.Functor, F);
  307. var filterMap = filterMap_(R.Functor, F);
  308. var partition = partition_(R.Functor, F);
  309. var partitionMap = partitionMap_(R.Functor, F);
  310. return {
  311. URI: URI,
  312. _E: undefined,
  313. map: _map,
  314. compact: C.compact,
  315. separate: C.separate,
  316. filter: function (fa, predicate) { return pipe(fa, filter(predicate)); },
  317. filterMap: function (fa, f) { return pipe(fa, filterMap(f)); },
  318. partition: function (fa, predicate) { return pipe(fa, partition(predicate)); },
  319. partitionMap: function (fa, f) { return pipe(fa, partitionMap(f)); }
  320. };
  321. }
  322. /**
  323. * The default [`Applicative`](#applicative) instance returns the first error, if you want to
  324. * get all errors you need to provide a way to concatenate them via a `Semigroup`.
  325. *
  326. * See [`getApplicativeValidation`](./Either.ts.html#getapplicativevalidation).
  327. *
  328. * @category error handling
  329. * @since 2.7.0
  330. */
  331. export function getApplicativeReaderValidation(S) {
  332. var ap = ap_(R.Apply, E.getApplicativeValidation(S));
  333. return {
  334. URI: URI,
  335. _E: undefined,
  336. map: _map,
  337. ap: function (fab, fa) { return pipe(fab, ap(fa)); },
  338. of: of
  339. };
  340. }
  341. /**
  342. * The default [`Alt`](#alt) instance returns the last error, if you want to
  343. * get all errors you need to provide a way to concatenate them via a `Semigroup`.
  344. *
  345. * See [`getAltValidation`](./Either.ts.html#getaltvalidation).
  346. *
  347. * @category error handling
  348. * @since 2.7.0
  349. */
  350. export function getAltReaderValidation(S) {
  351. var alt = ET.altValidation(R.Monad, S);
  352. return {
  353. URI: URI,
  354. _E: undefined,
  355. map: _map,
  356. alt: function (fa, that) { return pipe(fa, alt(that)); }
  357. };
  358. }
  359. /**
  360. * @category instances
  361. * @since 2.7.0
  362. */
  363. export var Functor = {
  364. URI: URI,
  365. map: _map
  366. };
  367. /**
  368. * @category mapping
  369. * @since 2.10.0
  370. */
  371. export var flap = /*#__PURE__*/ flap_(Functor);
  372. /**
  373. * @category instances
  374. * @since 2.10.0
  375. */
  376. export var Pointed = {
  377. URI: URI,
  378. of: of
  379. };
  380. /**
  381. * @category instances
  382. * @since 2.10.0
  383. */
  384. export var Apply = {
  385. URI: URI,
  386. map: _map,
  387. ap: _ap
  388. };
  389. /**
  390. * Combine two effectful actions, keeping only the result of the first.
  391. *
  392. * @since 2.0.0
  393. */
  394. export var apFirst = /*#__PURE__*/ apFirst_(Apply);
  395. /**
  396. * Less strict version of [`apFirst`](#apfirst)
  397. *
  398. * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged.
  399. *
  400. * @since 2.12.0
  401. */
  402. export var apFirstW = apFirst;
  403. /**
  404. * Combine two effectful actions, keeping only the result of the second.
  405. *
  406. * @since 2.0.0
  407. */
  408. export var apSecond = /*#__PURE__*/ apSecond_(Apply);
  409. /**
  410. * Less strict version of [`apSecond`](#apsecond)
  411. *
  412. * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged.
  413. *
  414. * @since 2.12.0
  415. */
  416. export var apSecondW = apSecond;
  417. /**
  418. * @category instances
  419. * @since 2.7.0
  420. */
  421. export var Applicative = {
  422. URI: URI,
  423. map: _map,
  424. ap: _ap,
  425. of: of
  426. };
  427. /**
  428. * @category instances
  429. * @since 2.10.0
  430. */
  431. export var Chain = {
  432. URI: URI,
  433. map: _map,
  434. ap: _ap,
  435. chain: _chain
  436. };
  437. /**
  438. * @category instances
  439. * @since 2.7.0
  440. */
  441. export var Monad = {
  442. URI: URI,
  443. map: _map,
  444. ap: _ap,
  445. of: of,
  446. chain: _chain
  447. };
  448. /**
  449. * Composes computations in sequence, using the return value of one computation to determine the next computation and
  450. * keeping only the result of the first.
  451. *
  452. * @category sequencing
  453. * @since 2.0.0
  454. */
  455. export var chainFirst = /*#__PURE__*/ chainFirst_(Chain);
  456. /**
  457. * Less strict version of [`chainFirst`](#chainfirst)
  458. *
  459. * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged.
  460. *
  461. * @category sequencing
  462. * @since 2.8.0
  463. */
  464. export var chainFirstW = chainFirst;
  465. /**
  466. * @category instances
  467. * @since 2.7.0
  468. */
  469. export var Bifunctor = {
  470. URI: URI,
  471. bimap: _bimap,
  472. mapLeft: _mapLeft
  473. };
  474. /**
  475. * @category instances
  476. * @since 2.7.0
  477. */
  478. export var Alt = {
  479. URI: URI,
  480. map: _map,
  481. alt: _alt
  482. };
  483. /**
  484. * @category instances
  485. * @since 2.11.0
  486. */
  487. export var FromReader = {
  488. URI: URI,
  489. fromReader: fromReader
  490. };
  491. /**
  492. * Reads the current context.
  493. *
  494. * @category constructors
  495. * @since 2.0.0
  496. */
  497. export var ask = /*#__PURE__*/ ask_(FromReader);
  498. /**
  499. * Projects a value from the global context in a `ReaderEither`.
  500. *
  501. * @category constructors
  502. * @since 2.0.0
  503. */
  504. export var asks = /*#__PURE__*/ asks_(FromReader);
  505. /**
  506. * @category lifting
  507. * @since 2.11.0
  508. */
  509. export var fromReaderK = /*#__PURE__*/ fromReaderK_(FromReader);
  510. /**
  511. * @category sequencing
  512. * @since 2.11.0
  513. */
  514. export var chainReaderK = /*#__PURE__*/ chainReaderK_(FromReader, Chain);
  515. /**
  516. * Less strict version of [`chainReaderK`](#chainreaderk).
  517. *
  518. * The `W` suffix (short for **W**idening) means that the environment types will be merged.
  519. *
  520. * @category sequencing
  521. * @since 2.11.0
  522. */
  523. export var chainReaderKW = chainReaderK;
  524. /**
  525. * @category sequencing
  526. * @since 2.11.0
  527. */
  528. export var chainFirstReaderK = /*#__PURE__*/ chainFirstReaderK_(FromReader, Chain);
  529. /**
  530. * Less strict version of [`chainReaderK`](#chainreaderk).
  531. *
  532. * The `W` suffix (short for **W**idening) means that the environment types will be merged.
  533. *
  534. * @category sequencing
  535. * @since 2.11.0
  536. */
  537. export var chainFirstReaderKW = chainFirstReaderK;
  538. /**
  539. * @category instances
  540. * @since 2.7.0
  541. */
  542. export var MonadThrow = {
  543. URI: URI,
  544. map: _map,
  545. ap: _ap,
  546. of: of,
  547. chain: _chain,
  548. throwError: throwError
  549. };
  550. /**
  551. * @category instances
  552. * @since 2.10.0
  553. */
  554. export var FromEither = {
  555. URI: URI,
  556. fromEither: fromEither
  557. };
  558. /**
  559. * @category conversions
  560. * @since 2.0.0
  561. */
  562. export var fromOption =
  563. /*#__PURE__*/ fromOption_(FromEither);
  564. /**
  565. * @category lifting
  566. * @since 2.10.0
  567. */
  568. export var fromOptionK = /*#__PURE__*/ fromOptionK_(FromEither);
  569. /**
  570. * @category sequencing
  571. * @since 2.10.0
  572. */
  573. export var chainOptionK =
  574. /*#__PURE__*/ chainOptionK_(FromEither, Chain);
  575. /**
  576. * @category sequencing
  577. * @since 2.4.0
  578. */
  579. export var chainEitherK = /*#__PURE__*/ chainEitherK_(FromEither, Chain);
  580. /**
  581. * Less strict version of [`chainEitherK`](#chaineitherk).
  582. *
  583. * The `W` suffix (short for **W**idening) means that the error types will be merged.
  584. *
  585. * @category sequencing
  586. * @since 2.6.1
  587. */
  588. export var chainEitherKW = chainEitherK;
  589. /**
  590. * @category sequencing
  591. * @since 2.12.0
  592. */
  593. export var chainFirstEitherK = /*#__PURE__*/ chainFirstEitherK_(FromEither, Chain);
  594. /**
  595. * Less strict version of [`chainFirstEitherK`](#chainfirsteitherk).
  596. *
  597. * The `W` suffix (short for **W**idening) means that the environment types will be merged.
  598. *
  599. * @category sequencing
  600. * @since 2.12.0
  601. */
  602. export var chainFirstEitherKW = chainFirstEitherK;
  603. /**
  604. * @category lifting
  605. * @since 2.0.0
  606. */
  607. export var fromPredicate = /*#__PURE__*/ fromPredicate_(FromEither);
  608. /**
  609. * @category filtering
  610. * @since 2.0.0
  611. */
  612. export var filterOrElse = /*#__PURE__*/ filterOrElse_(FromEither, Chain);
  613. /**
  614. * Less strict version of [`filterOrElse`](#filterorelse).
  615. *
  616. * The `W` suffix (short for **W**idening) means that the error types will be merged.
  617. *
  618. * @category filtering
  619. * @since 2.9.0
  620. */
  621. export var filterOrElseW = filterOrElse;
  622. /**
  623. * @category lifting
  624. * @since 2.4.0
  625. */
  626. export var fromEitherK = /*#__PURE__*/ fromEitherK_(FromEither);
  627. // -------------------------------------------------------------------------------------
  628. // do notation
  629. // -------------------------------------------------------------------------------------
  630. /**
  631. * @category do notation
  632. * @since 2.9.0
  633. */
  634. export var Do = /*#__PURE__*/ of(_.emptyRecord);
  635. /**
  636. * @category do notation
  637. * @since 2.8.0
  638. */
  639. export var bindTo = /*#__PURE__*/ bindTo_(Functor);
  640. var let_ = /*#__PURE__*/ let__(Functor);
  641. export {
  642. /**
  643. * @category do notation
  644. * @since 2.13.0
  645. */
  646. let_ as let };
  647. /**
  648. * @category do notation
  649. * @since 2.8.0
  650. */
  651. export var bind = /*#__PURE__*/ bind_(Chain);
  652. /**
  653. * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged.
  654. *
  655. * @category do notation
  656. * @since 2.8.0
  657. */
  658. export var bindW = bind;
  659. /**
  660. * @category do notation
  661. * @since 2.8.0
  662. */
  663. export var apS = /*#__PURE__*/ apS_(Apply);
  664. /**
  665. * Less strict version of [`apS`](#aps).
  666. *
  667. * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged.
  668. *
  669. * @category do notation
  670. * @since 2.8.0
  671. */
  672. export var apSW = apS;
  673. /**
  674. * @since 2.11.0
  675. */
  676. export var ApT = /*#__PURE__*/ of(_.emptyReadonlyArray);
  677. // -------------------------------------------------------------------------------------
  678. // array utils
  679. // -------------------------------------------------------------------------------------
  680. /**
  681. * Equivalent to `ReadonlyNonEmptyArray#traverseWithIndex(Applicative)`.
  682. *
  683. * @category traversing
  684. * @since 2.11.0
  685. */
  686. export var traverseReadonlyNonEmptyArrayWithIndex = function (f) {
  687. return flow(R.traverseReadonlyNonEmptyArrayWithIndex(f), R.map(E.traverseReadonlyNonEmptyArrayWithIndex(SK)));
  688. };
  689. /**
  690. * Equivalent to `ReadonlyArray#traverseWithIndex(Applicative)`.
  691. *
  692. * @category traversing
  693. * @since 2.11.0
  694. */
  695. export var traverseReadonlyArrayWithIndex = function (f) {
  696. var g = traverseReadonlyNonEmptyArrayWithIndex(f);
  697. return function (as) { return (_.isNonEmpty(as) ? g(as) : ApT); };
  698. };
  699. /**
  700. * Equivalent to `ReadonlyArray#traverseWithIndex(Applicative)`.
  701. *
  702. * @category traversing
  703. * @since 2.9.0
  704. */
  705. export var traverseArrayWithIndex = traverseReadonlyArrayWithIndex;
  706. /**
  707. * Equivalent to `ReadonlyArray#traverse(Applicative)`.
  708. *
  709. * @category traversing
  710. * @since 2.9.0
  711. */
  712. export var traverseArray = function (f) { return traverseReadonlyArrayWithIndex(function (_, a) { return f(a); }); };
  713. /**
  714. * Equivalent to `ReadonlyArray#sequence(Applicative)`.
  715. *
  716. * @category traversing
  717. * @since 2.9.0
  718. */
  719. export var sequenceArray = /*#__PURE__*/ traverseArray(identity);
  720. // -------------------------------------------------------------------------------------
  721. // deprecated
  722. // -------------------------------------------------------------------------------------
  723. /**
  724. * This instance is deprecated, use small, specific instances instead.
  725. * For example if a function needs a `Functor` instance, pass `RE.Functor` instead of `RE.readerEither`
  726. * (where `R` is from `import R from 'fp-ts/ReaderEither'`)
  727. *
  728. * @category zone of death
  729. * @since 2.0.0
  730. * @deprecated
  731. */
  732. export var readerEither = {
  733. URI: URI,
  734. bimap: _bimap,
  735. mapLeft: _mapLeft,
  736. map: _map,
  737. of: of,
  738. ap: _ap,
  739. chain: _chain,
  740. alt: _alt,
  741. throwError: left
  742. };
  743. /**
  744. * Use [`getApplySemigroup`](./Apply.ts.html#getapplysemigroup) instead.
  745. *
  746. * @category zone of death
  747. * @since 2.0.0
  748. * @deprecated
  749. */
  750. export var getApplySemigroup =
  751. /*#__PURE__*/ getApplySemigroup_(Apply);
  752. /**
  753. * Use [`getApplicativeMonoid`](./Applicative.ts.html#getapplicativemonoid) instead.
  754. *
  755. * @category zone of death
  756. * @since 2.0.0
  757. * @deprecated
  758. */
  759. export var getApplyMonoid =
  760. /*#__PURE__*/ getApplicativeMonoid(Applicative);
  761. /**
  762. * Use [`getApplySemigroup`](./Apply.ts.html#getapplysemigroup) instead.
  763. *
  764. * @category zone of death
  765. * @since 2.0.0
  766. * @deprecated
  767. */
  768. export var getSemigroup = function (S) {
  769. return getApplySemigroup_(R.Apply)(E.getSemigroup(S));
  770. };
  771. /**
  772. * Use [`getApplicativeReaderValidation`](#getapplicativereadervalidation) and [`getAltReaderValidation`](#getaltreadervalidation) instead.
  773. *
  774. * @category zone of death
  775. * @since 2.3.0
  776. * @deprecated
  777. */
  778. export function getReaderValidation(SE) {
  779. var applicativeReaderValidation = getApplicativeReaderValidation(SE);
  780. var altReaderValidation = getAltReaderValidation(SE);
  781. return {
  782. URI: URI,
  783. _E: undefined,
  784. map: _map,
  785. ap: applicativeReaderValidation.ap,
  786. of: of,
  787. chain: _chain,
  788. bimap: _bimap,
  789. mapLeft: _mapLeft,
  790. alt: altReaderValidation.alt,
  791. throwError: throwError
  792. };
  793. }