{"id":13726120,"url":"https://github.com/mjambon/dum","last_synced_at":"2025-04-30T21:10:08.428Z","repository":{"id":24597204,"uuid":"28005624","full_name":"mjambon/dum","owner":"mjambon","description":"Print OCaml values based on their runtime representation","archived":false,"fork":false,"pushed_at":"2022-06-07T13:09:00.000Z","size":23,"stargazers_count":29,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-30T21:10:01.904Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mjambon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-14T19:43:35.000Z","updated_at":"2024-11-04T23:33:16.000Z","dependencies_parsed_at":"2022-08-23T00:51:02.875Z","dependency_job_id":null,"html_url":"https://github.com/mjambon/dum","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjambon%2Fdum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjambon%2Fdum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjambon%2Fdum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjambon%2Fdum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjambon","download_url":"https://codeload.github.com/mjambon/dum/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251782776,"owners_count":21642987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:02:53.166Z","updated_at":"2025-04-30T21:10:08.407Z","avatar_url":"https://github.com/mjambon.png","language":"OCaml","funding_links":[],"categories":["OCaml","Printers helpers"],"sub_categories":[],"readme":"Dum\n===\n\nPurpose\n-------\n\nInspecting arbitrary OCaml values for debugging or just for fun.\n\nCycles are detected and an additional limit on the size of the dump is\nset by default. It is therefore safe to use for printing out\nexceptions in error messages.\n\nClosure fields and object fields are printed.\n\nAll the lazy values (forced or not) can be printed but this is optional.\nSome forced lazy values will always be printed no matter what.\n\n\nInstallation\n------------\n\n```\n$ opam update\n$ opam install dum\n```\n\nUsage\n-----\n\nWe do not recommend the use of this library in production code due to\nits reliance on OCaml internals and unsafe memory access.\n\n```ocaml\n$ utop -require dum\n# Dum.to_stdout (123, \"abc\", Not_found, [`A; `B 'x']);;\n(123 \"abc\" object-7 () [ 65 (66 120) ])\n```\n\nA circular list is printed as follows:\n\n```ocaml\n# let rec cyc = 1 :: 2 :: 3 :: cyc;;\nval cyc : int list = [1; 2; 3; \u003ccycle\u003e]\n\nutop # Dum.to_stdout cyc;;\n#0: (1 (2 (3 #0)))\n```\n\nFirst-class modules can be inspected as well. Here's what I get for the `Sys` module:\n\n```ocaml\n# module type Sys = module type of Sys;;\n# Dum.to_stdout (module Sys : Sys);;\n(\n  (\"/home/martin/.opam/4.05.0/bin/utop\" \"-require\" \"dum\")\n  \"/home/martin/.opam/4.05.0/bin/utop\"\n  closure ()\n  (1)\n  \"Unix\"\n  1\n  1\n  0\n  0\n  64\n  63\n  0\n  144115188075855863\n  18014398509481983\n  #0: closure ()\n  -1\n  -2\n  -3\n  -4\n  -5\n  -6\n  -7\n  -8\n  -9\n  -10\n  -11\n  -12\n  -13\n  -14\n  -15\n  -16\n  -17\n  -18\n  -19\n  -20\n  -21\n  -22\n  -23\n  -24\n  -25\n  -26\n  -27\n  -28\n  #1: object1 ()\n  closure (#0 -6 #1)\n  \"4.05.0\"\n  closure ()\n  closure ()\n)\n```\n\nSee `dum.mli` for more information.\n\nLicense\n-------\n\nGNU LGPL with exception on static linking, see file LICENSE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjambon%2Fdum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjambon%2Fdum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjambon%2Fdum/lists"}