Hoogle Search

Within LTS Haskell 24.36 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. module Data.IndexedListLiterals

    No documentation available.

  2. class IndexedListLiterals input (length :: Nat) output | output length -> input, input -> output length

    indexed-list-literals Data.IndexedListLiterals

    A type class which allows you to write tuples which can be transformed to and from a list the length of the list is also provided as a Nat

  3. fromList :: forall input (length :: Nat) output . (KnownNat length, ILL input length output) => [output] -> Maybe input

    indexed-list-literals Data.IndexedListLiterals

    > fromList [1,2,3] :: Maybe (Int, Int, Int)
    Just (1,2,3)
    
    > fromList ["word","up"] :: Maybe (String, String, String)
    Nothing
    
    > fromList ['z'] :: Maybe (Only Char)
    Just (Only 'z')
    

  4. fromList' :: IndexedListLiterals input length output => [output] -> input

    indexed-list-literals Data.IndexedListLiterals

    a partial fromList with bad error messages

  5. fromListP :: forall input (length :: Nat) output len . (KnownNat length, ILL input length output) => len length -> [output] -> Maybe input

    indexed-list-literals Data.IndexedListLiterals

    the fromList variants take a list and convert it into a tuple it's sort of the inverse of toList

    > fromListP (len @3) [1,2,3]
    Just (1,2,3)
    
    > fromListP (len @3) ["word","up"]
    Nothing
    
    > fromListP (len @1) ['z']
    Just (Only 'z') @
    

  6. toList :: IndexedListLiterals input length output => input -> [output]

    indexed-list-literals Data.IndexedListLiterals

    > toList (Only 1)
    [1]
    
    > toList (1,2,3)
    [1,2,3]
    
    > toList ZeroTuple
    []
    

  7. fromAscList :: [Int] -> IntSet

    intern Data.Interned.IntSet

    O(n). Build a set from an ascending list of elements. The precondition (input list is ascending) is not checked.

  8. fromDistinctAscList :: [Int] -> IntSet

    intern Data.Interned.IntSet

    O(n). Build a set from an ascending list of distinct elements. The precondition (input list is strictly ascending) is not checked.

  9. fromList :: [Int] -> IntSet

    intern Data.Interned.IntSet

    O(n*min(n,W)). Create a set from a list of integers.

  10. toAscList :: IntSet -> [Int]

    intern Data.Interned.IntSet

    O(n). Convert the set to an ascending list of elements.

Page 165 of many | Previous | Next