Reason · Reason lets you write simple, fast and quality type safe code while leveraging both the JavaScript & OCaml ecosystems.

Reason
sig
 type _ t = ..
 exception Unhandled : 'a Effect.t -> exn
 exception Continuation_already_resumed
 external perform : 'a Effect.t -> 'a = "%perform"
 module Deep :
  sig
   type ('a, 'b) continuation
   val continue : ('a, 'b) Effect.Deep.continuation -> 'a -> 'b
   val discontinue : ('a, 'b) Effect.Deep.continuation -> exn -> 'b
   val discontinue_with_backtrace :
    ('a, 'b) Effect.Deep.continuation ->
    exn -> Stdlib.Printexc.raw_backtrace -> 'b
   type ('a, 'b) handler = {
    retc : 'a -> 'b;
    exnc : exn -> 'b;
    effc :
     'c. 'c Effect.t -> (('c, 'b) Effect.Deep.continuation -> 'b) option;
   }
   val match_with : ('c -> 'a) -> 'c -> ('a, 'b) Effect.Deep.handler -> 'b
   type 'a effect_handler = {
    effc :
     'b. 'b Effect.t -> (('b, 'a) Effect.Deep.continuation -> 'a) option;
   }
   val try_with : ('b -> 'a) -> 'b -> 'a Effect.Deep.effect_handler -> 'a
   external get_callstack :
    ('a, 'b) Effect.Deep.continuation ->
    int -> Stdlib.Printexc.raw_backtrace
    = "caml_get_continuation_callstack"
  end
 module Shallow :
  sig
   type ('a, 'b) continuation
   val fiber : ('a -> 'b) -> ('a, 'b) Effect.Shallow.continuation
   type ('a, 'b) handler = {
    retc : 'a -> 'b;
    exnc : exn -> 'b;
    effc :
     'c.
      'c Effect.t ->
      (('c, 'a) Effect.Shallow.continuation -> 'b) option;
   }
   val continue_with :
    ('c, 'a) Effect.Shallow.continuation ->
    'c -> ('a, 'b) Effect.Shallow.handler -> 'b
   val discontinue_with :
    ('c, 'a) Effect.Shallow.continuation ->
    exn -> ('a, 'b) Effect.Shallow.handler -> 'b
   val discontinue_with_backtrace :
    ('a, 'b) Effect.Shallow.continuation ->
    exn ->
    Stdlib.Printexc.raw_backtrace ->
    ('b, 'c) Effect.Shallow.handler -> 'c
   external get_callstack :
    ('a, 'b) Effect.Shallow.continuation ->
    int -> Stdlib.Printexc.raw_backtrace
    = "caml_get_continuation_callstack"
  end
end

AltStyle によって変換されたページ (->オリジナル) /