typer(1)

πŸ’– typer(1) β€” Erlang Module Definition πŸ’–

okay bestie, pull up a chair, we're doing the TypEr page and it's literally iconic. this is the manual for typer(1), from the Erlang fam. πŸ¦‹


✨ NAME ✨

typer β€” Type annotator for Erlang programs πŸ’…


🌸 DESCRIPTION 🌸

TypEr shows type information for Erlang modules. and like, not just shows it β€” it can also annotate the code of files with that type information. glow-up for your source files, no cap. ✨

πŸŽ€ Using TypEr πŸŽ€

okay so here's the vibe: TypEr is used from the command-line. this section is the quick little rundown of the options, and β€” fun fact β€” you can get this exact same info by typing this into a shell:

typer --help

Usage:

typer [--help] [--version] [--plt PLT] [--edoc]
      [--show | --show-exported | --annotate | --annotate-inc-files | --annotate-in-place]
      [-Ddefine]* [-I include_dir]* [-pa dir]* [-pz dir]*
      [-T application]* file* [-r directory*]
⚠️ NOTE: the * means that multiple occurrences of that option are possible. so stack 'em up bestie, it's giving collector energy. πŸŽ€

Options:

  • -r β€” search directories recursively for .erl files below them. lowkey important detail: if you're also giving a list of files, this option has to come after them. order matters, queen. πŸ‘‘
  • --show β€” print type specifications for all functions on stdout. (this is actually the default behaviour, so this option is not really needed β€” it's just there being extra 😌)
  • --show-exported (or show_exported) β€” same as --show, but it only prints specs for the exported functions. the specs are displayed sorted alphabetically by the function's name. organized and pretty, we love that. 🌸
  • --annotate β€” annotate the specified files with type specifications. ✨
  • --annotate-inc-files β€” same as --annotate, but it annotates all -include() files as well as all .erl files. (use this one with caution β€” it is not well-tested πŸ’€)
  • --annotate-in-place β€” annotate directly in the source code files themselves, instead of dumping the annotated files somewhere else. (also use with caution β€” not well-tested πŸ’€)
  • --edoc β€” print type information as Edoc @spec comments, not as type specs. different outfit, same energy. πŸŽ€
  • --plt β€” use the specified dialyzer PLT file instead of the default one.
  • -T file* β€” the specified file(s) already contain type specifications, and those are to be trusted in order to print specs for the rest of the files. (you can specify multiple files or directories, separated by spaces.)
  • -Dname (or -Dname=value) β€” pass the defined name(s) to TypEr. (**)
  • -I β€” pass the include_dir to TypEr. (**)
  • -pa dir β€” include dir in the path for Erlang. this is useful when you're analyzing files that use -include_lib() directives or parse transforms. 🧚
  • -pz dir β€” include dir in the path for Erlang. this is useful when you're analyzing files that use -include_lib() directives or parse transforms. 🧚
  • --version (or -v) β€” print the TypEr version plus some more information, then exit. bye bestie πŸ‘‹
⚠️ NOTE: the ** options -D and -I work the same way as in erlc. πŸ’–

and that's the whole page, you ate it πŸ“βœ¨

this little baddie is brought to you by Ericsson AB and ships as part of dialyzer 6.0.2 β€” so when you're out here annotating Erlang like a main character, you know exactly whose name is on it. πŸ’œπŸ‘‘

πŸ“¦ where this page comes from