Hoogle Search

Within LTS Haskell 24.6 (ghc-9.10.2)

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

  1. vectorFromList :: (PrimMonad m, Storable a) => [a] -> m (Array m (ZeroBased Int) a)

    comfort-array Data.Array.Comfort.Storable.Mutable.Private

    No documentation available.

  2. vectorFromList :: (PrimMonad m, Storable a) => [a] -> m (Array m (ZeroBased Int) a)

    comfort-array Data.Array.Comfort.Storable.Mutable.Unchecked

    No documentation available.

  3. vectorFromList :: Storable a => [a] -> Array (ZeroBased Int) a

    comfort-array Data.Array.Comfort.Storable.Private

    No documentation available.

  4. vectorFromList :: Storable a => [a] -> Array (ZeroBased Int) a

    comfort-array Data.Array.Comfort.Storable.Unchecked

    No documentation available.

  5. sFromList :: forall a (t :: [a]) . Sing t -> Sing (Apply (FromListSym0 :: TyFun [a] (NonEmpty a) -> Type) t)

    singletons-base Data.List.NonEmpty.Singletons

    No documentation available.

  6. optionsFromList' :: (MonadHandler m, RenderMessage (HandlerSite m) msg, PathPiece a) => [a] -> (a -> msg) -> m (OptionList a)

    yesod-form Yesod.Form.Option

    Creates an OptionList from a List, using the PathPiece instance for the external value and a custom function for the user-facing value. PathPiece instances should provide suitable external values, since path pieces serve to be exposed through URLs or HTML anyway. Show/Read instances are avoided here since they could leak internal representations to forms, query params, javascript etc.

    Example usage

    data UserRole = URSalesTeam | URSalesHead | URTechTeam | URTechHead
    
    instance PathPiece UserDepartment where
    toPathPiece = \case
    URSalesTeam -> "sales-team"
    URSalesHead -> "sales-head"
    URTechTeam -> "tech-team"
    URTechHead -> "tech-head"
    fromPathPiece = \case
    "sales-team" -> Just URSalesTeam
    "sales-head" -> Just URSalesHead
    "tech-team" -> Just URTechTeam
    "tech-head" -> Just URTechHead
    _ -> Nothing
    
    userRoleOptions ::
    (MonadHandler m, RenderMessage (HandlerSite m) msg) => m (OptionList UserRole)
    userRoleOptions = optionsFromList' userRoles toMsg
    where
    userRoles = [URSalesTeam, URSalesHead, URTechTeam, URTechHead]
    toMsg :: UserRole -> Text
    toMsg = \case
    URSalesTeam -> "Sales Team"
    URSalesHead -> "Head of Sales Team"
    URTechTeam -> "Tech Team"
    URTechHead -> "Head of Tech Team"
    
    userRoleOptions, will produce an OptionList with the following attributes:
    +----------------+----------------+--------------------+
    | Internal Value | External Value | User-facing Value  |
    +----------------+----------------+--------------------+
    | URSalesTeam    | sales-team     | Sales Team         |
    +----------------+----------------+--------------------+
    | URSalesHead    | sales-head     | Head of Sales Team |
    +----------------+----------------+--------------------+
    | URTechTeam     | tech-team      | Tech Team          |
    +----------------+----------------+--------------------+
    | URTechHead     | tech-head      | Head of Tech Team  |
    +----------------+----------------+--------------------+
    
    Note that the type constraint allows localizable messages in place of toMsg (see https://en.wikipedia.org/wiki/Yesod_(web_framework)#Localizable_messages).

  7. extensionsFromList :: [Extension] -> Extensions

    pandoc Text.Pandoc.Extensions

    No documentation available.

  8. vFromListN :: PrimType ty => CountOf ty -> [ty] -> UArray ty

    basement Basement.UArray

    Make an array from a list of elements with a size hint. The list should be of the same size as the hint, as otherwise:

    • The length of the list is smaller than the hint: the array allocated is of the size of the hint, but is sliced to only represent the valid bits
    • The length of the list is bigger than the hint: The allocated array is the size of the hint, and the list is truncated to fit.

  9. unsafeFromListN :: Sz1 -> [e] -> Vector DS e

    massiv Data.Massiv.Array.Unsafe

    O(n) - Convert a list of a known length to a delayed stream vector. Unsafe - This function is unsafe because it will allocate enough space in memory for n elements ahead of time, regardless of the actual size of the list. Supplying n that is too big will result in an asynchronous HeapOverflow exception.

  10. sfromList :: [e] -> Vector DS e

    massiv Data.Massiv.Vector

    Convert a list to a delayed stream vector Related: fromList, fromListN, sfromListN

    Examples

    >>> sfromList ([] :: [Int])
    Array DS Seq (Sz1 0)
    [  ]
    
    >>> sfromList ([1,2,3] :: [Int])
    Array DS Seq (Sz1 3)
    [ 1, 2, 3 ]
    

Page 66 of many | Previous | Next