Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. OCaml
  3. Tyre

Tyre

ISCOCaml0.5

A typed regular expression library for OCaml that enables type-safe parsing and unparsing with automatic group extraction.

Visit WebsiteGitHubGitHub
183 stars5 forks0 contributors

Overview

Typed Regular Expressions

Use Cases

Not Ideal For

  • Projects not using OCaml, as Tyre is specifically designed for the OCaml ecosystem and offers no cross-language support.
  • Applications requiring high-speed regex matching without type safety overhead, such as real-time log processing where raw performance is critical.
  • Teams preferring standard regex syntax over combinator-based DSLs, as Tyre requires learning a new way to define patterns instead of using familiar string-based regex.

Pros & Cons

Pros

Type Safety Guarantees

Ensures regex groups are correctly typed at compile time, preventing runtime errors, as shown in the example where 'dim' parses integers without manual type checks.

Bi-Directional Operations

Allows the same expression to parse strings into data and unparse data back, useful for routing and serialization, demonstrated with Tyre.eval generating strings from tuples.

Automatic Group Extraction

Matched groups are automatically converted to OCaml values, reducing boilerplate code, evident in Tyre.exec returning typed results like (int * int).

Pure OCaml Implementation

Built entirely in OCaml with no external dependencies beyond ocaml-re, ensuring easy integration and consistency within OCaml projects.

Cons

Performance Overhead

Adds type-checking and combinator layers that may slow regex execution compared to raw libraries like ocaml-re, as benchmarks compare it with Angstrom for HTTP parsing.

Combinator Syntax Barrier

Requires learning a domain-specific language of combinators (e.g., '*>' and '<&>') instead of standard regex strings, which can be unfamiliar and increase initial development time.

Limited Ecosystem Support

Niche to OCaml with fewer community resources and tutorials compared to mainstream regex libraries, potentially making debugging and adoption harder for new users.

Frequently Asked Questions

Quick Stats

Stars183
Forks5
Contributors0
Open Issues4
Last commit7 months ago
CreatedSince 2016

Tags

#parsing#functional-programming#regex#type-safety#combinators#serialization#types#code-generation#regular-expressions#ocaml#routing

Built With

O
OCaml

Links & Resources

Website

Included in

OCaml3.1k
Auto-fetched 6 hours ago

Related Projects

ReRe

Pure OCaml regular expressions, with support for Perl and POSIX-style strings

Stars257
Forks69
Last commit7 days ago
ocaml-pcreocaml-pcre

OCaml bindings to PCRE (Perl Compatibility Regular Expressions)

Stars36
Forks12
Last commit4 days ago
Humane-reHumane-re

The human friendly interface to ocaml-re

Stars26
Forks2
Last commit6 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub