Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data MatchNumType a where
- MatchNumType :: Sing p -> Sing k -> NumericBasicType k -> Prim p k a -> MatchNumType (PrimS a)
- matchNumType :: D a -> Maybe (MatchNumType a)
- data MatchNumR a b where
- MatchNumR :: NumericBasicType k1 -> NumericBasicType k2 -> Prim p1 k1 a -> Prim p2 k2 b -> Prim (PrecMax p1 p2) (BasicTypeMax k1 k2) c -> MatchNumR (PrimS a) (PrimS b)
- matchNumR :: D a -> D b -> Maybe (MatchNumR a b)
- primCeil :: Prim p1 k1 a -> Prim p2 k2 b -> Maybe (MakePrim (PrecMax p1 p2) (BasicTypeMax k1 k2))
- data MatchCompareR a b where
- MatchCompareR :: ComparableBasicTypes k1 k2 -> Prim p1 k1 a -> Prim p2 k2 b -> MatchCompareR (PrimS a) (PrimS b)
- matchCompareR :: D a -> D b -> Maybe (MatchCompareR a b)
- data MatchOpSpec ok args where
- MatchOpSpec :: OpSpec ok args result -> D result -> MatchOpSpec ok args
- matchOpSpec :: Op (Length args) ok -> Rec D args -> Maybe (MatchOpSpec ok args)
Documentation
data MatchNumType a where Source #
MatchNumType :: Sing p -> Sing k -> NumericBasicType k -> Prim p k a -> MatchNumType (PrimS a) |
matchNumType :: D a -> Maybe (MatchNumType a) Source #
Checks if the given type is numeric, and if so returns a proof of that fact.
data MatchNumR a b where Source #
MatchNumR :: NumericBasicType k1 -> NumericBasicType k2 -> Prim p1 k1 a -> Prim p2 k2 b -> Prim (PrecMax p1 p2) (BasicTypeMax k1 k2) c -> MatchNumR (PrimS a) (PrimS b) |
matchNumR :: D a -> D b -> Maybe (MatchNumR a b) Source #
Checks if it is possible to perform a binary numeric operation on arguments with the given respective types. If so, returns the type that would result plus some more information about the types.
primCeil :: Prim p1 k1 a -> Prim p2 k2 b -> Maybe (MakePrim (PrecMax p1 p2) (BasicTypeMax k1 k2)) Source #
data MatchCompareR a b where Source #
MatchCompareR :: ComparableBasicTypes k1 k2 -> Prim p1 k1 a -> Prim p2 k2 b -> MatchCompareR (PrimS a) (PrimS b) |
matchCompareR :: D a -> D b -> Maybe (MatchCompareR a b) Source #
Checks if it is possible to perform a binary comparison (equality or relational) operation on arguments with the given respective types. If so, returns proof of that fact.
data MatchOpSpec ok args where Source #
MatchOpSpec :: OpSpec ok args result -> D result -> MatchOpSpec ok args |
matchOpSpec :: Op (Length args) ok -> Rec D args -> Maybe (MatchOpSpec ok args) Source #
Checks if it is possible to apply the given operator to the given arguments, and if so returns a proof of that fact, packaged with information about the result of applying the operator.