Hoogle Search

Within LTS Haskell 24.31 (ghc-9.10.3)

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

  1. maybeTuple :: Text -> Maybe (Text, Text)

    clash-lib Clash.Netlist.Id.Common

    No documentation available.

  2. maybeConvertToCustomRepr :: CustomReprs -> Type -> FilteredHWType -> FilteredHWType

    clash-lib Clash.Netlist.Util

    Given a map containing custom bit representation, a type, and the same type represented as HWType, convert the HWType to a CustomSP/CustomSum if it has a custom bit representation.

  3. maybeReader :: (String -> Maybe a) -> ReadM a

    configuration-tools Configuration.Utils.CommandLine

    Convert a function producing a Maybe into a reader.

  4. maybeOption :: a -> Bool -> (a -> a) -> Maybe a -> Maybe a

    configuration-tools Configuration.Utils.Maybe

    Command line parser for record Maybe values

    Example:

    data Setting = Setting
    { _setA ∷ !Int
    , _setB ∷ !String
    }
    deriving (Show, Read, Eq, Ord, Typeable)
    
    $(makeLenses ''Setting)
    
    defaultSetting ∷ Setting
    defaultSetting = Setting
    { _setA = 0
    , _setB = 1
    }
    
    instance ToJSON Setting where
    toJSON setting = object
    [ "a" .= _setA setting
    , "b" .= _setB setting
    ]
    
    instance FromJSON (Setting → Setting) where
    parseJSON = withObject "Setting" $ \o → id
    <$< setA ..: "a" % o
    <*< setB ..: "b" % o
    
    instance FromJSON Setting where
    parseJSON v = parseJSON v <*> pure defaultSetting
    
    pSetting ∷ MParser Setting
    pSetting = id
    <$< setA .:: option auto
    % short 'a'
    <> metavar "INT"
    <> help "set a"
    <*< setB .:: option auto
    % short 'b'
    <> metavar "INT"
    <> help "set b"
    
    -- | Use 'Setting' as 'Maybe' in a configuration:
    --
    data Config = Config
    { _maybeSetting ∷ !(Maybe Setting)
    }
    deriving (Show, Read, Eq, Ord, Typeable)
    
    $(makeLenses ''Config)
    
    defaultConfig ∷ Config
    defaultConfig = Config
    { _maybeSetting = defaultSetting
    }
    
    instance ToJSON Config where
    toJSON config = object
    [ "setting" .= maybeSetting
    ]
    
    instance FromJSON (Config → Config) where
    parseJSON = withObject "Config" $ \o → id
    <$< maybeSetting %.: "setting" % o
    
    pConfig ∷ MParser Config
    pConfig = id
    <$< maybeSetting %:: (maybeOption defaultSetting
    <$> pEnableSetting
    <*> pSetting)
    where
    pEnableSetting = boolOption
    % long "setting-enable"
    <> value False
    <> help "Enable configuration flags for setting"
    

  5. maybeHolds :: Property p v => p -> v -> Maybe v

    data-checked Data.Checked

    Return Just v if p holds and Nothing overwise.

  6. maybeHolds :: Property p v => p -> v -> Maybe v

    data-checked Data.Checked.Strict

    Return Just v if p holds and Nothing overwise.

  7. maybeM :: Monad m => m b -> (a -> m b) -> m (Maybe a) -> m b

    distribution-opensuse OpenSuse.Prelude

    Monadic generalisation of maybe.

  8. maybeToExceptS :: forall (m :: Type -> Type) a b . (Functor m, Monad m) => MSF (MaybeT m) a b -> MSF (ExceptT () m) a b

    dunai Control.Monad.Trans.MSF.Except

    Converts an MSF in MaybeT to an MSF in ExceptT. Whenever Nothing is thrown, throw () instead.

  9. maybeExit :: forall (m :: Type -> Type) a . Monad m => MSF (MaybeT m) (Maybe a) a

    dunai Control.Monad.Trans.MSF.Maybe

    Just a is passed along, Nothing causes the whole MSF to exit.

  10. maybeToExceptS :: forall (m :: Type -> Type) a b . (Functor m, Monad m) => MSF (MaybeT m) a b -> MSF (ExceptT () m) a b

    dunai Control.Monad.Trans.MSF.Maybe

    Converts an MSF in MaybeT to an MSF in ExceptT. Whenever Nothing is thrown, throw () instead.

Page 65 of many | Previous | Next