Mikan
Safe HaskellNone
LanguageHaskell2010

Mikan.Utils.Set1

Contents

Description

Non-empty sets.

This module is meant to be imported qualified as:

import Mikan.Utils.Set1 (Set1)
import Mikan.Utils.Set1 qualified as Set1
Synopsis

Documentation

ifNull :: Set a -> b -> (Set1 a -> b) -> b Source #

Conditionally apply a function if a set is non-empty.

toSet' :: Maybe (Set1 a) -> Set a Source #

Lossless toSet. Opposite of nonEmptySet.

unlessNull :: Applicative m => Set a -> (Set1 a -> m ()) -> m () Source #

A more general type would be Null m => Set a -> (Set1 a -> m) -> m but this type is problematic as we do not have a general instance Applicative m => Null (m ()).

unlessNullM :: Monad m => m (Set a) -> (Set1 a -> m ()) -> m () Source #

Monadic variant of unlessNull.

Re-exports