{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Algebra.Boolean
( BooleanAlgebra
, (==>)
, not
, iff
, iff'
, Boolean
, runBoolean
, boolean
) where
import Prelude hiding (not)
import Data.Data (Data, Typeable)
import GHC.Generics (Generic)
import Algebra.Lattice ( Lattice
, BoundedLattice
, JoinSemiLattice (..)
, BoundedJoinSemiLattice
, MeetSemiLattice (..)
, BoundedMeetSemiLattice
)
import Algebra.Heyting ( HeytingAlgebra (..)
, BooleanAlgebra
, iff
, iff'
, not
, toBoolean
)
newtype Boolean a = Boolean
{ runBoolean :: a
}
deriving
( JoinSemiLattice, BoundedJoinSemiLattice, MeetSemiLattice
, BoundedMeetSemiLattice, Lattice, BoundedLattice, HeytingAlgebra
, Eq, Ord, Read, Show, Bounded, Typeable, Data, Generic
)
instance HeytingAlgebra a => BooleanAlgebra (Boolean a)
boolean :: HeytingAlgebra a => a -> Boolean a
boolean = Boolean . toBoolean