{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_HADDOCK not-home #-}

-----------------------------------------------------------------------------
-- |
-- Copyright   :  (c) Edward Kmett 2010-2021
-- License     :  BSD3
-- Maintainer  :  ekmett@gmail.com
-- Stability   :  experimental
-- Portability :  GHC only
--
-----------------------------------------------------------------------------
module Numeric.AD.Internal.Identity
  ( Id(..)
  , probe
  , unprobe
  , probed
  , unprobed
  ) where

import Data.Data (Data)
#if !(MIN_VERSION_base(4,11,0))
import Data.Semigroup (Semigroup(..))
#endif
import Data.Number.Erf
import Data.Typeable (Typeable)
import Numeric.AD.Mode

newtype Id a = Id { forall a. Id a -> a
runId :: a } deriving
  ( Id a -> Id a -> Bool
(Id a -> Id a -> Bool) -> (Id a -> Id a -> Bool) -> Eq (Id a)
forall a. Eq a => Id a -> Id a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall a. Eq a => Id a -> Id a -> Bool
== :: Id a -> Id a -> Bool
$c/= :: forall a. Eq a => Id a -> Id a -> Bool
/= :: Id a -> Id a -> Bool
Eq, Eq (Id a)
Eq (Id a) =>
(Id a -> Id a -> Ordering)
-> (Id a -> Id a -> Bool)
-> (Id a -> Id a -> Bool)
-> (Id a -> Id a -> Bool)
-> (Id a -> Id a -> Bool)
-> (Id a -> Id a -> Id a)
-> (Id a -> Id a -> Id a)
-> Ord (Id a)
Id a -> Id a -> Bool
Id a -> Id a -> Ordering
Id a -> Id a -> Id a
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Ord a => Eq (Id a)
forall a. Ord a => Id a -> Id a -> Bool
forall a. Ord a => Id a -> Id a -> Ordering
forall a. Ord a => Id a -> Id a -> Id a
$ccompare :: forall a. Ord a => Id a -> Id a -> Ordering
compare :: Id a -> Id a -> Ordering
$c< :: forall a. Ord a => Id a -> Id a -> Bool
< :: Id a -> Id a -> Bool
$c<= :: forall a. Ord a => Id a -> Id a -> Bool
<= :: Id a -> Id a -> Bool
$c> :: forall a. Ord a => Id a -> Id a -> Bool
> :: Id a -> Id a -> Bool
$c>= :: forall a. Ord a => Id a -> Id a -> Bool
>= :: Id a -> Id a -> Bool
$cmax :: forall a. Ord a => Id a -> Id a -> Id a
max :: Id a -> Id a -> Id a
$cmin :: forall a. Ord a => Id a -> Id a -> Id a
min :: Id a -> Id a -> Id a
Ord, Int -> Id a -> ShowS
[Id a] -> ShowS
Id a -> String
(Int -> Id a -> ShowS)
-> (Id a -> String) -> ([Id a] -> ShowS) -> Show (Id a)
forall a. Show a => Int -> Id a -> ShowS
forall a. Show a => [Id a] -> ShowS
forall a. Show a => Id a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Show a => Int -> Id a -> ShowS
showsPrec :: Int -> Id a -> ShowS
$cshow :: forall a. Show a => Id a -> String
show :: Id a -> String
$cshowList :: forall a. Show a => [Id a] -> ShowS
showList :: [Id a] -> ShowS
Show, Int -> Id a
Id a -> Int
Id a -> [Id a]
Id a -> Id a
Id a -> Id a -> [Id a]
Id a -> Id a -> Id a -> [Id a]
(Id a -> Id a)
-> (Id a -> Id a)
-> (Int -> Id a)
-> (Id a -> Int)
-> (Id a -> [Id a])
-> (Id a -> Id a -> [Id a])
-> (Id a -> Id a -> [Id a])
-> (Id a -> Id a -> Id a -> [Id a])
-> Enum (Id a)
forall a. Enum a => Int -> Id a
forall a. Enum a => Id a -> Int
forall a. Enum a => Id a -> [Id a]
forall a. Enum a => Id a -> Id a
forall a. Enum a => Id a -> Id a -> [Id a]
forall a. Enum a => Id a -> Id a -> Id a -> [Id a]
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: forall a. Enum a => Id a -> Id a
succ :: Id a -> Id a
$cpred :: forall a. Enum a => Id a -> Id a
pred :: Id a -> Id a
$ctoEnum :: forall a. Enum a => Int -> Id a
toEnum :: Int -> Id a
$cfromEnum :: forall a. Enum a => Id a -> Int
fromEnum :: Id a -> Int
$cenumFrom :: forall a. Enum a => Id a -> [Id a]
enumFrom :: Id a -> [Id a]
$cenumFromThen :: forall a. Enum a => Id a -> Id a -> [Id a]
enumFromThen :: Id a -> Id a -> [Id a]
$cenumFromTo :: forall a. Enum a => Id a -> Id a -> [Id a]
enumFromTo :: Id a -> Id a -> [Id a]
$cenumFromThenTo :: forall a. Enum a => Id a -> Id a -> Id a -> [Id a]
enumFromThenTo :: Id a -> Id a -> Id a -> [Id a]
Enum, Id a
Id a -> Id a -> Bounded (Id a)
forall a. a -> a -> Bounded a
forall a. Bounded a => Id a
$cminBound :: forall a. Bounded a => Id a
minBound :: Id a
$cmaxBound :: forall a. Bounded a => Id a
maxBound :: Id a
Bounded
  , Integer -> Id a
Id a -> Id a
Id a -> Id a -> Id a
(Id a -> Id a -> Id a)
-> (Id a -> Id a -> Id a)
-> (Id a -> Id a -> Id a)
-> (Id a -> Id a)
-> (Id a -> Id a)
-> (Id a -> Id a)
-> (Integer -> Id a)
-> Num (Id a)
forall a. Num a => Integer -> Id a
forall a. Num a => Id a -> Id a
forall a. Num a => Id a -> Id a -> Id a
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
$c+ :: forall a. Num a => Id a -> Id a -> Id a
+ :: Id a -> Id a -> Id a
$c- :: forall a. Num a => Id a -> Id a -> Id a
- :: Id a -> Id a -> Id a
$c* :: forall a. Num a => Id a -> Id a -> Id a
* :: Id a -> Id a -> Id a
$cnegate :: forall a. Num a => Id a -> Id a
negate :: Id a -> Id a
$cabs :: forall a. Num a => Id a -> Id a
abs :: Id a -> Id a
$csignum :: forall a. Num a => Id a -> Id a
signum :: Id a -> Id a
$cfromInteger :: forall a. Num a => Integer -> Id a
fromInteger :: Integer -> Id a
Num, Num (Id a)
Ord (Id a)
(Num (Id a), Ord (Id a)) => (Id a -> Rational) -> Real (Id a)
Id a -> Rational
forall a. (Num a, Ord a) => (a -> Rational) -> Real a
forall a. Real a => Num (Id a)
forall a. Real a => Ord (Id a)
forall a. Real a => Id a -> Rational
$ctoRational :: forall a. Real a => Id a -> Rational
toRational :: Id a -> Rational
Real, Num (Id a)
Num (Id a) =>
(Id a -> Id a -> Id a)
-> (Id a -> Id a) -> (Rational -> Id a) -> Fractional (Id a)
Rational -> Id a
Id a -> Id a
Id a -> Id a -> Id a
forall a. Fractional a => Num (Id a)
forall a. Fractional a => Rational -> Id a
forall a. Fractional a => Id a -> Id a
forall a. Fractional a => Id a -> Id a -> Id a
forall a.
Num a =>
(a -> a -> a) -> (a -> a) -> (Rational -> a) -> Fractional a
$c/ :: forall a. Fractional a => Id a -> Id a -> Id a
/ :: Id a -> Id a -> Id a
$crecip :: forall a. Fractional a => Id a -> Id a
recip :: Id a -> Id a
$cfromRational :: forall a. Fractional a => Rational -> Id a
fromRational :: Rational -> Id a
Fractional, Fractional (Id a)
Id a
Fractional (Id a) =>
Id a
-> (Id a -> Id a)
-> (Id a -> Id a)
-> (Id a -> Id a)
-> (Id a -> Id a -> Id a)
-> (Id a -> Id a -> Id a)
-> (Id a -> Id a)
-> (Id a -> Id a)
-> (Id a -> Id a)
-> (Id a -> Id a)
-> (Id a -> Id a)
-> (Id a -> Id a)
-> (Id a -> Id a)
-> (Id a -> Id a)
-> (Id a -> Id a)
-> (Id a -> Id a)
-> (Id a -> Id a)
-> (Id a -> Id a)
-> (Id a -> Id a)
-> (Id a -> Id a)
-> (Id a -> Id a)
-> (Id a -> Id a)
-> Floating (Id a)
Id a -> Id a
Id a -> Id a -> Id a
forall a. Floating a => Fractional (Id a)
forall a. Floating a => Id a
forall a. Floating a => Id a -> Id a
forall a. Floating a => Id a -> Id a -> Id a
forall a.
Fractional a =>
a
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> Floating a
$cpi :: forall a. Floating a => Id a
pi :: Id a
$cexp :: forall a. Floating a => Id a -> Id a
exp :: Id a -> Id a
$clog :: forall a. Floating a => Id a -> Id a
log :: Id a -> Id a
$csqrt :: forall a. Floating a => Id a -> Id a
sqrt :: Id a -> Id a
$c** :: forall a. Floating a => Id a -> Id a -> Id a
** :: Id a -> Id a -> Id a
$clogBase :: forall a. Floating a => Id a -> Id a -> Id a
logBase :: Id a -> Id a -> Id a
$csin :: forall a. Floating a => Id a -> Id a
sin :: Id a -> Id a
$ccos :: forall a. Floating a => Id a -> Id a
cos :: Id a -> Id a
$ctan :: forall a. Floating a => Id a -> Id a
tan :: Id a -> Id a
$casin :: forall a. Floating a => Id a -> Id a
asin :: Id a -> Id a
$cacos :: forall a. Floating a => Id a -> Id a
acos :: Id a -> Id a
$catan :: forall a. Floating a => Id a -> Id a
atan :: Id a -> Id a
$csinh :: forall a. Floating a => Id a -> Id a
sinh :: Id a -> Id a
$ccosh :: forall a. Floating a => Id a -> Id a
cosh :: Id a -> Id a
$ctanh :: forall a. Floating a => Id a -> Id a
tanh :: Id a -> Id a
$casinh :: forall a. Floating a => Id a -> Id a
asinh :: Id a -> Id a
$cacosh :: forall a. Floating a => Id a -> Id a
acosh :: Id a -> Id a
$catanh :: forall a. Floating a => Id a -> Id a
atanh :: Id a -> Id a
$clog1p :: forall a. Floating a => Id a -> Id a
log1p :: Id a -> Id a
$cexpm1 :: forall a. Floating a => Id a -> Id a
expm1 :: Id a -> Id a
$clog1pexp :: forall a. Floating a => Id a -> Id a
log1pexp :: Id a -> Id a
$clog1mexp :: forall a. Floating a => Id a -> Id a
log1mexp :: Id a -> Id a
Floating
  , Fractional (Id a)
Real (Id a)
(Real (Id a), Fractional (Id a)) =>
(forall b. Integral b => Id a -> (b, Id a))
-> (forall b. Integral b => Id a -> b)
-> (forall b. Integral b => Id a -> b)
-> (forall b. Integral b => Id a -> b)
-> (forall b. Integral b => Id a -> b)
-> RealFrac (Id a)
forall b. Integral b => Id a -> b
forall b. Integral b => Id a -> (b, Id a)
forall a.
(Real a, Fractional a) =>
(forall b. Integral b => a -> (b, a))
-> (forall b. Integral b => a -> b)
-> (forall b. Integral b => a -> b)
-> (forall b. Integral b => a -> b)
-> (forall b. Integral b => a -> b)
-> RealFrac a
forall a. RealFrac a => Fractional (Id a)
forall a. RealFrac a => Real (Id a)
forall a b. (RealFrac a, Integral b) => Id a -> b
forall a b. (RealFrac a, Integral b) => Id a -> (b, Id a)
$cproperFraction :: forall a b. (RealFrac a, Integral b) => Id a -> (b, Id a)
properFraction :: forall b. Integral b => Id a -> (b, Id a)
$ctruncate :: forall a b. (RealFrac a, Integral b) => Id a -> b
truncate :: forall b. Integral b => Id a -> b
$cround :: forall a b. (RealFrac a, Integral b) => Id a -> b
round :: forall b. Integral b => Id a -> b
$cceiling :: forall a b. (RealFrac a, Integral b) => Id a -> b
ceiling :: forall b. Integral b => Id a -> b
$cfloor :: forall a b. (RealFrac a, Integral b) => Id a -> b
floor :: forall b. Integral b => Id a -> b
RealFrac, Floating (Id a)
RealFrac (Id a)
(RealFrac (Id a), Floating (Id a)) =>
(Id a -> Integer)
-> (Id a -> Int)
-> (Id a -> (Int, Int))
-> (Id a -> (Integer, Int))
-> (Integer -> Int -> Id a)
-> (Id a -> Int)
-> (Id a -> Id a)
-> (Int -> Id a -> Id a)
-> (Id a -> Bool)
-> (Id a -> Bool)
-> (Id a -> Bool)
-> (Id a -> Bool)
-> (Id a -> Bool)
-> (Id a -> Id a -> Id a)
-> RealFloat (Id a)
Int -> Id a -> Id a
Integer -> Int -> Id a
Id a -> Bool
Id a -> Int
Id a -> Integer
Id a -> (Int, Int)
Id a -> (Integer, Int)
Id a -> Id a
Id a -> Id a -> Id a
forall a. RealFloat a => Floating (Id a)
forall a. RealFloat a => RealFrac (Id a)
forall a. RealFloat a => Int -> Id a -> Id a
forall a. RealFloat a => Integer -> Int -> Id a
forall a. RealFloat a => Id a -> Bool
forall a. RealFloat a => Id a -> Int
forall a. RealFloat a => Id a -> Integer
forall a. RealFloat a => Id a -> (Int, Int)
forall a. RealFloat a => Id a -> (Integer, Int)
forall a. RealFloat a => Id a -> Id a
forall a. RealFloat a => Id a -> Id a -> Id a
forall a.
(RealFrac a, Floating a) =>
(a -> Integer)
-> (a -> Int)
-> (a -> (Int, Int))
-> (a -> (Integer, Int))
-> (Integer -> Int -> a)
-> (a -> Int)
-> (a -> a)
-> (Int -> a -> a)
-> (a -> Bool)
-> (a -> Bool)
-> (a -> Bool)
-> (a -> Bool)
-> (a -> Bool)
-> (a -> a -> a)
-> RealFloat a
$cfloatRadix :: forall a. RealFloat a => Id a -> Integer
floatRadix :: Id a -> Integer
$cfloatDigits :: forall a. RealFloat a => Id a -> Int
floatDigits :: Id a -> Int
$cfloatRange :: forall a. RealFloat a => Id a -> (Int, Int)
floatRange :: Id a -> (Int, Int)
$cdecodeFloat :: forall a. RealFloat a => Id a -> (Integer, Int)
decodeFloat :: Id a -> (Integer, Int)
$cencodeFloat :: forall a. RealFloat a => Integer -> Int -> Id a
encodeFloat :: Integer -> Int -> Id a
$cexponent :: forall a. RealFloat a => Id a -> Int
exponent :: Id a -> Int
$csignificand :: forall a. RealFloat a => Id a -> Id a
significand :: Id a -> Id a
$cscaleFloat :: forall a. RealFloat a => Int -> Id a -> Id a
scaleFloat :: Int -> Id a -> Id a
$cisNaN :: forall a. RealFloat a => Id a -> Bool
isNaN :: Id a -> Bool
$cisInfinite :: forall a. RealFloat a => Id a -> Bool
isInfinite :: Id a -> Bool
$cisDenormalized :: forall a. RealFloat a => Id a -> Bool
isDenormalized :: Id a -> Bool
$cisNegativeZero :: forall a. RealFloat a => Id a -> Bool
isNegativeZero :: Id a -> Bool
$cisIEEE :: forall a. RealFloat a => Id a -> Bool
isIEEE :: Id a -> Bool
$catan2 :: forall a. RealFloat a => Id a -> Id a -> Id a
atan2 :: Id a -> Id a -> Id a
RealFloat, NonEmpty (Id a) -> Id a
Id a -> Id a -> Id a
(Id a -> Id a -> Id a)
-> (NonEmpty (Id a) -> Id a)
-> (forall b. Integral b => b -> Id a -> Id a)
-> Semigroup (Id a)
forall b. Integral b => b -> Id a -> Id a
forall a. Semigroup a => NonEmpty (Id a) -> Id a
forall a. Semigroup a => Id a -> Id a -> Id a
forall a b. (Semigroup a, Integral b) => b -> Id a -> Id a
forall a.
(a -> a -> a)
-> (NonEmpty a -> a)
-> (forall b. Integral b => b -> a -> a)
-> Semigroup a
$c<> :: forall a. Semigroup a => Id a -> Id a -> Id a
<> :: Id a -> Id a -> Id a
$csconcat :: forall a. Semigroup a => NonEmpty (Id a) -> Id a
sconcat :: NonEmpty (Id a) -> Id a
$cstimes :: forall a b. (Semigroup a, Integral b) => b -> Id a -> Id a
stimes :: forall b. Integral b => b -> Id a -> Id a
Semigroup
  , Semigroup (Id a)
Id a
Semigroup (Id a) =>
Id a -> (Id a -> Id a -> Id a) -> ([Id a] -> Id a) -> Monoid (Id a)
[Id a] -> Id a
Id a -> Id a -> Id a
forall a.
Semigroup a =>
a -> (a -> a -> a) -> ([a] -> a) -> Monoid a
forall a. Monoid a => Semigroup (Id a)
forall a. Monoid a => Id a
forall a. Monoid a => [Id a] -> Id a
forall a. Monoid a => Id a -> Id a -> Id a
$cmempty :: forall a. Monoid a => Id a
mempty :: Id a
$cmappend :: forall a. Monoid a => Id a -> Id a -> Id a
mappend :: Id a -> Id a -> Id a
$cmconcat :: forall a. Monoid a => [Id a] -> Id a
mconcat :: [Id a] -> Id a
Monoid, Typeable (Id a)
Typeable (Id a) =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Id a -> c (Id a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Id a))
-> (Id a -> Constr)
-> (Id a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Id a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Id a)))
-> ((forall b. Data b => b -> b) -> Id a -> Id a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Id a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Id a -> r)
-> (forall u. (forall d. Data d => d -> u) -> Id a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Id a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Id a -> m (Id a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Id a -> m (Id a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Id a -> m (Id a))
-> Data (Id a)
Id a -> Constr
Id a -> DataType
(forall b. Data b => b -> b) -> Id a -> Id a
forall a. Data a => Typeable (Id a)
forall a. Data a => Id a -> Constr
forall a. Data a => Id a -> DataType
forall a. Data a => (forall b. Data b => b -> b) -> Id a -> Id a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Id a -> u
forall a u. Data a => (forall d. Data d => d -> u) -> Id a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Id a -> r
forall a r r'.
Data a =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Id a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Id a -> m (Id a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Id a -> m (Id a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Id a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Id a -> c (Id a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Id a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Id a))
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Id a -> u
forall u. (forall d. Data d => d -> u) -> Id a -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Id a -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Id a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Id a -> m (Id a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Id a -> m (Id a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Id a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Id a -> c (Id a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Id a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Id a))
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Id a -> c (Id a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Id a -> c (Id a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Id a)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Id a)
$ctoConstr :: forall a. Data a => Id a -> Constr
toConstr :: Id a -> Constr
$cdataTypeOf :: forall a. Data a => Id a -> DataType
dataTypeOf :: Id a -> DataType
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Id a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Id a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Id a))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Id a))
$cgmapT :: forall a. Data a => (forall b. Data b => b -> b) -> Id a -> Id a
gmapT :: (forall b. Data b => b -> b) -> Id a -> Id a
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Id a -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Id a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Id a -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Id a -> r
$cgmapQ :: forall a u. Data a => (forall d. Data d => d -> u) -> Id a -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Id a -> [u]
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Id a -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Id a -> u
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Id a -> m (Id a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Id a -> m (Id a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Id a -> m (Id a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Id a -> m (Id a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Id a -> m (Id a)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Id a -> m (Id a)
Data, Typeable, Floating (Id a)
Floating (Id a) =>
(Id a -> Id a)
-> (Id a -> Id a) -> (Id a -> Id a) -> (Id a -> Id a) -> Erf (Id a)
Id a -> Id a
forall a.
Floating a =>
(a -> a) -> (a -> a) -> (a -> a) -> (a -> a) -> Erf a
forall a. Erf a => Floating (Id a)
forall a. Erf a => Id a -> Id a
$cerf :: forall a. Erf a => Id a -> Id a
erf :: Id a -> Id a
$cerfc :: forall a. Erf a => Id a -> Id a
erfc :: Id a -> Id a
$cerfcx :: forall a. Erf a => Id a -> Id a
erfcx :: Id a -> Id a
$cnormcdf :: forall a. Erf a => Id a -> Id a
normcdf :: Id a -> Id a
Erf, Floating (Id a)
Floating (Id a) =>
(Id a -> Id a) -> (Id a -> Id a) -> (Id a -> Id a) -> InvErf (Id a)
Id a -> Id a
forall a.
Floating a =>
(a -> a) -> (a -> a) -> (a -> a) -> InvErf a
forall a. InvErf a => Floating (Id a)
forall a. InvErf a => Id a -> Id a
$cinverf :: forall a. InvErf a => Id a -> Id a
inverf :: Id a -> Id a
$cinverfc :: forall a. InvErf a => Id a -> Id a
inverfc :: Id a -> Id a
$cinvnormcdf :: forall a. InvErf a => Id a -> Id a
invnormcdf :: Id a -> Id a
InvErf
  )

probe :: a -> Id a
probe :: forall a. a -> Id a
probe = a -> Id a
forall a. a -> Id a
Id

unprobe :: Id a -> a
unprobe :: forall a. Id a -> a
unprobe = Id a -> a
forall a. Id a -> a
runId

pid :: Functor f => f a -> f (Id a)
pid :: forall (f :: * -> *) a. Functor f => f a -> f (Id a)
pid = (a -> Id a) -> f a -> f (Id a)
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> Id a
forall a. a -> Id a
probe

unpid :: Functor f => f (Id a) -> f a
unpid :: forall (f :: * -> *) a. Functor f => f (Id a) -> f a
unpid = (Id a -> a) -> f (Id a) -> f a
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Id a -> a
forall a. Id a -> a
unprobe

probed :: Functor f => f a -> f (Id a)
probed :: forall (f :: * -> *) a. Functor f => f a -> f (Id a)
probed = f a -> f (Id a)
forall (f :: * -> *) a. Functor f => f a -> f (Id a)
pid

unprobed :: Functor f => f (Id a) -> f a
unprobed :: forall (f :: * -> *) a. Functor f => f (Id a) -> f a
unprobed = f (Id a) -> f a
forall (f :: * -> *) a. Functor f => f (Id a) -> f a
unpid

instance Num a => Mode (Id a) where
  type Scalar (Id a) = a
  auto :: Scalar (Id a) -> Id a
auto = a -> Id a
Scalar (Id a) -> Id a
forall a. a -> Id a
Id
  Id a
a ^* :: Id a -> Scalar (Id a) -> Id a
^* Scalar (Id a)
b = a -> Id a
forall a. a -> Id a
Id (a
a a -> a -> a
forall a. Num a => a -> a -> a
* a
Scalar (Id a)
b)
  Scalar (Id a)
a *^ :: Scalar (Id a) -> Id a -> Id a
*^ Id a
b = a -> Id a
forall a. a -> Id a
Id (a
Scalar (Id a)
a a -> a -> a
forall a. Num a => a -> a -> a
* a
b)