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. synTyConRhs_maybe :: TyCon -> Maybe Type

    liquidhaskell-boot Liquid.GHC.API

    Extract the information pertaining to the right hand side of a type synonym (type) declaration.

  2. topNormaliseType_maybe :: FamInstEnvs -> Type -> Maybe Reduction

    liquidhaskell-boot Liquid.GHC.API

    Get rid of *outermost* (or toplevel) * type function redex * data family redex * newtypes returning an appropriate Representational coercion. Specifically, if topNormaliseType_maybe env ty = Just (co, ty') then (a) co :: ty ~R ty' (b) ty' is not a newtype, and is not a type-family or data-family redex However, ty' can be something like (Maybe (F ty)), where (F ty) is a redex. Always operates homogeneously: the returned type has the same kind as the original type, and the returned coercion is always homogeneous.

  3. tyConAppArgs_maybe :: Type -> Maybe [Type]

    liquidhaskell-boot Liquid.GHC.API

    The same as snd . splitTyConApp

  4. tyConAppTyCon_maybe :: Type -> Maybe TyCon

    liquidhaskell-boot Liquid.GHC.API

    The same as fst . splitTyConApp We can short-cut the FunTy case

  5. tyConClass_maybe :: TyCon -> Maybe Class

    liquidhaskell-boot Liquid.GHC.API

    If this TyCon is that for a class instance, return the class it is for. Otherwise returns Nothing

  6. tyConDataCons_maybe :: TyCon -> Maybe [DataCon]

    liquidhaskell-boot Liquid.GHC.API

    Determine the DataCons originating from the given TyCon, if the TyCon is the sort that can have any constructors (note: this does not include abstract algebraic types)

  7. tyConFamInst_maybe :: TyCon -> Maybe (TyCon, [Type])

    liquidhaskell-boot Liquid.GHC.API

    If this TyCon is that of a data family instance, return the family in question and the instance types. Otherwise, return Nothing

  8. tyConSingleDataCon_maybe :: TyCon -> Maybe DataCon

    liquidhaskell-boot Liquid.GHC.API

    If the given TyCon has a single data constructor, i.e. it is a data type with one alternative, a tuple type or a newtype then that constructor is returned. If the TyCon has more than one constructor, or represents a primitive or function type constructor then Nothing is returned.

  9. parseMaybe :: (a -> Parser b) -> a -> Maybe b

    microaeson Data.Aeson.Micro

    Run Parser. A common use-case is parseMaybe parseJSON.

  10. minusMaybe :: (Ord k, MonoidNull v, Reductive v) => MonoidMap k v -> MonoidMap k v -> Maybe (MonoidMap k v)

    monoidmap-internal Data.MonoidMap.Internal

    Performs reductive subtraction of the second map from the first. Uses the Reductive subtraction operator (</>) to subtract each value in the second map from its matching value in the first map. This function produces a result if (and only if) for all possible keys k, it is possible to subtract the value for k in the second map from the value for k in the first map:

    isJust (m1 `minusMaybe` m2)
    == (∀ k. isJust (get k m1 </> get k m2))
    
    Otherwise, this function returns Nothing. This function satisfies the following property:
    all
    (\r -> Just (get k r) == get k m1 </> get k m2)
    (m1 `minusMaybe` m2)
    
    This function provides the definition of (</>) for the MonoidMap instance of Reductive.

    Examples

    With Set Natural values, this function performs set subtraction of matching values, succeeding if (and only if) each value from the second map is a subset of its matching value from the first map:
    f xs = fromList (fromList <$> xs)
    
    >>> m1 = f [("a", [0,1,2]), ("b", [0,1,2])]
    >>> m2 = f [("a", [     ]), ("b", [0,1,2])]
    >>> m3 = f [("a", [0,1,2]), ("b", [     ])]
    
    >>> m1 `minusMaybe` m2 == Just m3
    True
    
    >>> m1 = f [("a", [0,1,2]), ("b", [0,1,2]), ("c", [0,1,2])]
    >>> m2 = f [("a", [0    ]), ("b", [  1  ]), ("c", [    2])]
    >>> m3 = f [("a", [  1,2]), ("b", [0,  2]), ("c", [0,1  ])]
    
    >>> m1 `minusMaybe` m2 == Just m3
    True
    
    >>> m1 = f [("a", [0,1,2    ]), ("b", [0,1,2    ]), ("c", [0,1,2    ])]
    >>> m2 = f [("a", [    2,3,4]), ("b", [  1,2,3,4]), ("c", [0,1,2,3,4])]
    
    >>> m1 `minusMaybe` m2 == Nothing
    True
    
    With Sum Natural values, this function performs ordinary subtraction of matching values, succeeding if (and only if) each value from the second map is less than or equal to its matching value from the first map:
    >>> m1 = fromList [("a", 2), ("b", 3), ("c", 5), ("d", 8)]
    >>> m2 = fromList [("a", 0), ("b", 0), ("c", 0), ("d", 0)]
    >>> m3 = fromList [("a", 2), ("b", 3), ("c", 5), ("d", 8)]
    
    >>> m1 `minusMaybe` m2 == Just m3
    True
    
    >>> m1 = fromList [("a", 2), ("b", 3), ("c", 5), ("d", 8)]
    >>> m2 = fromList [("a", 1), ("b", 2), ("c", 3), ("d", 5)]
    >>> m3 = fromList [("a", 1), ("b", 1), ("c", 2), ("d", 3)]
    
    >>> m1 `minusMaybe` m2 == Just m3
    True
    
    >>> m1 = fromList [("a", 2), ("b", 3), ("c", 5), ("d", 8)]
    >>> m2 = fromList [("a", 2), ("b", 3), ("c", 5), ("d", 8)]
    >>> m3 = fromList [("a", 0), ("b", 0), ("c", 0), ("d", 0)]
    
    >>> m1 `minusMaybe` m2 == Just m3
    True
    
    >>> m1 = fromList [("a", 2), ("b", 3), ("c", 5), ("d", 8)]
    >>> m2 = fromList [("a", 3), ("b", 3), ("c", 5), ("d", 8)]
    
    >>> m1 `minusMaybe` m2 == Nothing
    True
    

Page 251 of many | Previous | Next