Hoogle Search

Within LTS Haskell 24.62 (ghc-9.10.3)

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

  1. toList :: Foldable t => t a -> [a]

    fmlist Data.FMList

    List of elements of a structure, from left to right. If the entire list is intended to be reduced via a fold, just fold the structure directly bypassing the list.

    Examples

    Basic usage:
    >>> toList Nothing
    []
    
    >>> toList (Just 42)
    [42]
    
    >>> toList (Left "foo")
    []
    
    >>> toList (Node (Leaf 5) 17 (Node Empty 12 (Leaf 8)))
    [5,17,12,8]
    
    For lists, toList is the identity:
    >>> toList [1, 2, 3]
    [1,2,3]
    

  2. module Data.FocusList

    No documentation available.

  3. data FocusList a

    focuslist Data.FocusList

    A list with a given element having the Focus. FocusList has some invariants that must be protected. You should not use the FocusList constructor or the focusListFocus or focusList accessors. Implemented under the hood as a Seq.

  4. FocusList :: Focus -> !Seq a -> FocusList a

    focuslist Data.FocusList

    No documentation available.

  5. focusList :: FocusList a -> !Seq a

    focuslist Data.FocusList

    No documentation available.

  6. focusListFocus :: FocusList a -> !Focus

    focuslist Data.FocusList

    No documentation available.

  7. fromListFL :: Focus -> [a] -> Maybe (FocusList a)

    focuslist Data.FocusList

    Safely create a FocusList from a list.

    >>> fromListFL (Focus 1) ["cat","dog","goat"]
    Just (FocusList (Focus 1) ["cat","dog","goat"])
    
    >>> fromListFL NoFocus []
    Just (FocusList NoFocus [])
    
    If the Focus is out of range for the list, then Nothing will be returned.
    >>> fromListFL (Focus (-1)) ["cat","dog","goat"]
    Nothing
    
    >>> fromListFL (Focus 3) ["cat","dog","goat"]
    Nothing
    
    >>> fromListFL NoFocus ["cat","dog","goat"]
    Nothing
    
    complexity: O(n) where n is the length of the input list.

  8. lensFocusList :: forall a1 a2 f . Functor f => (Seq a1 -> f (Seq a2)) -> FocusList a1 -> f (FocusList a2)

    focuslist Data.FocusList

    No documentation available.

  9. lensFocusListFocus :: forall a f . Functor f => (Focus -> f Focus) -> FocusList a -> f (FocusList a)

    focuslist Data.FocusList

    No documentation available.

  10. unsafeFromListFL :: Focus -> [a] -> FocusList a

    focuslist Data.FocusList

    Unsafely create a FocusList. This does not check that the focus actually exists in the list. This is an internal function and should generally not be used. It is only safe to use if you ALREADY know the Focus is within the list. Instead, you should generally use fromListFL. The following is an example of using unsafeFromListFL correctly.

    >>> unsafeFromListFL (Focus 1) [0..2]
    FocusList (Focus 1) [0,1,2]
    
    >>> unsafeFromListFL NoFocus []
    FocusList NoFocus []
    
    unsafeFromListFL can also be used uncorrectly. The following is an example of unsafeFromListFL allowing you to create a FocusList that does not pass invariantFL.
    >>> unsafeFromListFL (Focus 100) [0..2]
    FocusList (Focus 100) [0,1,2]
    
    If fromListFL returns a Just FocusList, then unsafeFromListFL should return the same FocusList. complexity: O(n) where n is the length of the input list.

Page 196 of many | Previous | Next