# OCaml Routes Library DSL ## The `@-->` Operator The `@-->` operator is from the `routes` library and is used to bind route patterns to handler functions. ### Example: ```ocaml `GET, (s "posts" /? nil) @--> Handler.get_posts ``` ### Breaking it down: - `s "posts"` - matches the string "posts" in the URL path - `/?` - path concatenation operator - `nil` - end of path (no more segments) - `@-->` - "maps to" operator that binds the route to the handler So `(s "posts" /? nil) @--> Handler.get_posts` means "the route `/posts` maps to the `Handler.get_posts` function". ### Other common operators in the routes library: - `/:` for path parameters (e.g., `s "user" /: int /? nil` matches `/user/123`) - `//` for wildcard paths - `<$>` for transforming matched values It's a DSL (domain-specific language) for expressing routes in a concise, type-safe way.