Module Lwt_list

Contents

Instructions: Use this module in your project

In the IDE (CLion, Visual Studio Code, Xcode, etc.) you use for your DkSDK project:

  1. Add the following to your project's dependencies/CMakeLists.txt:

    Copy
    DkSDKProject_DeclareAvailable(lwt
        CONSTRAINT "= 5.6.1"
        FINDLIBS lwt lwt.unix)
    DkSDKProject_MakeAvailable(lwt)
  2. Add the Findlib::lwt library to any desired targets in src/*/CMakeLists.txt:

    Copy
    target_link_libraries(YourPackage_YourLibraryName
         # ... existing libraries, if any ...
         Findlib::lwt)
  3. Click your IDE's Build button

Not using DkSDK?

FIRST, do one or all of the following:

  1. Run:

    Copy
    opam install lwt.5.6.1
  2. Edit your dune-project and add:

    Copy
    (package
      (name YourExistingPackage)
      (depends
      ; ... existing dependenices ...
      (lwt (>= 5.6.1))))

    Then run:

    Copy
    dune build *.opam # if this fails, run: dune build
  3. Edit your <package>.opam file and add:

    Copy
    depends: [
      # ... existing dependencies ...
      "lwt" {>= "5.6.1"}
    ]

    Then run:

    Copy
    opam install . --deps-only

FINALLY, add the lwt library to any desired (library)and/or (executable) targets in your **/dune files:

Copy
(library
  (name YourLibrary)
  ; ... existing library options ...
  (libraries
    ; ... existing libraries ...
    lwt))

(executable
  (name YourExecutable)
  ; ... existing executable options ...
  (libraries
    ; ... existing libraries ...
    lwt))

Note: this module use the same naming convention as Lwt_stream.

List iterators

val iter_s : ``('a ->``unitLwt.t)`` -> 'alist``->``unitLwt.t
val iter_p : ``('a ->``unitLwt.t)`` -> 'alist``->``unitLwt.t
valiteri_s : ``(``int-> 'a ->``unitLwt.t)`` -> 'alist``->``unitLwt.t
valiteri_p : ``(``int-> 'a ->``unitLwt.t)`` -> 'alist``->``unitLwt.t
val map_s : ``('a -> 'b Lwt.t)`` -> 'alist``-> 'blist``Lwt.t
val map_p : ``('a -> 'b Lwt.t)`` -> 'alist``-> 'blist``Lwt.t
valmapi_s : ``(``int-> 'a -> 'b Lwt.t)`` -> 'alist``-> 'blist``Lwt.t
valmapi_p : ``(``int-> 'a -> 'b Lwt.t)`` -> 'alist``-> 'blist``Lwt.t
val rev_map_s : ``('a -> 'b Lwt.t)`` -> 'alist``-> 'blist``Lwt.t
val rev_map_p : ``('a -> 'b Lwt.t)`` -> 'alist``-> 'blist``Lwt.t
val fold_left_s : ``('a -> 'b -> 'a Lwt.t)`` -> 'a -> 'blist``-> 'a Lwt.t
val fold_right_s : ``('a -> 'b -> 'b Lwt.t)`` -> 'alist``-> 'b -> 'b Lwt.t

List scanning

val for_all_s : ``('a ->``boolLwt.t)`` -> 'alist``->``boolLwt.t
val for_all_p : ``('a ->``boolLwt.t)`` -> 'alist``->``boolLwt.t
val exists_s : ``('a ->``boolLwt.t)`` -> 'alist``->``boolLwt.t
val exists_p : ``('a ->``boolLwt.t)`` -> 'alist``->``boolLwt.t

List searching

val find_s : ``('a ->``boolLwt.t)`` -> 'alist``-> 'a Lwt.t
val filter_s : ``('a ->``boolLwt.t)`` -> 'alist``-> 'alist``Lwt.t
val filter_p : ``('a ->``boolLwt.t)`` -> 'alist``-> 'alist``Lwt.t
val filter_map_s : ``('a -> 'boption``Lwt.t)`` -> 'alist``-> 'blist``Lwt.t
val filter_map_p : ``('a -> 'boption``Lwt.t)`` -> 'alist``-> 'blist``Lwt.t
val partition_s : ``('a ->``boolLwt.t)`` -> 'alist``-> ``('alist`` *'alist``)``Lwt.t
val partition_p : ``('a ->``boolLwt.t)`` -> 'alist``-> ``('alist`` *'alist``)``Lwt.t