This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(*--------------------------------------------------------------------------- | |
Copyright (c) 2025 The bigbytes programmers. All rights reserved. | |
SPDX-License-Identifier: ISC | |
---------------------------------------------------------------------------*) | |
(** Bigarrays of bytes. | |
{b Note.} Getter and setters raise [Invalid_argument] on out of | |
bounds errors. Functions that encode 8-bit or 16-bit integers | |
represented by [int] values truncate their input their least |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(*--------------------------------------------------------------------------- | |
Copyright (c) 2018 Daniel C. Bünzli. All rights reserved. | |
SPDX-License-Identifier: ISC | |
---------------------------------------------------------------------------*) | |
(** Integer types. | |
[Ints] provides types for specifying sized integer types not | |
supported by the {!Stdlib}. It also provides bitwise conversion | |
functions and safe, magnitude preserving, conversions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_b0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_b0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* SPDX-License-Identifier: CC0-1.0 *) | |
let bigbytes_of_file ?(trunc = false) ?length access file = | |
let module Bigarray = Stdlib.Bigarray (* OCaml < 5 install woes *) in | |
let flags, shared = match access with | |
| `R -> Unix.[O_RDONLY], false | |
| `RW -> Unix.(O_CREAT :: O_RDWR :: if trunc then [O_TRUNC] else []), true | |
in | |
let fd = Unix.openfile file flags 0o644 in | |
let finally () = try Unix.close fd with Unix.Unix_error _ -> () in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(*--------------------------------------------------------------------------- | |
Copyright (c) 2022 The brr programmers. All rights reserved. | |
Distributed under the ISC license, see terms at the end of the file. | |
---------------------------------------------------------------------------*) | |
open Brr | |
open Brr_webworkers | |
open Brr_io | |
module type WORK = sig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Simple Buffer.add_json function. *) | |
type json = | |
[ `Null | `Bool of bool | `Float of float | `String of string | |
| `Array of json list | `Object of (string * json) list ] | |
let rec buffer_add_json b = function | |
| `Null -> Buffer.add_string b "null" | |
| `Bool bool -> Buffer.add_string b (if bool then "true" else "false") | |
| `Float f -> Buffer.add_string b (Printf.sprintf "%.16g" f) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* OCaml Port of fig. 5-6 of https://trojansource.codes/trojan-source.pdf *) | |
let access_level = "user" | |
let main () = | |
if access_level <> "user (* Check if admin *)" then | |
Printf.printf "You are an admin.\n" | |
let () = main () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(*--------------------------------------------------------------------------- | |
Copyright (c) 2015 The uunf programmers. All rights reserved. | |
Distributed under the ISC license, see terms at the end of the file. | |
---------------------------------------------------------------------------*) | |
(* WARNING do not edit. This file was automatically generated. *) | |
open Uunf_tmapbool;; | |
let v000 = snil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> opam switch create 4.06.0 --debug-level=3 | |
00:00.003 GSTATE LOAD-GLOBAL-STATE @ /Users/dbuenzli/.opam | |
00:00.004 SYSTEM LOCK /Users/dbuenzli/.opam/lock (none => read) | |
00:00.004 SYSTEM LOCK /Users/dbuenzli/.opam/config.lock (none => write) | |
00:00.004 FILE(config) Read ~/.opam/config in 0.000s | |
00:00.005 RSTATE LOAD-REPOSITORY-STATE @ /Users/dbuenzli/.opam | |
00:00.008 FILE(repos-config) Read ~/.opam/repo/repos-config in 0.003s | |
00:00.008 SYSTEM LOCK /Users/dbuenzli/.opam/repo/state.cache (none => read) | |
00:00.108 RSTATE Loaded /Users/dbuenzli/.opam/repo/state.cache in 0.099s | |
00:00.264 SYSTEM LOCK /Users/dbuenzli/.opam/repo/state.cache (read => none) |
NewerOlder