grisette-0.5.0.0: Symbolic evaluation as a library
Copyright(c) Sirui Lu 2021-2023
LicenseBSD-3-Clause (see the LICENSE file)
Maintainersiruilu@cs.washington.edu
StabilityExperimental
PortabilityGHC only
Safe HaskellTrustworthy
LanguageHaskell2010

Grisette.Internal.Core.Data.Class.Function

Description

 
Synopsis

Function operations

class Function f arg ret | f -> arg ret where Source #

Abstraction for function-like types.

Methods

(#) :: f -> arg -> ret infixl 9 Source #

Function application operator.

The operator is not right associated (like ($)). It is left associated, and you can provide many arguments with this operator once at a time.

>>> (+1) # 2
3
>>> (+) # 2 # 3
5

Instances

Instances details
(Function f arg ret, Mergeable f, Mergeable ret) => Function (UnionM f) arg (UnionM ret) Source # 
Instance details

Defined in Grisette.Internal.Core.Control.Monad.UnionM

Methods

(#) :: UnionM f -> arg -> UnionM ret Source #

(LinkedRep a sa, LinkedRep b sb) => Function (a --> b) sa sb Source # 
Instance details

Defined in Grisette.Internal.SymPrim.GeneralFun

Methods

(#) :: (a --> b) -> sa -> sb Source #

(SupportedNonFuncPrim ca, SupportedPrim cb, LinkedRep ca sa, LinkedRep cb sb, SupportedPrim (ca --> cb)) => Function (sa -~> sb) sa sb Source # 
Instance details

Defined in Grisette.Internal.SymPrim.SymGeneralFun

Methods

(#) :: (sa -~> sb) -> sa -> sb Source #

(SupportedPrim ca, SupportedPrim cb, LinkedRep ca sa, LinkedRep cb sb, SupportedPrim (ca =-> cb)) => Function (sa =~> sb) sa sb Source # 
Instance details

Defined in Grisette.Internal.SymPrim.SymTabularFun

Methods

(#) :: (sa =~> sb) -> sa -> sb Source #

Eq a => Function (a =-> b) a b Source # 
Instance details

Defined in Grisette.Internal.SymPrim.TabularFun

Methods

(#) :: (a =-> b) -> a -> b Source #

Function (a -> b) a b Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.Function

Methods

(#) :: (a -> b) -> a -> b Source #

class Apply uf where Source #

Applying an uninterpreted function.

>>> let f = "f" :: SymInteger =~> SymInteger =~> SymInteger
>>> apply f "a" "b"
(apply (apply f a) b)

Note that for implementation reasons, you can also use apply function on a non-function symbolic value. In this case, the function is treated as an id function.

Associated Types

type FunType uf Source #

Methods

apply :: uf -> FunType uf Source #

Instances

Instances details
Apply SymBool Source # 
Instance details

Defined in Grisette.Internal.SymPrim.SymBool

Associated Types

type FunType SymBool Source #

Apply SymInteger Source # 
Instance details

Defined in Grisette.Internal.SymPrim.SymInteger

Associated Types

type FunType SymInteger Source #

(KnownNat n, 1 <= n) => Apply (SymIntN n) Source # 
Instance details

Defined in Grisette.Internal.SymPrim.SymBV

Associated Types

type FunType (SymIntN n) Source #

Methods

apply :: SymIntN n -> FunType (SymIntN n) Source #

(KnownNat n, 1 <= n) => Apply (SymWordN n) Source # 
Instance details

Defined in Grisette.Internal.SymPrim.SymBV

Associated Types

type FunType (SymWordN n) Source #

Methods

apply :: SymWordN n -> FunType (SymWordN n) Source #

(LinkedRep ca sa, LinkedRep ct st, Apply st, SupportedNonFuncPrim ca, SupportedPrim ct, SupportedPrim (ca --> ct)) => Apply (sa -~> st) Source # 
Instance details

Defined in Grisette.Internal.SymPrim.SymGeneralFun

Associated Types

type FunType (sa -~> st) Source #

Methods

apply :: (sa -~> st) -> FunType (sa -~> st) Source #

(LinkedRep ca sa, LinkedRep ct st, Apply st, SupportedPrim ca, SupportedPrim ct, SupportedPrim (ca =-> ct)) => Apply (sa =~> st) Source # 
Instance details

Defined in Grisette.Internal.SymPrim.SymTabularFun

Associated Types

type FunType (sa =~> st) Source #

Methods

apply :: (sa =~> st) -> FunType (sa =~> st) Source #

Apply b => Apply (a -> b) Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.Function

Associated Types

type FunType (a -> b) Source #

Methods

apply :: (a -> b) -> FunType (a -> b) Source #