Hoogle Search

Within LTS Haskell 24.46 (ghc-9.10.3)

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

  1. useMmap :: ModelOptions -> Maybe Bool

    ollama-haskell Ollama

    Whether to memory-map the model.

  2. catchOrMap :: forall x a (e' :: [Type]) (m :: Type -> Type) b . Monad m => (b -> a) -> (x -> ExceptT (Variant e') m a) -> ExceptT (Variant (x ': e')) m b -> ExceptT (Variant e') m a

    oops Control.Monad.Oops

    Catch the specified exception and return the caught value as Left. If no value was caught, then return the returned value in Right.

  3. data EnumMapper sqlEnum haskellSum

    opaleye Opaleye.Experimental.Enum

    No documentation available.

  4. enumMapper :: String -> (String -> Maybe haskellSum) -> (haskellSum -> String) -> EnumMapper sqlEnum haskellSum

    opaleye Opaleye.Experimental.Enum

    Create a mapping between a Postgres ENUM type and a Haskell type. Also works for DOMAIN types. For example, if you have the following ENUM

    CREATE TYPE public.mpaa_rating AS ENUM (
    'G',
    'PG',
    'PG-13',
    'R',
    'NC-17'
    );
    
    then you can define data types to represent the enum on the SQL side and Haskell side respectively
    data SqlRating
    data Rating = G | PG | PG13 | R | NC17 deriving Show
    
    and functions to map between them
    toSqlRatingString :: Rating -> String
    toSqlRatingString r = case r of
    G    -> "G"
    PG   -> "PG"
    PG13 -> "PG-13"
    R    -> "R"
    NC17 -> "NC-17"
    
    fromSqlRatingString :: String -> Maybe Rating
    fromSqlRatingString s = case s of
    "G"     -> Just G
    "PG"    -> Just PG
    "PG-13" -> Just PG13
    "R"     -> Just R
    "NC-17" -> Just NC17
    _       -> Nothing
    
    Then you can use the mappings as follows
    import qualified Opaleye as O
    import qualified Data.Profunctor.Product.Default as D
    
    sqlRatingMapper :: EnumMapper SqlRating Rating
    sqlRatingMapper = enumMapper "mpaa_rating" fromSqlRatingString toSqlRatingString
    
    instance O.DefaultFromField SqlRating Rating where
    defaultFromField = enumFromField sqlRatingMapper
    
    instance rating ~ Rating
    => D.Default (Inferrable O.FromField) SqlRating rating where
    def = inferrableDef
    
    instance D.Default O.ToFields Rating (O.Field SqlRating) where
    def = enumToFields sqlRatingMapper
    
    instance IsSqlType SqlRating where
    showSqlType = enumShowSqlType sqlRatingMapper
    

  5. enumMapperWithSchema :: String -> String -> (String -> Maybe haskellSum) -> (haskellSum -> String) -> EnumMapper sqlEnum haskellSum

    opaleye Opaleye.Experimental.Enum

    No documentation available.

  6. module Opaleye.Internal.PackMap

    No documentation available.

  7. newtype PackMap a b s t

    opaleye Opaleye.Internal.PackMap

    A PackMap a b s t encodes how an s contains an updatable sequence of a inside it. Each a in the sequence can be updated to a b (and the s changes to a t to reflect this change of type). PackMap is just like a Traversal from the lens package. PackMap has a different order of arguments to Traversal because it typically needs to be made a Profunctor (and indeed ProductProfunctor) in s and t. It is unclear at this point whether we want the same Traversal laws to hold or not. Our use cases may be much more general.

  8. PackMap :: (forall (f :: Type -> Type) . Applicative f => (a -> f b) -> s -> f t) -> PackMap a b s t

    opaleye Opaleye.Internal.PackMap

    No documentation available.

  9. dimapPrimQueryFold :: (q -> p) -> (p' -> q') -> PrimQueryFoldP a p p' -> PrimQueryFoldP a q q'

    opaleye Opaleye.Internal.PrimQuery

    No documentation available.

  10. type family IMap f a

    opaleye Opaleye.Internal.TypeFamilies

    No documentation available.

Page 1198 of many | Previous | Next