View Source Drops.Types.Primitive (drops v0.2.1)

Drops.Types.Primitive is a struct that represents a primitive type with optional constraints.

Examples

iex> Drops.Type.Compiler.visit({:type, {:string, []}}, [])
%Drops.Types.Primitive{
  primitive: :string,
  constraints: [predicate: {:type?, :string}]
}

iex> Drops.Type.Compiler.visit({:type, {:string, [:filled?]}}, [])
%Drops.Types.Primitive{
  primitive: :string,
  constraints: {:and, [predicate: {:type?, :string}, predicate: {:filled?, []}]}
}

Summary

Types

@type t() :: %Drops.Types.Primitive{
  constraints: term(),
  opts: term(),
  primitive: term()
}

Functions