{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE TypeFamilies #-}
module Data.Algebra.Boolean.NormalForm (
NormalForm(..),
module Data.Algebra.Boolean.CoBoolean
) where
import Data.Algebra.Boolean.CoBoolean
import Data.Algebra.Boolean.FreeBoolean
import GHC.Exts (Constraint)
class CoBoolean1 nf => NormalForm nf where
type NFConstraint nf a :: Constraint
type NFConstraint nf a = ()
toNormalForm :: a -> nf a
simplify :: (NFConstraint nf a) => (a -> Maybe Bool) -> nf a -> nf a
fromFreeBoolean :: (NFConstraint nf a) => FreeBoolean a -> nf a
instance NormalForm FreeBoolean where
toNormalForm = FBValue
simplify _ = id
fromFreeBoolean = id