Commits

Iago Abal committed b9dd97f

Add fromBool :: Bool -> BV

Comments (0)

Files changed (1)

   , (<<.), shl, (>>.), shr, ashr
   , (<<<.), rol, (>>>.), ror
   -- * Conversion
+  , fromBool
   , fromBits
   , toBits
   -- Pretty-printing
 ----------------------------------------------------------------------
 --- Conversion
 
+-- | Create a bit-vector from a single bit. 
+--
+fromBool :: Bool -> BV
+fromBool False = BV 1 0
+fromBool True  = BV 1 1
+{-# INLINE fromBool #-}
+
 -- | Create a bit-vector from a big-endian list of bits.
 --
 -- >>> fromBits [False, False, True]