Module Dunolint.Nonempty_list

A type to represent lists that are statically known to be non-empty.

The way this constructor is defined allows one to use the regular list literal syntax where a non-empty list is expected, for example present [ a; b ], while present [] is a type error.

This module only contains the type definition. Helpers are found in the stdlib used by dunolint, where the type is re-exported.

type 'a t =
  1. | :: of 'a * 'a list