| Copyright | (c) The University of Glasgow 2002 |
|---|---|
| License | see libraries/base/LICENSE |
| Maintainer | ghc-devs@haskell.org |
| Stability | internal |
| Portability | non-portable (GHC Extensions) |
| Safe Haskell | Safe |
| Language | Haskell2010 |
GHC.IsList
Description
Since: base-4.17.0.0
Documentation
The IsList class and its methods are intended to be used in
conjunction with the OverloadedLists extension.
Since: base-4.7.0.0
Associated Types
The Item type function returns the type of items of the structure
l.
Methods
fromList :: [Item l] -> l Source #
The fromList function constructs the structure l from the given
list of Item l
fromListN :: Int -> [Item l] -> l Source #
The fromListN function takes the input list's length and potentially
uses it to construct the structure l more efficiently compared to
fromList. If the given number does not equal to the input list's length
the behaviour of fromListN is not specified.
fromListN (length xs) xs == fromList xs
toList :: l -> [Item l] Source #
The toList function extracts a list of Item l from the structure l.
It should satisfy fromList . toList = id.
Instances
| IsList ByteArray Source # | Since: base-4.17.0.0 | ||||
| IsList Version Source # | Since: base-4.8.0.0 | ||||
| IsList CallStack Source # | Be aware that 'fromList . toList = id' only for unfrozen Since: base-4.9.0.0 | ||||
Defined in GHC.Internal.IsList Associated Types
| |||||
| IsList (NonEmpty a) Source # | Since: base-4.9.0.0 | ||||
Defined in GHC.Internal.IsList Associated Types
| |||||
| IsList (ZipList a) Source # | Since: base-4.15.0.0 | ||||
| IsList [a] Source # | Since: base-4.7.0.0 | ||||