File: stdcompat__lazy.ml.in

package info (click to toggle)
ocaml-stdcompat 20~git20240529-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,540 kB
  • sloc: ml: 34,099; sh: 861; makefile: 249
file content (20 lines) | stat: -rw-r--r-- 303 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
include Lazy

@BEGIN_BEFORE_4_00_0@
let from_fun = lazy_from_fun

let from_val = lazy_from_val

let is_val = lazy_is_val
@END_BEFORE_4_00_0@

@BEGIN_BEFORE_4_13_0@
let map f v =
  lazy (f (force v))

let map_val f v =
  if is_val v then
    from_val (f (force v))
  else
    map f v
@END_BEFORE_4_13_0@