Hoogle Search

Within LTS Haskell 24.5 (ghc-9.10.2)

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

  1. maybeToFailure :: a -> Maybe e -> Validation e a

    validation-selective Validation

    Maps Just to Failure In case of Nothing it wraps the given default value into Success.

    >>> maybeToFailure True (Just "aba")
    Failure "aba"
    
    >>> maybeToFailure True Nothing
    Success True
    

  2. maybeToSuccess :: e -> Maybe a -> Validation e a

    validation-selective Validation

    Maps Just to Success. In case of Nothing it wraps the given default value into Failure

    >>> maybeToSuccess True (Just "aba")
    Success "aba"
    
    >>> maybeToSuccess True Nothing
    Failure True
    

  3. maybeToFailure :: a -> Maybe e -> Validation e a

    validation-selective Validation.Combinators

    Maps Just to Failure In case of Nothing it wraps the given default value into Success.

    >>> maybeToFailure True (Just "aba")
    Failure "aba"
    
    >>> maybeToFailure True Nothing
    Success True
    

  4. maybeToSuccess :: e -> Maybe a -> Validation e a

    validation-selective Validation.Combinators

    Maps Just to Success. In case of Nothing it wraps the given default value into Failure

    >>> maybeToSuccess True (Just "aba")
    Success "aba"
    
    >>> maybeToSuccess True Nothing
    Failure True
    

  5. maybeRep :: forall (m :: Type -> Type) a . Monad m => Maybe ByteString -> Bool -> SharedRep m a -> SharedRep m (Maybe a)

    web-rep Web.Rep.SharedReps

    Represent a Maybe using a checkbox. Hides the underlying content on Nothing

  6. maybePartExpr :: IsExprBuilder sym => sym -> Maybe a -> PartExpr (Pred sym) a

    what4 What4.Partial

    Create a part expression from a maybe value.

  7. maybeTryFrom :: (source -> Maybe target) -> source -> Either (TryFromException source target) target

    witch Witch

    This function can be used to implement tryFrom with a function that returns Maybe. For example:

    -- Avoid this:
    tryFrom s = case f s of
    Nothing -> Left $ TryFromException s Nothing
    Just t -> Right t
    
    -- Prefer this:
    tryFrom = maybeTryFrom f
    

  8. maybeTryFrom :: (source -> Maybe target) -> source -> Either (TryFromException source target) target

    witch Witch.Utility

    This function can be used to implement tryFrom with a function that returns Maybe. For example:

    -- Avoid this:
    tryFrom s = case f s of
    Nothing -> Left $ TryFromException s Nothing
    Just t -> Right t
    
    -- Prefer this:
    tryFrom = maybeTryFrom f
    

  9. maybeAuth :: (YesodAuthPersist master, val ~ AuthEntity master, Key val ~ AuthId master, PersistEntity val, Typeable val, MonadHandler m, HandlerSite m ~ master) => m (Maybe (Entity val))

    yesod-auth Yesod.Auth

    Similar to maybeAuthId, but additionally look up the value associated with the user's database identifier to get the value in the database. This assumes that you are using a Persistent database.

  10. maybeAuthId :: (YesodAuth master, MonadHandler m, master ~ HandlerSite m) => m (Maybe (AuthId master))

    yesod-auth Yesod.Auth

    Retrieves user credentials, if user is authenticated. By default, this calls defaultMaybeAuthId to get the user ID from the session. This can be overridden to allow authentication via other means, such as checking for a special token in a request header. This is especially useful for creating an API to be accessed via some means other than a browser.

Page 45 of many | Previous | Next