License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
compat friendly version of IsList
Documentation
The IsList
class and its methods are intended to be used in
conjunction with the OverloadedLists extension.
Since: base-4.7.0.0
The fromList
function constructs the structure l
from the given
list of Item l
fromListN :: Int -> [Item l] -> l #
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
The toList
function extracts a list of Item l
from the structure l
.
It should satisfy fromList . toList = id.
Instances
IsList Version | Since: base-4.8.0.0 |
IsList CallStack | Be aware that 'fromList . toList = id' only for unfrozen Since: base-4.9.0.0 |
IsList AsciiString Source # | |
Defined in Basement.Types.AsciiString type Item AsciiString # fromList :: [Item AsciiString] -> AsciiString # fromListN :: Int -> [Item AsciiString] -> AsciiString # toList :: AsciiString -> [Item AsciiString] # | |
IsList String Source # | |
IsList (ZipList a) | Since: base-4.15.0.0 |
PrimType ty => IsList (Block ty) Source # | |
IsList (Array ty) Source # | |
IsList c => IsList (NonEmpty c) Source # | |
PrimType ty => IsList (UArray ty) Source # | |
IsList (NonEmpty a) | Since: base-4.9.0.0 |
IsList [a] | Since: base-4.7.0.0 |