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.
maybeTuple :: Text -> Maybe (Text, Text)clash-lib Clash.Netlist.Id.Common No documentation available.
maybeConvertToCustomRepr :: CustomReprs -> Type -> FilteredHWType -> FilteredHWTypeclash-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.
maybeReader :: (String -> Maybe a) -> ReadM aconfiguration-tools Configuration.Utils.CommandLine Convert a function producing a Maybe into a reader.
maybeOption :: a -> Bool -> (a -> a) -> Maybe a -> Maybe aconfiguration-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"maybeHolds :: Property p v => p -> v -> Maybe vdata-checked Data.Checked maybeHolds :: Property p v => p -> v -> Maybe vdata-checked Data.Checked.Strict maybeM :: Monad m => m b -> (a -> m b) -> m (Maybe a) -> m bdistribution-opensuse OpenSuse.Prelude Monadic generalisation of maybe.
-
dunai Control.Monad.Trans.MSF.Except Converts an MSF in MaybeT to an MSF in ExceptT. Whenever Nothing is thrown, throw () instead.
maybeExit :: forall (m :: Type -> Type) a . Monad m => MSF (MaybeT m) (Maybe a) adunai Control.Monad.Trans.MSF.Maybe Just a is passed along, Nothing causes the whole MSF to exit.
-
dunai Control.Monad.Trans.MSF.Maybe Converts an MSF in MaybeT to an MSF in ExceptT. Whenever Nothing is thrown, throw () instead.