Copyright | (c) Sirui Lu 2021-2023 |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | siruilu@cs.washington.edu |
Stability | Experimental |
Portability | GHC only |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Documentation
type PartialFun a b = a -> Maybe b Source #
type PartialRuleUnary a b = PartialFun (Term a) (Term b) Source #
type TotalRuleUnary a b = Term a -> Term b Source #
type PartialRuleBinary a b c = Term a -> PartialFun (Term b) (Term c) Source #
totalize :: PartialFun a b -> (a -> b) -> a -> b Source #
totalize2 :: (a -> PartialFun b c) -> (a -> b -> c) -> a -> b -> c Source #
class UnaryPartialStrategy tag a b | tag a -> b where Source #
unaryPartial :: forall tag a b. UnaryPartialStrategy tag a b => tag -> PartialRuleUnary a b Source #
class BinaryCommPartialStrategy tag a c | tag a -> c where Source #
class BinaryPartialStrategy tag a b c | tag a b -> c where Source #
extractora :: tag -> Term a -> Maybe a Source #
extractorb :: tag -> Term b -> Maybe b Source #
allConstantHandler :: tag -> a -> b -> Maybe (Term c) Source #
leftConstantHandler :: tag -> a -> Term b -> Maybe (Term c) Source #
default leftConstantHandler :: (a ~ b, BinaryCommPartialStrategy tag a c) => tag -> a -> Term b -> Maybe (Term c) Source #
rightConstantHandler :: tag -> Term a -> b -> Maybe (Term c) Source #
default rightConstantHandler :: (a ~ b, BinaryCommPartialStrategy tag a c) => tag -> Term a -> b -> Maybe (Term c) Source #
nonBinaryConstantHandler :: tag -> Term a -> Term b -> Maybe (Term c) Source #
binaryPartial :: forall tag a b c. BinaryPartialStrategy tag a b c => tag -> PartialRuleBinary a b c Source #