{-# LANGUAGE ConstraintKinds   #-}
{-# LANGUAGE FlexibleContexts  #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MonoLocalBinds    #-}
{-# LANGUAGE TypeFamilies      #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- |
-- Module      : Data.Array.Accelerate.Classes.Integral
-- Copyright   : [2016..2020] The Accelerate Team
-- License     : BSD3
--
-- Maintainer  : Trevor L. McDonell <trevor.mcdonell@gmail.com>
-- Stability   : experimental
-- Portability : non-portable (GHC extensions)
--

module Data.Array.Accelerate.Classes.Integral (

  Integral,
  P.quot,
  P.rem,
  P.div,
  P.mod,
  P.quotRem,
  P.divMod,

) where

import Data.Array.Accelerate.Smart
import Data.Array.Accelerate.Type

import Data.Array.Accelerate.Classes.Enum
import Data.Array.Accelerate.Classes.Num
import Data.Array.Accelerate.Classes.Ord
import Data.Array.Accelerate.Classes.Real                           ()

import Prelude                                                      ( error )
import qualified Prelude                                            as P


-- | Integral numbers, supporting integral division
--
type Integral a = (Enum a, Ord a, Num a, P.Integral (Exp a))


instance P.Integral (Exp Int) where
  quot :: Exp Int -> Exp Int -> Exp Int
quot      = Exp Int -> Exp Int -> Exp Int
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkQuot
  rem :: Exp Int -> Exp Int -> Exp Int
rem       = Exp Int -> Exp Int -> Exp Int
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkRem
  div :: Exp Int -> Exp Int -> Exp Int
div       = Exp Int -> Exp Int -> Exp Int
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkIDiv
  mod :: Exp Int -> Exp Int -> Exp Int
mod       = Exp Int -> Exp Int -> Exp Int
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkMod
  quotRem :: Exp Int -> Exp Int -> (Exp Int, Exp Int)
quotRem   = Exp Int -> Exp Int -> (Exp Int, Exp Int)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkQuotRem
  divMod :: Exp Int -> Exp Int -> (Exp Int, Exp Int)
divMod    = Exp Int -> Exp Int -> (Exp Int, Exp Int)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkDivMod
  toInteger :: Exp Int -> Integer
toInteger = [Char] -> Exp Int -> Integer
forall a. HasCallStack => [Char] -> a
error [Char]
"Prelude.toInteger not supported for Accelerate types"

instance P.Integral (Exp Int8) where
  quot :: Exp Int8 -> Exp Int8 -> Exp Int8
quot      = Exp Int8 -> Exp Int8 -> Exp Int8
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkQuot
  rem :: Exp Int8 -> Exp Int8 -> Exp Int8
rem       = Exp Int8 -> Exp Int8 -> Exp Int8
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkRem
  div :: Exp Int8 -> Exp Int8 -> Exp Int8
div       = Exp Int8 -> Exp Int8 -> Exp Int8
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkIDiv
  mod :: Exp Int8 -> Exp Int8 -> Exp Int8
mod       = Exp Int8 -> Exp Int8 -> Exp Int8
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkMod
  quotRem :: Exp Int8 -> Exp Int8 -> (Exp Int8, Exp Int8)
quotRem   = Exp Int8 -> Exp Int8 -> (Exp Int8, Exp Int8)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkQuotRem
  divMod :: Exp Int8 -> Exp Int8 -> (Exp Int8, Exp Int8)
divMod    = Exp Int8 -> Exp Int8 -> (Exp Int8, Exp Int8)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkDivMod
  toInteger :: Exp Int8 -> Integer
toInteger = [Char] -> Exp Int8 -> Integer
forall a. HasCallStack => [Char] -> a
error [Char]
"Prelude.toInteger not supported for Accelerate types"

instance P.Integral (Exp Int16) where
  quot :: Exp Int16 -> Exp Int16 -> Exp Int16
quot      = Exp Int16 -> Exp Int16 -> Exp Int16
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkQuot
  rem :: Exp Int16 -> Exp Int16 -> Exp Int16
rem       = Exp Int16 -> Exp Int16 -> Exp Int16
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkRem
  div :: Exp Int16 -> Exp Int16 -> Exp Int16
div       = Exp Int16 -> Exp Int16 -> Exp Int16
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkIDiv
  mod :: Exp Int16 -> Exp Int16 -> Exp Int16
mod       = Exp Int16 -> Exp Int16 -> Exp Int16
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkMod
  quotRem :: Exp Int16 -> Exp Int16 -> (Exp Int16, Exp Int16)
quotRem   = Exp Int16 -> Exp Int16 -> (Exp Int16, Exp Int16)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkQuotRem
  divMod :: Exp Int16 -> Exp Int16 -> (Exp Int16, Exp Int16)
divMod    = Exp Int16 -> Exp Int16 -> (Exp Int16, Exp Int16)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkDivMod
  toInteger :: Exp Int16 -> Integer
toInteger = [Char] -> Exp Int16 -> Integer
forall a. HasCallStack => [Char] -> a
error [Char]
"Prelude.toInteger not supported for Accelerate types"

instance P.Integral (Exp Int32) where
  quot :: Exp Int32 -> Exp Int32 -> Exp Int32
quot      = Exp Int32 -> Exp Int32 -> Exp Int32
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkQuot
  rem :: Exp Int32 -> Exp Int32 -> Exp Int32
rem       = Exp Int32 -> Exp Int32 -> Exp Int32
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkRem
  div :: Exp Int32 -> Exp Int32 -> Exp Int32
div       = Exp Int32 -> Exp Int32 -> Exp Int32
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkIDiv
  mod :: Exp Int32 -> Exp Int32 -> Exp Int32
mod       = Exp Int32 -> Exp Int32 -> Exp Int32
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkMod
  quotRem :: Exp Int32 -> Exp Int32 -> (Exp Int32, Exp Int32)
quotRem   = Exp Int32 -> Exp Int32 -> (Exp Int32, Exp Int32)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkQuotRem
  divMod :: Exp Int32 -> Exp Int32 -> (Exp Int32, Exp Int32)
divMod    = Exp Int32 -> Exp Int32 -> (Exp Int32, Exp Int32)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkDivMod
  toInteger :: Exp Int32 -> Integer
toInteger = [Char] -> Exp Int32 -> Integer
forall a. HasCallStack => [Char] -> a
error [Char]
"Prelude.toInteger not supported for Accelerate types"

instance P.Integral (Exp Int64) where
  quot :: Exp Int64 -> Exp Int64 -> Exp Int64
quot      = Exp Int64 -> Exp Int64 -> Exp Int64
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkQuot
  rem :: Exp Int64 -> Exp Int64 -> Exp Int64
rem       = Exp Int64 -> Exp Int64 -> Exp Int64
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkRem
  div :: Exp Int64 -> Exp Int64 -> Exp Int64
div       = Exp Int64 -> Exp Int64 -> Exp Int64
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkIDiv
  mod :: Exp Int64 -> Exp Int64 -> Exp Int64
mod       = Exp Int64 -> Exp Int64 -> Exp Int64
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkMod
  quotRem :: Exp Int64 -> Exp Int64 -> (Exp Int64, Exp Int64)
quotRem   = Exp Int64 -> Exp Int64 -> (Exp Int64, Exp Int64)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkQuotRem
  divMod :: Exp Int64 -> Exp Int64 -> (Exp Int64, Exp Int64)
divMod    = Exp Int64 -> Exp Int64 -> (Exp Int64, Exp Int64)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkDivMod
  toInteger :: Exp Int64 -> Integer
toInteger = [Char] -> Exp Int64 -> Integer
forall a. HasCallStack => [Char] -> a
error [Char]
"Prelude.toInteger not supported for Accelerate types"

instance P.Integral (Exp Word) where
  quot :: Exp Word -> Exp Word -> Exp Word
quot      = Exp Word -> Exp Word -> Exp Word
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkQuot
  rem :: Exp Word -> Exp Word -> Exp Word
rem       = Exp Word -> Exp Word -> Exp Word
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkRem
  div :: Exp Word -> Exp Word -> Exp Word
div       = Exp Word -> Exp Word -> Exp Word
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkIDiv
  mod :: Exp Word -> Exp Word -> Exp Word
mod       = Exp Word -> Exp Word -> Exp Word
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkMod
  quotRem :: Exp Word -> Exp Word -> (Exp Word, Exp Word)
quotRem   = Exp Word -> Exp Word -> (Exp Word, Exp Word)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkQuotRem
  divMod :: Exp Word -> Exp Word -> (Exp Word, Exp Word)
divMod    = Exp Word -> Exp Word -> (Exp Word, Exp Word)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkDivMod
  toInteger :: Exp Word -> Integer
toInteger = [Char] -> Exp Word -> Integer
forall a. HasCallStack => [Char] -> a
error [Char]
"Prelude.toInteger not supported for Accelerate types"

instance P.Integral (Exp Word8) where
  quot :: Exp Word8 -> Exp Word8 -> Exp Word8
quot      = Exp Word8 -> Exp Word8 -> Exp Word8
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkQuot
  rem :: Exp Word8 -> Exp Word8 -> Exp Word8
rem       = Exp Word8 -> Exp Word8 -> Exp Word8
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkRem
  div :: Exp Word8 -> Exp Word8 -> Exp Word8
div       = Exp Word8 -> Exp Word8 -> Exp Word8
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkIDiv
  mod :: Exp Word8 -> Exp Word8 -> Exp Word8
mod       = Exp Word8 -> Exp Word8 -> Exp Word8
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkMod
  quotRem :: Exp Word8 -> Exp Word8 -> (Exp Word8, Exp Word8)
quotRem   = Exp Word8 -> Exp Word8 -> (Exp Word8, Exp Word8)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkQuotRem
  divMod :: Exp Word8 -> Exp Word8 -> (Exp Word8, Exp Word8)
divMod    = Exp Word8 -> Exp Word8 -> (Exp Word8, Exp Word8)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkDivMod
  toInteger :: Exp Word8 -> Integer
toInteger = [Char] -> Exp Word8 -> Integer
forall a. HasCallStack => [Char] -> a
error [Char]
"Prelude.toInteger not supported for Accelerate types"

instance P.Integral (Exp Word16) where
  quot :: Exp Word16 -> Exp Word16 -> Exp Word16
quot      = Exp Word16 -> Exp Word16 -> Exp Word16
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkQuot
  rem :: Exp Word16 -> Exp Word16 -> Exp Word16
rem       = Exp Word16 -> Exp Word16 -> Exp Word16
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkRem
  div :: Exp Word16 -> Exp Word16 -> Exp Word16
div       = Exp Word16 -> Exp Word16 -> Exp Word16
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkIDiv
  mod :: Exp Word16 -> Exp Word16 -> Exp Word16
mod       = Exp Word16 -> Exp Word16 -> Exp Word16
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkMod
  quotRem :: Exp Word16 -> Exp Word16 -> (Exp Word16, Exp Word16)
quotRem   = Exp Word16 -> Exp Word16 -> (Exp Word16, Exp Word16)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkQuotRem
  divMod :: Exp Word16 -> Exp Word16 -> (Exp Word16, Exp Word16)
divMod    = Exp Word16 -> Exp Word16 -> (Exp Word16, Exp Word16)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkDivMod
  toInteger :: Exp Word16 -> Integer
toInteger = [Char] -> Exp Word16 -> Integer
forall a. HasCallStack => [Char] -> a
error [Char]
"Prelude.toInteger not supported for Accelerate types"

instance P.Integral (Exp Word32) where
  quot :: Exp Word32 -> Exp Word32 -> Exp Word32
quot      = Exp Word32 -> Exp Word32 -> Exp Word32
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkQuot
  rem :: Exp Word32 -> Exp Word32 -> Exp Word32
rem       = Exp Word32 -> Exp Word32 -> Exp Word32
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkRem
  div :: Exp Word32 -> Exp Word32 -> Exp Word32
div       = Exp Word32 -> Exp Word32 -> Exp Word32
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkIDiv
  mod :: Exp Word32 -> Exp Word32 -> Exp Word32
mod       = Exp Word32 -> Exp Word32 -> Exp Word32
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkMod
  quotRem :: Exp Word32 -> Exp Word32 -> (Exp Word32, Exp Word32)
quotRem   = Exp Word32 -> Exp Word32 -> (Exp Word32, Exp Word32)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkQuotRem
  divMod :: Exp Word32 -> Exp Word32 -> (Exp Word32, Exp Word32)
divMod    = Exp Word32 -> Exp Word32 -> (Exp Word32, Exp Word32)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkDivMod
  toInteger :: Exp Word32 -> Integer
toInteger = [Char] -> Exp Word32 -> Integer
forall a. HasCallStack => [Char] -> a
error [Char]
"Prelude.toInteger not supported for Accelerate types"

instance P.Integral (Exp Word64) where
  quot :: Exp Word64 -> Exp Word64 -> Exp Word64
quot      = Exp Word64 -> Exp Word64 -> Exp Word64
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkQuot
  rem :: Exp Word64 -> Exp Word64 -> Exp Word64
rem       = Exp Word64 -> Exp Word64 -> Exp Word64
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkRem
  div :: Exp Word64 -> Exp Word64 -> Exp Word64
div       = Exp Word64 -> Exp Word64 -> Exp Word64
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkIDiv
  mod :: Exp Word64 -> Exp Word64 -> Exp Word64
mod       = Exp Word64 -> Exp Word64 -> Exp Word64
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkMod
  quotRem :: Exp Word64 -> Exp Word64 -> (Exp Word64, Exp Word64)
quotRem   = Exp Word64 -> Exp Word64 -> (Exp Word64, Exp Word64)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkQuotRem
  divMod :: Exp Word64 -> Exp Word64 -> (Exp Word64, Exp Word64)
divMod    = Exp Word64 -> Exp Word64 -> (Exp Word64, Exp Word64)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkDivMod
  toInteger :: Exp Word64 -> Integer
toInteger = [Char] -> Exp Word64 -> Integer
forall a. HasCallStack => [Char] -> a
error [Char]
"Prelude.toInteger not supported for Accelerate types"

instance P.Integral (Exp CInt) where
  quot :: Exp CInt -> Exp CInt -> Exp CInt
quot      = Exp CInt -> Exp CInt -> Exp CInt
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkQuot
  rem :: Exp CInt -> Exp CInt -> Exp CInt
rem       = Exp CInt -> Exp CInt -> Exp CInt
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkRem
  div :: Exp CInt -> Exp CInt -> Exp CInt
div       = Exp CInt -> Exp CInt -> Exp CInt
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkIDiv
  mod :: Exp CInt -> Exp CInt -> Exp CInt
mod       = Exp CInt -> Exp CInt -> Exp CInt
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkMod
  quotRem :: Exp CInt -> Exp CInt -> (Exp CInt, Exp CInt)
quotRem   = Exp CInt -> Exp CInt -> (Exp CInt, Exp CInt)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkQuotRem
  divMod :: Exp CInt -> Exp CInt -> (Exp CInt, Exp CInt)
divMod    = Exp CInt -> Exp CInt -> (Exp CInt, Exp CInt)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkDivMod
  toInteger :: Exp CInt -> Integer
toInteger = [Char] -> Exp CInt -> Integer
forall a. HasCallStack => [Char] -> a
error [Char]
"Prelude.toInteger not supported for Accelerate types"

instance P.Integral (Exp CUInt) where
  quot :: Exp CUInt -> Exp CUInt -> Exp CUInt
quot      = Exp CUInt -> Exp CUInt -> Exp CUInt
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkQuot
  rem :: Exp CUInt -> Exp CUInt -> Exp CUInt
rem       = Exp CUInt -> Exp CUInt -> Exp CUInt
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkRem
  div :: Exp CUInt -> Exp CUInt -> Exp CUInt
div       = Exp CUInt -> Exp CUInt -> Exp CUInt
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkIDiv
  mod :: Exp CUInt -> Exp CUInt -> Exp CUInt
mod       = Exp CUInt -> Exp CUInt -> Exp CUInt
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkMod
  quotRem :: Exp CUInt -> Exp CUInt -> (Exp CUInt, Exp CUInt)
quotRem   = Exp CUInt -> Exp CUInt -> (Exp CUInt, Exp CUInt)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkQuotRem
  divMod :: Exp CUInt -> Exp CUInt -> (Exp CUInt, Exp CUInt)
divMod    = Exp CUInt -> Exp CUInt -> (Exp CUInt, Exp CUInt)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkDivMod
  toInteger :: Exp CUInt -> Integer
toInteger = [Char] -> Exp CUInt -> Integer
forall a. HasCallStack => [Char] -> a
error [Char]
"Prelude.toInteger not supported for Accelerate types"

instance P.Integral (Exp CLong) where
  quot :: Exp CLong -> Exp CLong -> Exp CLong
quot      = Exp CLong -> Exp CLong -> Exp CLong
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkQuot
  rem :: Exp CLong -> Exp CLong -> Exp CLong
rem       = Exp CLong -> Exp CLong -> Exp CLong
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkRem
  div :: Exp CLong -> Exp CLong -> Exp CLong
div       = Exp CLong -> Exp CLong -> Exp CLong
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkIDiv
  mod :: Exp CLong -> Exp CLong -> Exp CLong
mod       = Exp CLong -> Exp CLong -> Exp CLong
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkMod
  quotRem :: Exp CLong -> Exp CLong -> (Exp CLong, Exp CLong)
quotRem   = Exp CLong -> Exp CLong -> (Exp CLong, Exp CLong)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkQuotRem
  divMod :: Exp CLong -> Exp CLong -> (Exp CLong, Exp CLong)
divMod    = Exp CLong -> Exp CLong -> (Exp CLong, Exp CLong)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkDivMod
  toInteger :: Exp CLong -> Integer
toInteger = [Char] -> Exp CLong -> Integer
forall a. HasCallStack => [Char] -> a
error [Char]
"Prelude.toInteger not supported for Accelerate types"

instance P.Integral (Exp CULong) where
  quot :: Exp CULong -> Exp CULong -> Exp CULong
quot      = Exp CULong -> Exp CULong -> Exp CULong
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkQuot
  rem :: Exp CULong -> Exp CULong -> Exp CULong
rem       = Exp CULong -> Exp CULong -> Exp CULong
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkRem
  div :: Exp CULong -> Exp CULong -> Exp CULong
div       = Exp CULong -> Exp CULong -> Exp CULong
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkIDiv
  mod :: Exp CULong -> Exp CULong -> Exp CULong
mod       = Exp CULong -> Exp CULong -> Exp CULong
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkMod
  quotRem :: Exp CULong -> Exp CULong -> (Exp CULong, Exp CULong)
quotRem   = Exp CULong -> Exp CULong -> (Exp CULong, Exp CULong)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkQuotRem
  divMod :: Exp CULong -> Exp CULong -> (Exp CULong, Exp CULong)
divMod    = Exp CULong -> Exp CULong -> (Exp CULong, Exp CULong)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkDivMod
  toInteger :: Exp CULong -> Integer
toInteger = [Char] -> Exp CULong -> Integer
forall a. HasCallStack => [Char] -> a
error [Char]
"Prelude.toInteger not supported for Accelerate types"

instance P.Integral (Exp CLLong) where
  quot :: Exp CLLong -> Exp CLLong -> Exp CLLong
quot      = Exp CLLong -> Exp CLLong -> Exp CLLong
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkQuot
  rem :: Exp CLLong -> Exp CLLong -> Exp CLLong
rem       = Exp CLLong -> Exp CLLong -> Exp CLLong
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkRem
  div :: Exp CLLong -> Exp CLLong -> Exp CLLong
div       = Exp CLLong -> Exp CLLong -> Exp CLLong
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkIDiv
  mod :: Exp CLLong -> Exp CLLong -> Exp CLLong
mod       = Exp CLLong -> Exp CLLong -> Exp CLLong
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkMod
  quotRem :: Exp CLLong -> Exp CLLong -> (Exp CLLong, Exp CLLong)
quotRem   = Exp CLLong -> Exp CLLong -> (Exp CLLong, Exp CLLong)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkQuotRem
  divMod :: Exp CLLong -> Exp CLLong -> (Exp CLLong, Exp CLLong)
divMod    = Exp CLLong -> Exp CLLong -> (Exp CLLong, Exp CLLong)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkDivMod
  toInteger :: Exp CLLong -> Integer
toInteger = [Char] -> Exp CLLong -> Integer
forall a. HasCallStack => [Char] -> a
error [Char]
"Prelude.toInteger not supported for Accelerate types"

instance P.Integral (Exp CULLong) where
  quot :: Exp CULLong -> Exp CULLong -> Exp CULLong
quot      = Exp CULLong -> Exp CULLong -> Exp CULLong
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkQuot
  rem :: Exp CULLong -> Exp CULLong -> Exp CULLong
rem       = Exp CULLong -> Exp CULLong -> Exp CULLong
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkRem
  div :: Exp CULLong -> Exp CULLong -> Exp CULLong
div       = Exp CULLong -> Exp CULLong -> Exp CULLong
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkIDiv
  mod :: Exp CULLong -> Exp CULLong -> Exp CULLong
mod       = Exp CULLong -> Exp CULLong -> Exp CULLong
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkMod
  quotRem :: Exp CULLong -> Exp CULLong -> (Exp CULLong, Exp CULLong)
quotRem   = Exp CULLong -> Exp CULLong -> (Exp CULLong, Exp CULLong)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkQuotRem
  divMod :: Exp CULLong -> Exp CULLong -> (Exp CULLong, Exp CULLong)
divMod    = Exp CULLong -> Exp CULLong -> (Exp CULLong, Exp CULLong)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkDivMod
  toInteger :: Exp CULLong -> Integer
toInteger = [Char] -> Exp CULLong -> Integer
forall a. HasCallStack => [Char] -> a
error [Char]
"Prelude.toInteger not supported for Accelerate types"

instance P.Integral (Exp CShort) where
  quot :: Exp CShort -> Exp CShort -> Exp CShort
quot      = Exp CShort -> Exp CShort -> Exp CShort
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkQuot
  rem :: Exp CShort -> Exp CShort -> Exp CShort
rem       = Exp CShort -> Exp CShort -> Exp CShort
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkRem
  div :: Exp CShort -> Exp CShort -> Exp CShort
div       = Exp CShort -> Exp CShort -> Exp CShort
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkIDiv
  mod :: Exp CShort -> Exp CShort -> Exp CShort
mod       = Exp CShort -> Exp CShort -> Exp CShort
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkMod
  quotRem :: Exp CShort -> Exp CShort -> (Exp CShort, Exp CShort)
quotRem   = Exp CShort -> Exp CShort -> (Exp CShort, Exp CShort)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkQuotRem
  divMod :: Exp CShort -> Exp CShort -> (Exp CShort, Exp CShort)
divMod    = Exp CShort -> Exp CShort -> (Exp CShort, Exp CShort)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkDivMod
  toInteger :: Exp CShort -> Integer
toInteger = [Char] -> Exp CShort -> Integer
forall a. HasCallStack => [Char] -> a
error [Char]
"Prelude.toInteger not supported for Accelerate types"

instance P.Integral (Exp CUShort) where
  quot :: Exp CUShort -> Exp CUShort -> Exp CUShort
quot      = Exp CUShort -> Exp CUShort -> Exp CUShort
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkQuot
  rem :: Exp CUShort -> Exp CUShort -> Exp CUShort
rem       = Exp CUShort -> Exp CUShort -> Exp CUShort
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkRem
  div :: Exp CUShort -> Exp CUShort -> Exp CUShort
div       = Exp CUShort -> Exp CUShort -> Exp CUShort
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkIDiv
  mod :: Exp CUShort -> Exp CUShort -> Exp CUShort
mod       = Exp CUShort -> Exp CUShort -> Exp CUShort
forall t. (Elt t, IsIntegral (EltR t)) => Exp t -> Exp t -> Exp t
mkMod
  quotRem :: Exp CUShort -> Exp CUShort -> (Exp CUShort, Exp CUShort)
quotRem   = Exp CUShort -> Exp CUShort -> (Exp CUShort, Exp CUShort)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkQuotRem
  divMod :: Exp CUShort -> Exp CUShort -> (Exp CUShort, Exp CUShort)
divMod    = Exp CUShort -> Exp CUShort -> (Exp CUShort, Exp CUShort)
forall t.
(Elt t, IsIntegral (EltR t)) =>
Exp t -> Exp t -> (Exp t, Exp t)
mkDivMod
  toInteger :: Exp CUShort -> Integer
toInteger = [Char] -> Exp CUShort -> Integer
forall a. HasCallStack => [Char] -> a
error [Char]
"Prelude.toInteger not supported for Accelerate types"