jaked / deriving Goto Github PK
View Code? Open in Web Editor NEWExtension to OCaml for deriving functions from type declarations.
Home Page: http://code.google.com/p/deriving/
License: MIT License
Extension to OCaml for deriving functions from type declarations.
Home Page: http://code.google.com/p/deriving/
License: MIT License
Typing `make' in this directory should build both the preprocessor (syntax/deriving) and the libraries (lib/deriving.cma, lib/deriving.cmxa). You can run the tests by changing to the test directory and building and running the `tests' executable $ cd tests $ make ... $ ./tests Tests succeeded! There's very limited documentation at present, but you should be able to get started by looking at the test files. Any comments are very welcome. Jeremy Yallop [email protected]
There doesn't seem to be any way to install deriving. No META file and no 'install' target in the Makefile.
Thanks to people @ #ocaml chatroom I was able to find this implementation to make deriving derive show for datatypes containing functions:
method function_ ctxt f = <:module_expr< Defaults (struct
type $Ast.TyDcl (loc, "a", [], atype_expr ctxt (`Function f), [])$
let format formatter _ = Format.pp_print_string formatter "<func>"
end) >>
However I failed at this pmap.ml:
https://github.com/HaxeFoundation/ocamllibs/blob/master/extlib/pMap.ml#L21
The preprocessor failed, and I was not able to come up with a manual instance yet (will try to ask on the chatroom tomorrow again).
I guess this would require adding new Show2 Show3 modules taking show instances for the type parameters k' v' ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.