Hoogle Search

Within LTS Haskell 24.39 (ghc-9.10.3)

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

  1. isFieldMaybe :: FieldDef -> Bool

    hledger-web Hledger.Web.Import

    Check if the field is `Maybe a`

  2. intCastMaybe :: (Integral a, Integral b, Bits a, Bits b) => a -> Maybe b

    int-cast Data.IntCast

    Run-time-checked integer conversion This is an optimized version of the following generic code below

    intCastMaybeRef :: (Integral a, Integral b) => a -> Maybe b
    intCastMaybeRef x
    | toInteger x == toInteger y = Just y
    | otherwise                  = Nothing
    where
    y = fromIntegral x
    
    The code above is rather inefficient as it needs to go via the Integer type. The function intCastMaybe, however, is marked INLINEABLE and if both integral types are statically known, GHC will be able optimize the code signficantly (for -O1 and better). For instance (as of GHC 7.8.1) the following definitions
    w16_to_i32 = intCastMaybe :: Word16 -> Maybe Int32
    
    i16_to_w16 = intCastMaybe :: Int16 -> Maybe Word16
    
    are translated into the following (simplified) GHC Core language
    w16_to_i32 = \x -> Just (case x of _ { W16# x# -> I32# (word2Int# x#) })
    
    i16_to_w16 = \x -> case eta of _
    { I16# b1 -> case tagToEnum# (<=# 0 b1) of _
    { False -> Nothing
    ; True -> Just (W16# (narrow16Word# (int2Word# b1)))
    }
    }
    
    Note: Starting with base-4.8, this function has been added to Data.Bits under the name toIntegralSized.

  3. mapMaybeI :: Monoidal f => (a -> f (Maybe b)) -> [a] -> f [b]

    invertible Control.Invertible.Monoidal

    Map each element to a Maybe monoidal and sequence the results (like traverse and mapMaybe).

  4. sequenceMaybesI :: Monoidal f => [f (Maybe a)] -> f [a]

    invertible Control.Invertible.Monoidal

    Sequence (like sequenceA) and filter (like catMaybes) a list of monoidals, producing the list of non-Nothing values. Shorter input lists pad with Nothings and longer ones are ignored.

  5. consMaybe :: (Maybe a, [a]) <-> [a]

    invertible Data.Invertible.List

    Convert between (Just head, tail) and the non-empty list head:tail, or (Nothing, list) and list.

  6. fromMaybe :: Eq a => a -> Maybe a <-> a

    invertible Data.Invertible.Maybe

    Convert between Nothing and a default value, or Just and its value (not a true bijection).

  7. listToMaybe :: [a] <-> Maybe a

    invertible Data.Invertible.Maybe

    Convert between (the head of) a (singleton) list and Maybe (see listToMaybe). (invert maybeToList)

  8. lookupBaseMaybe :: ParseYamlFile a => BaseDir -> Object -> Text -> Parser (Maybe a)

    keter Keter.Yaml.FilePath

    A replacement for the .:? operator which will both parse a file path and apply the relative file logic.

  9. satisfyMaybe :: (FromServerMessage -> Maybe a) -> Session a

    lsp-test Language.LSP.Test

    Consumes and returns the result of the specified predicate if it returns Just.

  10. getMaybeBij :: MaybeBij -> Maybe Bij

    mappings Data.Bijection

    No documentation available.

Page 274 of many | Previous | Next