KO
|
EN
gitlite โ search
Search
#javascript
#python
#hacktoberfest
#react
#ai
#typescript
#llm
#go
#golang
#android
#machine-learning
#rust
#deep-learning
#linux
mirage-tc
โ 12
Open GitHub โ
Type-classes for mirage applications
Download README (.md)
Explore Similar Repositories
lol-replay-downloader-cli
:
League of Legend replay CLI downloader (and decoder) without any software. Replays are saved into the cloud.
memory-chimp
:
๐ต How good is your working memory?
VLC-Demo
:
ไธไธช่ฐ็จVLC็่งฃ็ ๅบๆญๆพ RTSPๆตๅๆฌๅฐ็ๅฐDemo็จๅบ๏ผๅ ผ่ๅไบsocketๅฎขๆท็ซฏ็็นๅปไบไปถๆถ้ๅนถๅ็ปๆๅก็ซฏ
AFreeChart
:
AFreeChart is a free charting library for Android based on JFreeChart 1.0.13. Forked from
odoo-tools
:
Some tools for Odoo
// repository documentation
Was this content helpful?
โ 0
(0 ratings)
Select Rating:
โ
โ
โ
โ
โ
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
mirage-tc
?
Download (.md)
## Mirage type-classes A set of functors and combinators to convert to and from and JSON values and Cstruct buffers. ```ocaml # require "tc";; # Tc.show Tc.string "Hello world!";; - : string = "[\"Hello world!\"]" # Tc.to_json (Tc.pair Tc.int Tc.string) (3, "foo");; - : Ezjsonm.value = `A [`Float 3.; `String "foo"] ``` A slightly more complex example, using autogen code instead of functor composition: ```ocaml # require "tc";; # type t = { foo: int; bar: string list };; # let t = let module M = Tc.Pair (Tc.Int) (Tc.List(Tc.String)) in let to_t (foo, bar) = { foo; bar} and of_t {foo; bar} = (foo, bar) in Tc.biject (module M) to_t of_t;; # Tc.show t { foo = 3; bar = [ "hello"; "world" ] } - : string = "[3,[\"hello\",\"world\"]]" # let j = Tc.to_json t { foo = 3; bar = [ "hello"; "world" ] } - : Ezjsonm.value = `A [`Float 3.; `A [`String "hello"; `String "world"]] # Tc.write_string Tc.string "hello world";; - : string = "\011hello world" ```