Hoogle Search

Within LTS Haskell 24.51 (ghc-9.10.3)

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

  1. maybeRepoRemote :: Repo -> Maybe RemoteRepo

    cabal-install Distribution.Client.Types.Repo

    Extract RemoteRepo from Repo if remote.

  2. maybeColor :: Handle -> [SGR] -> String -> IO String

    cabal2nix Distribution.Nixpkgs.Color

    If the given Handle should be colored, wrap a String in SGR codes.

  3. maybeSubstTm :: HasCallStack => Doc () -> Maybe Subst -> Term -> Term

    clash-lib Clash.Core.Subst

    Substitute within a Term. Just return original term if given substitution is Nothing.

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

    clash-lib Clash.Netlist.Id.Common

    No documentation available.

  5. 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.

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

    configuration-tools Configuration.Utils.CommandLine

    Convert a function producing a Maybe into a reader.

  7. 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"
    

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

    data-checked Data.Checked

    Return Just v if p holds and Nothing overwise.

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

    data-checked Data.Checked.Strict

    Return Just v if p holds and Nothing overwise.

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

    distribution-opensuse OpenSuse.Prelude

    Monadic generalisation of maybe.

Page 65 of many | Previous | Next