module Data.Array.Parallel.Base.Util (
  fromBool, toBool
) where

fromBool :: Num a => Bool -> a
fromBool False = 0
fromBool True  = 1
{-# INLINE fromBool #-}

toBool :: Num a => a -> Bool
toBool n | n == 0    = False
         | otherwise = True
{-# INLINE toBool #-}


module Data.Array.Parallel.Base.Util (
  fromBool, toBool
) where

fromBool :: Bool -> Int
fromBool False = 0
fromBool True  = 1
{-# INLINE fromBool #-}

toBool :: Int -> Bool
toBool n | n == 0    = False
         | otherwise = True
{-# INLINE toBool #-}


Make fromBool and toBool monomorphic
Make fromBool and toBool monomorphic

They weren't getting inlined otherwise. Big performance ouch: this change
makes sequential Quickhull about 30% faster.
