-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Create NonEmpty version of any container -- -- Create NonEmpty version of any container. @package nonempty-wrapper @version 0.1.0.0 -- | Create NonEmpty version of any container. module Data.NonEmpty -- | NonEmpty proofed value. data NonEmpty a -- | Extract the NonEmpty proven value ($sel:getNonEmpty:NonEmpty) :: NonEmpty a -> a -- | Trusted value trustedNonEmpty :: a -> NonEmpty a -- | Singleton constructible value class NonEmptySingleton a where { type family NonEmptySingletonElement a :: Type; } nonEmptySingleton :: NonEmptySingleton a => Proxy a -> NonEmptySingletonElement a -> a -- | Build a NonEmpty value from a singleton value singleton :: NonEmptySingleton a => Proxy a -> NonEmptySingletonElement a -> NonEmpty a -- | Build NonEmptySingleton for Applicative defined types to -- be used with DerivingVia: -- --
--   deriving instance NonEmptySingleton [a] via (MkNonEmptySingletonApplicative [a])
--   
newtype MkNonEmptySingletonApplicative a MkNonEmptySingletonApplicative :: a -> MkNonEmptySingletonApplicative a -- | Used to attempt conversion from possibly empty to NonEmpty. class NonEmptyFromContainer a isNonEmpty :: NonEmptyFromContainer a => a -> Bool -- | Attempt NonEmpty proof nonEmpty :: NonEmptyFromContainer a => a -> Maybe (NonEmpty a) -- | Build MkNonEmptyFromContainerFoldable for Foldable -- defined types to be used with DerivingVia: -- --
--   deriving instance NonEmptyFromContainer [a] via (MkNonEmptyFromContainerFoldable [a])
--   
newtype MkNonEmptyFromContainerFoldable a MkNonEmptyFromContainerFoldable :: a -> MkNonEmptyFromContainerFoldable a -- | Append empty container (<|) :: Semigroup a => NonEmpty a -> a -> NonEmpty a infixr 6 <| -- | Prepend empty container (|>) :: Semigroup a => a -> NonEmpty a -> NonEmpty a infixr 6 |> -- | Wrap and unwrap NonEmpty (unsafe, be sure f is -- size-conservative) overNonEmpty :: (a -> b) -> NonEmpty a -> NonEmpty b -- | Wrap and unwrap NonEmpty (unsafe, be sure f is -- size-conservative) overNonEmpty2 :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c -- | Wrap and unwrap NonEmpty (unsafe, be sure f is -- size-conservative) overNonEmpty3 :: (a -> b -> c -> d) -> NonEmpty a -> NonEmpty b -> NonEmpty c -> NonEmpty d -- | Wrap and unwrap NonEmpty (unsafe, be sure f is -- size-conservative) overNonEmpty4 :: (a -> b -> c -> d -> e) -> NonEmpty a -> NonEmpty b -> NonEmpty c -> NonEmpty d -> NonEmpty e -- | Wrap and unwrap NonEmpty (unsafe, be sure f is -- size-conservative) overNonEmpty5 :: (a -> b -> c -> d -> e -> f) -> NonEmpty a -> NonEmpty b -> NonEmpty c -> NonEmpty d -> NonEmpty e -> NonEmpty f -- | fmap over a NonEmpty container fmapNonEmpty :: Functor f => (a -> b) -> NonEmpty (f a) -> NonEmpty (f b) -- | Apply an unsafe function over empty, which is safe over -- NonEmpty withNonEmpty :: (a -> Maybe b) -> NonEmpty a -> b instance GHC.Show.Show a => GHC.Show.Show (Data.NonEmpty.NonEmpty a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.NonEmpty.NonEmpty a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.NonEmpty.NonEmpty a) instance Data.Foldable.Foldable f => Data.NonEmpty.NonEmptyFromContainer (f a) instance GHC.Base.Applicative f => Data.NonEmpty.NonEmptySingleton (f a) instance GHC.Base.Semigroup a => GHC.Base.Semigroup (Data.NonEmpty.NonEmpty a)