Copyright | (C) Frank Staals |
---|---|
License | see the LICENSE file |
Maintainer | Frank Staals |
Safe Haskell | None |
Language | GHC2021 |
Convenience classes for types that can be built from foldable collections.
Synopsis
- class HasFromFoldable (f :: Type -> Type) where
- fromFoldable :: Foldable g => g a -> f a
- fromList :: [a] -> f a
- class HasFromFoldable1 (f :: Type -> Type) where
- fromFoldable1 :: Foldable1 g => g a -> f a
- fromNonEmpty :: NonEmpty a -> f a
Documentation
class HasFromFoldable (f :: Type -> Type) where Source #
Types that can be built from foldable collections
fromFoldable :: Foldable g => g a -> f a Source #
Build the data structure from something that is foldable.
fromList :: [a] -> f a Source #
Build the data structure from a list of elements
Instances
HasFromFoldable Seq Source # | |
Defined in HGeometry.Foldable.Util | |
HasFromFoldable Vector Source # | |
Defined in HGeometry.Foldable.Util | |
HasFromFoldable [] Source # | |
Defined in HGeometry.Foldable.Util | |
Monoid c => HasFromFoldable (Const c :: Type -> Type) Source # | |
Defined in HGeometry.Foldable.Util | |
HasFromFoldable v => HasFromFoldable (Cyclic v) Source # | |
Defined in HGeometry.Cyclic |
class HasFromFoldable1 (f :: Type -> Type) where Source #
Types that can be built from non-empty foldable collections
fromFoldable1 :: Foldable1 g => g a -> f a Source #
Build the data structure from something that is foldable and has at least one element.
fromNonEmpty :: NonEmpty a -> f a Source #
Build the data structure from a non-empty list of elements