holmes-0.3.2.0: Tools and combinators for solving constraint problems.
Copyright(c) Tom Harding 2020
LicenseMIT
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.JoinSemilattice.Defined

Description

The Defined type simplifies the join semilattice-shaped knowledge down to its simplest form, by saying there are only three possible states of knowledge:

  • I don't know anything about this value.
  • I know exactly what this value is.
  • I'm getting conflicting information.

The simplicity of the type makes it incredibly helpful when we're trying to lift regular computations into the world of propagators.

Synopsis

Documentation

data Defined (x :: Type) Source #

Defines simple "levels of knowledge" about a value.

Constructors

Unknown

Nothing has told me what this value is.

Exactly x

Everyone who has told me this value agrees.

Conflict

Two sources disagree on what this value should be.

Instances

Instances details
Functor Defined Source # 
Instance details

Defined in Data.JoinSemilattice.Defined

Methods

fmap :: (a -> b) -> Defined a -> Defined b #

(<$) :: a -> Defined b -> Defined a #

Applicative Defined Source # 
Instance details

Defined in Data.JoinSemilattice.Defined

Methods

pure :: a -> Defined a #

(<*>) :: Defined (a -> b) -> Defined a -> Defined b #

liftA2 :: (a -> b -> c) -> Defined a -> Defined b -> Defined c #

(*>) :: Defined a -> Defined b -> Defined b #

(<*) :: Defined a -> Defined b -> Defined a #

BooleanR Defined Source # 
Instance details

Defined in Data.JoinSemilattice.Class.Boolean

EqR Defined Source # 
Instance details

Defined in Data.JoinSemilattice.Class.Eq

Associated Types

type EqC Defined :: Type -> Constraint Source #

Methods

eqR :: EqC' Defined x => (Defined x, Defined x, Defined Bool) -> (Defined x, Defined x, Defined Bool) Source #

OrdR Defined Source # 
Instance details

Defined in Data.JoinSemilattice.Class.Ord

Associated Types

type OrdC Defined :: Type -> Constraint Source #

Mapping Defined Eq Source # 
Instance details

Defined in Data.JoinSemilattice.Class.Mapping

Methods

mapR :: (Eq x, Eq y) => (Maybe (x -> y), Maybe (y -> x)) -> (Defined x, Defined y) -> (Defined x, Defined y) Source #

Zipping Defined Eq Source # 
Instance details

Defined in Data.JoinSemilattice.Class.Zipping

Methods

zipWithR :: (Eq x, Eq y, Eq z) => (Maybe ((x, y) -> z), Maybe ((x, z) -> y), Maybe ((y, z) -> x)) -> (Defined x, Defined y, Defined z) -> (Defined x, Defined y, Defined z) Source #

Lifting Defined Eq Source # 
Instance details

Defined in Data.JoinSemilattice.Class.Lifting

Methods

lift' :: Eq x => x -> Defined x Source #

FlatMapping Defined Eq Source # 
Instance details

Defined in Data.JoinSemilattice.Class.FlatMapping

Methods

flatMapR :: (Eq x, Eq y) => (Maybe (x -> Defined y), Maybe (Defined y -> x)) -> (Defined x, Defined y) -> (Defined x, Defined y) Source #

Bounded x => Bounded (Defined x) Source # 
Instance details

Defined in Data.JoinSemilattice.Defined

Enum content => Enum (Defined content) Source # 
Instance details

Defined in Data.JoinSemilattice.Defined

Methods

succ :: Defined content -> Defined content #

pred :: Defined content -> Defined content #

toEnum :: Int -> Defined content #

fromEnum :: Defined content -> Int #

enumFrom :: Defined content -> [Defined content] #

enumFromThen :: Defined content -> Defined content -> [Defined content] #

enumFromTo :: Defined content -> Defined content -> [Defined content] #

enumFromThenTo :: Defined content -> Defined content -> Defined content -> [Defined content] #

Eq x => Eq (Defined x) Source # 
Instance details

Defined in Data.JoinSemilattice.Defined

Methods

(==) :: Defined x -> Defined x -> Bool #

(/=) :: Defined x -> Defined x -> Bool #

Fractional x => Fractional (Defined x) Source # 
Instance details

Defined in Data.JoinSemilattice.Defined

Methods

(/) :: Defined x -> Defined x -> Defined x #

recip :: Defined x -> Defined x #

fromRational :: Rational -> Defined x #

Integral content => Integral (Defined content) Source # 
Instance details

Defined in Data.JoinSemilattice.Defined

Methods

quot :: Defined content -> Defined content -> Defined content #

rem :: Defined content -> Defined content -> Defined content #

div :: Defined content -> Defined content -> Defined content #

mod :: Defined content -> Defined content -> Defined content #

quotRem :: Defined content -> Defined content -> (Defined content, Defined content) #

divMod :: Defined content -> Defined content -> (Defined content, Defined content) #

toInteger :: Defined content -> Integer #

Num x => Num (Defined x) Source # 
Instance details

Defined in Data.JoinSemilattice.Defined

Methods

(+) :: Defined x -> Defined x -> Defined x #

(-) :: Defined x -> Defined x -> Defined x #

(*) :: Defined x -> Defined x -> Defined x #

negate :: Defined x -> Defined x #

abs :: Defined x -> Defined x #

signum :: Defined x -> Defined x #

fromInteger :: Integer -> Defined x #

Ord x => Ord (Defined x) Source # 
Instance details

Defined in Data.JoinSemilattice.Defined

Methods

compare :: Defined x -> Defined x -> Ordering #

(<) :: Defined x -> Defined x -> Bool #

(<=) :: Defined x -> Defined x -> Bool #

(>) :: Defined x -> Defined x -> Bool #

(>=) :: Defined x -> Defined x -> Bool #

max :: Defined x -> Defined x -> Defined x #

min :: Defined x -> Defined x -> Defined x #

Real content => Real (Defined content) Source # 
Instance details

Defined in Data.JoinSemilattice.Defined

Methods

toRational :: Defined content -> Rational #

Show x => Show (Defined x) Source # 
Instance details

Defined in Data.JoinSemilattice.Defined

Methods

showsPrec :: Int -> Defined x -> ShowS #

show :: Defined x -> String #

showList :: [Defined x] -> ShowS #

Generic (Defined x) Source # 
Instance details

Defined in Data.JoinSemilattice.Defined

Associated Types

type Rep (Defined x) :: Type -> Type #

Methods

from :: Defined x -> Rep (Defined x) x0 #

to :: Rep (Defined x) x0 -> Defined x #

Eq content => Semigroup (Defined content) Source # 
Instance details

Defined in Data.JoinSemilattice.Defined

Methods

(<>) :: Defined content -> Defined content -> Defined content #

sconcat :: NonEmpty (Defined content) -> Defined content #

stimes :: Integral b => b -> Defined content -> Defined content #

Eq content => Monoid (Defined content) Source # 
Instance details

Defined in Data.JoinSemilattice.Defined

Methods

mempty :: Defined content #

mappend :: Defined content -> Defined content -> Defined content #

mconcat :: [Defined content] -> Defined content #

Hashable x => Hashable (Defined x) Source # 
Instance details

Defined in Data.JoinSemilattice.Defined

Methods

hashWithSalt :: Int -> Defined x -> Int #

hash :: Defined x -> Int #

Input (Defined content) Source # 
Instance details

Defined in Data.JoinSemilattice.Defined

Associated Types

type Raw (Defined content) Source #

Methods

from :: forall (m :: Type -> Type). Applicative m => Int -> [Raw (Defined content)] -> Config m (Defined content) Source #

Eq content => Merge (Defined content) Source # 
Instance details

Defined in Data.JoinSemilattice.Class.Merge

Methods

(<<-) :: Defined content -> Defined content -> Result (Defined content) Source #

(Eq x, Num x) => SumR (Defined x) Source # 
Instance details

Defined in Data.JoinSemilattice.Class.Sum

Methods

addR :: (Defined x, Defined x, Defined x) -> (Defined x, Defined x, Defined x) Source #

(Eq x, Integral x) => IntegralR (Defined x) Source # 
Instance details

Defined in Data.JoinSemilattice.Class.Integral

Methods

divModR :: (Defined x, Defined x, Defined x, Defined x) -> (Defined x, Defined x, Defined x, Defined x) Source #

(Eq x, Fractional x) => FractionalR (Defined x) Source # 
Instance details

Defined in Data.JoinSemilattice.Class.Fractional

Methods

multiplyR :: (Defined x, Defined x, Defined x) -> (Defined x, Defined x, Defined x) Source #

(Eq x, Num x) => AbsR (Defined x) Source # 
Instance details

Defined in Data.JoinSemilattice.Class.Abs

Methods

absR :: (Defined x, Defined x) -> (Defined x, Defined x) Source #

type EqC Defined Source # 
Instance details

Defined in Data.JoinSemilattice.Class.Eq

type EqC Defined = Eq
type OrdC Defined Source # 
Instance details

Defined in Data.JoinSemilattice.Class.Ord

type Rep (Defined x) Source # 
Instance details

Defined in Data.JoinSemilattice.Defined

type Rep (Defined x) = D1 ('MetaData "Defined" "Data.JoinSemilattice.Defined" "holmes-0.3.2.0-IZRXzdzxzGIK7susMZefUq" 'False) (C1 ('MetaCons "Unknown" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Exactly" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 x)) :+: C1 ('MetaCons "Conflict" 'PrefixI 'False) (U1 :: Type -> Type)))
type Raw (Defined content) Source # 
Instance details

Defined in Data.JoinSemilattice.Defined

type Raw (Defined content) = content