Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Lists of length at least 2.
Import as:
import Agda.Utils.List2 (List2(List2))
import qualified Agda.Utils.List2 as List2
Synopsis
- data List2 a = List2 a a [a]
- head :: List2 a -> a
- tail :: List2 a -> List1 a
- init :: List2 a -> List1 a
- break :: (a -> Bool) -> List2 a -> ([a], [a])
- cons :: a -> List1 a -> List2 a
- append :: List1 a -> List1 a -> List2 a
- appendList :: List2 a -> [a] -> List2 a
- fromList1 :: List1 a -> List2 a
- toList1 :: List2 a -> List1 a
- fromListMaybe :: [a] -> Maybe (List2 a)
- fromList1Maybe :: List1 a -> Maybe (List2 a)
- fromList1Either :: List1 a -> Either a (List2 a)
- toList1Either :: Either a (List2 a) -> List1 a
- toList :: IsList l => l -> [Item l]
Documentation
Lists of length ≥2.
List2 a a [a] |
Instances
appendList :: List2 a -> [a] -> List2 a Source #
O(length first list).
fromListMaybe :: [a] -> Maybe (List2 a) Source #
Safe. O(1).
toList1Either :: Either a (List2 a) -> List1 a Source #
Inverse of fromList1Either
. O(1).