View Source Interval.Endpoint (Interval v0.1.1)

An endpoint in an Interval.

An Endpoint represents the left- or right-most point of an interval.

Link to this section Summary

Functions

Create a new exclusive Endpoint.

Create a new inclusive Endpoint.

Create a new Endpoint

Link to this section Types

@type t() :: %Interval.Endpoint{inclusive: term(), point: term()}

Link to this section Functions

Create a new exclusive Endpoint.

Create a new inclusive Endpoint.

Create a new Endpoint

examples

Examples

iex> new(1, :inclusive)
%Endpoint{point: 1, inclusive: true}

iex> new(:an_atom, :inclusive)
** (RuntimeError) No Interval.Point protocol implementation for :an_atom