package async_kernel
Monadic concurrency library
Install
Dune Dependency
Authors
Maintainers
Sources
v0.17.0.tar.gz
sha256=01ced973dbc70535f692f38bed524ae82dba17e26e58791b2fbf0d647b160d2e
doc/src/async_kernel.eager_deferred/eager_deferred_result.ml.html
Source file eager_deferred_result.ml
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
open! Core open! Async_kernel open! Import module Deferred = Eager_deferred0 open Deferred.Let_syntax (* Copied from [deferred_result.ml]. There should be no diffs below this line. *) module T = struct type ('a, 'error) t = ('a, 'error) Result.t Deferred.t end include T let combine t1 t2 ~ok ~err = let%map t1 = t1 and t2 = t2 in Result.combine t1 t2 ~ok ~err ;; include Monad.Make2 (struct include T let return a = Deferred.return (Ok a) let bind t ~f = Deferred.bind t ~f:(function | Ok a -> f a | Error _ as error -> Deferred.return error) ;; let map t ~f = Deferred.map t ~f:(fun r -> Result.map r ~f) let map = `Custom map end) let fail x = Deferred.return (Error x) let failf format = Printf.ksprintf fail format let map_error t ~f = Deferred.map t ~f:(fun r -> Result.map_error r ~f)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>