{-# OPTIONS_GHC -Wno-orphans #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StandaloneDeriving #-}
module AERN2.MP.WithCurrentPrec.Limit
()
where
import MixedTypesNumPrelude
import GHC.TypeLits
import AERN2.MP.Ball
import AERN2.Limit
import AERN2.MP.WithCurrentPrec.Type
instance
(HasLimits ix (CN MPBall -> CN MPBall)
, LimitType ix (CN MPBall -> CN MPBall) ~ (CN MPBall -> CN MPBall)
, KnownNat p)
=>
HasLimits ix (WithCurrentPrec p (CN MPBall))
where
type LimitType ix (WithCurrentPrec p (CN MPBall)) = WithCurrentPrec p (CN MPBall)
limit :: (ix -> WithCurrentPrec p (CN MPBall))
-> LimitType ix (WithCurrentPrec p (CN MPBall))
limit (ix -> WithCurrentPrec p (CN MPBall)
s :: ix -> (WithCurrentPrec p (CN MPBall))) =
CN MPBall -> WithCurrentPrec p (CN MPBall)
forall k (p :: k) t. t -> WithCurrentPrec p t
WithCurrentPrec (CN MPBall -> WithCurrentPrec p (CN MPBall))
-> CN MPBall -> WithCurrentPrec p (CN MPBall)
forall a b. (a -> b) -> a -> b
$ (ix -> CN MPBall -> CN MPBall)
-> LimitType ix (CN MPBall -> CN MPBall)
forall ix s. HasLimits ix s => (ix -> s) -> LimitType ix s
limit (ix -> CN MPBall -> CN MPBall
snop) (CN MPBall -> CN MPBall) -> CN MPBall -> CN MPBall
forall a b. (a -> b) -> a -> b
$ CN MPBall
sample
where
sample :: CN MPBall
sample :: CN MPBall
sample = Precision -> CN MPBall -> CN MPBall
forall t. CanSetPrecision t => Precision -> t -> t
setPrecision (WithCurrentPrec p MPBall -> Precision
forall (p :: Nat) t. KnownNat p => WithCurrentPrec p t -> Precision
getCurrentPrecision WithCurrentPrec p MPBall
sampleP) (MPBall -> CN MPBall
forall v. v -> CN v
cn (MPBall -> CN MPBall) -> MPBall -> CN MPBall
forall a b. (a -> b) -> a -> b
$ Integer -> MPBall
forall t. CanBeMPBall t => t -> MPBall
mpBall Integer
0)
sampleP :: WithCurrentPrec p MPBall
sampleP :: WithCurrentPrec p MPBall
sampleP = [Char] -> WithCurrentPrec p MPBall
forall a. HasCallStack => [Char] -> a
error [Char]
"sampleP is not defined, it is only a type proxy"
snop :: ix -> (CN MPBall -> CN MPBall)
snop :: ix -> CN MPBall -> CN MPBall
snop ix
ix CN MPBall
_sample = WithCurrentPrec p (CN MPBall) -> CN MPBall
forall k (p :: k) t. WithCurrentPrec p t -> t
unWithCurrentPrec (WithCurrentPrec p (CN MPBall) -> CN MPBall)
-> WithCurrentPrec p (CN MPBall) -> CN MPBall
forall a b. (a -> b) -> a -> b
$ ix -> WithCurrentPrec p (CN MPBall)
s ix
ix