{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MonoLocalBinds #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -fno-warn-missing-methods #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Data.Array.Accelerate.Classes.Real (
Real,
) where
import Data.Array.Accelerate.Smart
import Data.Array.Accelerate.Classes.Num
import Data.Array.Accelerate.Classes.Ord
import Prelude hiding ( Real, Num, Ord )
import qualified Prelude as P
type Real a = (Num a, Ord a, P.Real (Exp a))
instance (Num a, Ord a) => P.Real (Exp a) where
toRational :: Exp a -> Rational
toRational
= [Char] -> Exp a -> Rational
forall a. HasCallStack => [Char] -> a
error
([Char] -> Exp a -> Rational) -> [Char] -> Exp a -> Rational
forall a b. (a -> b) -> a -> b
$ [[Char]] -> [Char]
unlines [ [Char]
"Prelude.toRational is not supported for Accelerate types"
, [Char]
""
, [Char]
"These Prelude.Real instances are present only to fulfil superclass"
, [Char]
"constraints for subsequent classes in the standard Haskell numeric hierarchy."
]