| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
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
- type Set1 = NESet
- ifNull :: Set a -> b -> (Set1 a -> b) -> b
- toSet' :: Maybe (Set1 a) -> Set a
- unlessNull :: Applicative m => Set a -> (Set1 a -> m ()) -> m ()
- unlessNullM :: Monad m => m (Set a) -> (Set1 a -> m ()) -> m ()
- module Data.Set.NonEmpty
Documentation
ifNull :: Set a -> b -> (Set1 a -> b) -> b Source #
Conditionally apply a function if a set is non-empty.
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
module Data.Set.NonEmpty