rerefined-0.1.0: Refinement types, again
Safe HaskellSafe-Inferred
LanguageGHC2021

Rerefined.Predicate.Relational.Internal

Synopsis

Documentation

data RelOp Source #

Relational operator.

There are three possible outcomes from compareing two terms, defined in Ordering. However, we may instead compare terms using relational operators such as >=, which are more specific comparisons that return a Bool.

Constructor order is arbitrary due to NEQ, which obstructs ordering in a meaningful way.

Constructors

LT'

< less than

LTE

<= less than or equal to

EQ'

== equal to

NEQ

/= less than or greater than

GTE

>= equal to or greater than

GT'

> greater than

class Typeable op => ReifyRelOp (op :: RelOp) where Source #

Reify a relational operator type tag.

We stuff the Typeable constraint in here because we need it for easy Predicate instances, and we don't want to expose the Typeable constraint elsewhere.

Methods

reifyRelOp :: forall a. (Num a, Ord a) => a -> a -> Bool Source #

The term-level relational operator that op describes.

reifyRelOpPretty :: String Source #

Pretty operator.

Instances

Instances details
ReifyRelOp 'EQ' Source # 
Instance details

Defined in Rerefined.Predicate.Relational.Internal

Methods

reifyRelOp :: (Num a, Ord a) => a -> a -> Bool Source #

reifyRelOpPretty :: String Source #

ReifyRelOp 'GT' Source # 
Instance details

Defined in Rerefined.Predicate.Relational.Internal

Methods

reifyRelOp :: (Num a, Ord a) => a -> a -> Bool Source #

reifyRelOpPretty :: String Source #

ReifyRelOp 'GTE Source # 
Instance details

Defined in Rerefined.Predicate.Relational.Internal

Methods

reifyRelOp :: (Num a, Ord a) => a -> a -> Bool Source #

reifyRelOpPretty :: String Source #

ReifyRelOp 'LT' Source # 
Instance details

Defined in Rerefined.Predicate.Relational.Internal

Methods

reifyRelOp :: (Num a, Ord a) => a -> a -> Bool Source #

reifyRelOpPretty :: String Source #

ReifyRelOp 'LTE Source # 
Instance details

Defined in Rerefined.Predicate.Relational.Internal

Methods

reifyRelOp :: (Num a, Ord a) => a -> a -> Bool Source #

reifyRelOpPretty :: String Source #

ReifyRelOp 'NEQ Source # 
Instance details

Defined in Rerefined.Predicate.Relational.Internal

Methods

reifyRelOp :: (Num a, Ord a) => a -> a -> Bool Source #

reifyRelOpPretty :: String Source #

type family WidenRelOp (op :: RelOp) (n :: Natural) (m :: Natural) where ... Source #

Can we widen the given RelOp from n to m?