Hoogle Search
Within LTS Haskell 24.67 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
mkOrdLessEqual :: Typeable a => (a -> a -> Bool) -> [Expr]express Data.Express O(1). Builds a reified Ord instance from the given <= function. (cf. reifyOrd, mkOrd)
reifyEq :: (Typeable a, Eq a) => a -> [Expr]express Data.Express O(1). Reifies an Eq instance into a list of Exprs. The list will contain == and /= for the given type. (cf. mkEq, mkEquation)
> reifyEq (undefined :: Int) [ (==) :: Int -> Int -> Bool , (/=) :: Int -> Int -> Bool ]
> reifyEq (undefined :: Bool) [ (==) :: Bool -> Bool -> Bool , (/=) :: Bool -> Bool -> Bool ]
> reifyEq (undefined :: String) [ (==) :: [Char] -> [Char] -> Bool , (/=) :: [Char] -> [Char] -> Bool ]
reifyEqOrd :: (Typeable a, Ord a) => a -> [Expr]express Data.Express compareQuickly :: Expr -> Expr -> Orderingexpress Data.Express.Core O(n). A fast total order between Exprs that can be used when sorting Expr values. This is lazier than its counterparts compareComplexity and compareLexicographically and tries to evaluate the given Exprs as least as possible.
isEq :: [Expr] -> Expr -> Boolexpress Data.Express.Instances O(n+m). Returns whether an Eq instance exists in the given instances list for the given Expr.
> isEq (reifyEqOrd (undefined :: Int)) (val (0::Int)) True
> isEq (reifyEqOrd (undefined :: Int)) (val ([[[0::Int]]])) False
Given that the instances list has length m and that the given Expr has size n, this function is O(n+m).isEqOrd :: [Expr] -> Expr -> Boolexpress Data.Express.Instances O(n+m). Returns whether both Eq and Ord instance exist in the given list for the given Expr. Given that the instances list has length m and that the given Expr has size n, this function is O(n+m).
isEqOrdT :: [Expr] -> TypeRep -> Boolexpress Data.Express.Instances O(n). Returns whether both Eq and Ord instance exist in the given list for the given TypeRep. Given that the instances list has length n, this function is O(n).
isEqT :: [Expr] -> TypeRep -> Boolexpress Data.Express.Instances O(n). Returns whether an Eq instance exists in the given instances list for the given TypeRep.
> isEqT (reifyEqOrd (undefined :: Int)) (typeOf (undefined :: Int)) True
> isEqT (reifyEqOrd (undefined :: Int)) (typeOf (undefined :: [[[Int]]])) False
Given that the instances list has length n, this function is O(n).mkEq :: Typeable a => (a -> a -> Bool) -> [Expr]express Data.Express.Instances O(1). Builds a reified Eq instance from the given == function. (cf. reifyEq)
> mkEq ((==) :: Int -> Int -> Bool) [ (==) :: Int -> Int -> Bool , (/=) :: Int -> Int -> Bool ]
mkEquation :: [Expr] -> Expr -> Expr -> Exprexpress Data.Express.Instances O(n+m). Returns an equation between two expressions given that it is possible to do so from == operators given in the argument instances list. When not possible, this function returns False encoded as an Expr.