Skip to content
Cinch
← Data.NonEmpty API referenceSAMPLE LISTING
cinch-collections / 0.2.1Data/NonEmpty.cinch

Declaration source.

This sample listing contains the declarations shown in the API reference. Package implementations will appear here when real package data is connected.

module Data.NonEmpty where
3-- One head element followed by a possibly empty tail.
4data NonEmpty a
5-- NonEmpty :: a -> List a -> NonEmpty a
6
7-- Read the first element. No empty case is possible.
8head :: forall a. NonEmpty a -> a
9
10-- Forget the nonempty guarantee and retain the values.
11to-list :: forall a. NonEmpty a -> List a