holmes-0.1.0.1: Tools and combinators for solving constraint problems.

Copyright(c) Tom Harding 2020
LicenseMIT
Safe HaskellSafe
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
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 #

Mapping Defined Eq Source # 
Instance details

Defined in Data.JoinSemilattice.Class.Mapping

Methods

mapR :: (Eq x, Eq y) => ((x, y) -> (x, y)) -> (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) => ((x, y, z) -> (x, y, z)) -> (Defined x, Defined y, Defined z) -> (Defined x, Defined y, Defined z) Source #

FlatMapping Defined Eq Source # 
Instance details

Defined in Data.JoinSemilattice.Class.FlatMapping

Methods

flatMapR :: (Eq x, Eq y) => ((x, Defined y) -> (x, Defined y)) -> (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) :: Type Source #

Methods

from :: 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 #

BooleanR (Defined Bool) Source # 
Instance details

Defined in Data.JoinSemilattice.Class.Boolean

(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 #

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

Defined in Data.JoinSemilattice.Class.Eq

Ord x => OrdR (Defined x) (Defined Bool) 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.1.0.1-CghJRrKr1HAJcmez9ZnNsQ" 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