package bonsai

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Parser.Query_based_variantSource

This module is like the Variant module, but instead of picking the variant based on the path of the url, it is instead picked based on the value of a query field.

(e.g. ?page=Home or ?page=Settings).

Sourcemodule type S = sig ... end

Given a typed variant, it should return the parser that you want to use for that variant's constructor. For example:

Sourceval make : ?namespace:string list -> (module S with type Typed_variant.derived_on = 'a) -> key:string -> 'a t

Makes a parser for 'a where 'a is a Variant.

For documentation/examples on the ?namespace optional parameter, please read the documentation on Record.make