package libsail
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=0b223ed83f521ad87eaacd88186390fbaf0b944f63c6a04a3ebdf96a1ff5a60c
sha512=83298218175c7a9ff7f0a304021287a2b9c20523cb16e1b8bf0ede81fa8e256a32b309626bc1553a5b46d68e44821524c27a5de0fb2f2d7f013025f61ce76519
doc/libsail/Libsail/Specialize/index.html
Module Libsail.SpecializeSource
Rewrites for removing polymorphism from specifications
Only specialize Type- kinded polymorphism.
(experimental) specialise Int-kinded definitions
(experimental) specialise Int-kinded definitions, including externs
Returns an IdSet with the function ids that have X-kinded parameters, e.g. val f : forall ('a : X). 'a -> 'a. The first argument specifies what X should be - it should be one of: is_int_kopt, is_order_kopt, or is_typ_kopt from Ast_util, or some combination of those.
val specialize :
specialization ->
Type_check.Env.t ->
Type_check.typed_ast ->
Effects.side_effect_info ->
Type_check.typed_ast * Type_check.Env.t * Effects.side_effect_infospecialize returns an AST with all the Order and Type polymorphism removed, as well as the environment produced by type checking that AST with Type_check.initial_env. The env parameter is the environment to return if there is no polymorphism to remove, in which case specialize returns the AST unmodified.
val specialize_passes :
int ->
specialization ->
Type_check.Env.t ->
Type_check.typed_ast ->
Effects.side_effect_info ->
Type_check.typed_ast * Type_check.Env.t * Effects.side_effect_infospecialize' n performs at most n specialization passes. Useful for int_specialization which is not guaranteed to terminate.
val instantiations_of :
specialization ->
Ast.id ->
Type_check.typed_ast ->
Ast.typ_arg Ast_compare.KBindings.t listreturn all instantiations of a function id, with the instantiations filtered according to the specialization.