package server-reason-react

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

Module Melange_native_ppx.Derive_utilSource

Shared utilities for record type derivers (jsProperties, getSet).

These helpers handle common operations like checking for optional attributes and extracting type information from type declarations.

module Builder = Ppxlib.Ast_builder.Default
Sourceval has_mel_optional : Ppxlib.attribute list -> bool

Returns true if the attribute list contains [@mel.optional] or [@bs.optional].

Sourceval get_pld_type : Ppxlib.core_type -> attrs:Ppxlib.attribute list -> Ppxlib.core_type

Extracts the inner type from an optional field.

For fields marked with [@mel.optional], this unwraps the option type to get the inner type. For example, int option becomes int.

Raises an error if [@mel.optional] is used on a non-option type.

Sourceval core_type_of_type_declaration : Ppxlib.type_declaration -> Ppxlib__.Import.core_type

Constructs a core type from a type declaration.

Given type 'a t = ..., this returns the core type 'a t that can be used in function signatures. Handles type parameters correctly.