Module proper_typeserver

Erlang type system - PropEr type system integration module.

Copyright © 2010-2016 Manolis Papadakis, Eirini Arvaniti and Kostis Sagonas

Version: Jun 20 2016 16:27:13

Behaviours: gen_server.

Authors: Manolis Papadakis.

Description

Erlang type system - PropEr type system integration module.

PropEr can parse types expressed in Erlang's type language and convert them to its own type format. Such expressions can be used instead of regular type constructors in the second argument of ?FORALLs. No extra notation is required; PropEr will detect which calls correspond to native types by applying a parse transform during compilation. This parse transform is automatically applied to any module that includes the proper.hrl header file. You can disable this feature by compiling your modules with -DPROPER_NO_TRANS. Note that this will currently also disable the automatic exporting of properties.

The use of native types in properties is subject to the following usage rules:

You can use these functions to try out the type translation subsystem.

CAUTION: These functions should never be used inside properties. They are meant for demonstration purposes only.

Data Types

fin_type()

fin_type() = proper_types:type()

mod_name()

mod_name() = atom()

rich_result()

rich_result(T) = {ok, T} | {error, term()}

Function Index

demo_is_instance/3Checks if Term is a valid instance of native type TypeExpr (which should be provided inside a string).
demo_translate_type/2Translates the native type expression TypeExpr (which should be provided inside a string) into a PropEr type, which can then be passed to any of the demo functions defined in the proper_gen module.

Function Details

demo_is_instance/3

demo_is_instance(Term :: term(),
                 Mod :: mod_name(),
                 TypeExpr :: string()) ->
                    boolean() | {error, term()}

Checks if Term is a valid instance of native type TypeExpr (which should be provided inside a string). PropEr acts as if it found this type expression inside the code of module Mod.

demo_translate_type/2

demo_translate_type(Mod :: mod_name(), TypeExpr :: string()) ->
                       rich_result(fin_type())

Translates the native type expression TypeExpr (which should be provided inside a string) into a PropEr type, which can then be passed to any of the demo functions defined in the proper_gen module. PropEr acts as if it found this type expression inside the code of module Mod.


Generated by EDoc, Jun 20 2016, 16:27:13.