<commit_before>{-# LANGUAGE Rank2Types #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  Numeric.AD.Types
-- Copyright   :  (c) <NAME> 2010-12
-- License     :  BSD3
-- Maintainer  :  <EMAIL>
-- Stability   :  experimental
-- Portability :  GHC only
--
-----------------------------------------------------------------------------
module Numeric.AD.Types
    (
    -- * AD modes
      Mode(..)
    -- * Jets
    , Jet(..)
    , headJet
    , tailJet
    , jet
    -- * Apply functions that use 'lift'
    , lowerUU, lowerUF, lowerFU, lowerFF
    ) where

import Numeric.AD.Internal.Identity
import Numeric.AD.Internal.Jet
import Numeric.AD.Internal.Classes

-- | Evaluate a scalar-to-scalar function in the trivial identity AD mode.
lowerUU :: (forall s. Id a s -> Id a s) -> a -> a
lowerUU f = unprobe . f . probe
{-# INLINE lowerUU #-}

-- | Evaluate a scalar-to-nonscalar function in the trivial identity AD mode.
lowerUF :: Functor f => (forall s. Id a s -> f (Id a s)) -> a -> f a
lowerUF f = unprobed . f . probe
{-# INLINE lowerUF #-}

-- | Evaluate a nonscalar-to-scalar function in the trivial identity AD mode.
lowerFU :: Functor f => (forall s. f (Id a s) -> Id a s) -> f a -> a
lowerFU f = unprobe . f . probed
{-# INLINE lowerFU #-}

-- | Evaluate a nonscalar-to-nonscalar function in the trivial identity AD mode.
lowerFF :: (Functor f, Functor g) => (forall s. f (Id a s) -> g (Id a s)) -> f a -> g a
lowerFF f = unprobed . f . probed
{-# INLINE lowerFF #-}
<commit_msg>2-space and copyright for Types<commit_after>{-# LANGUAGE Rank2Types #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  Numeric.AD.Types
-- Copyright   :  (c) <NAME> 2010-2014
-- License     :  BSD3
-- Maintainer  :  <EMAIL>
-- Stability   :  experimental
-- Portability :  GHC only
--
-----------------------------------------------------------------------------
module Numeric.AD.Types
  (
  -- * AD modes
    Mode(..)
  -- * Jets
  , Jet(..)
  , headJet
  , tailJet
  , jet
  -- * Apply functions that use 'lift'
  , lowerUU, lowerUF, lowerFU, lowerFF
  ) where

import Numeric.AD.Internal.Identity
import Numeric.AD.Internal.Jet
import Numeric.AD.Internal.Classes

-- | Evaluate a scalar-to-scalar function in the trivial identity AD mode.
lowerUU :: (forall s. Id a s -> Id a s) -> a -> a
lowerUU f = unprobe . f . probe
{-# INLINE lowerUU #-}

-- | Evaluate a scalar-to-nonscalar function in the trivial identity AD mode.
lowerUF :: Functor f => (forall s. Id a s -> f (Id a s)) -> a -> f a
lowerUF f = unprobed . f . probe
{-# INLINE lowerUF #-}

-- | Evaluate a nonscalar-to-scalar function in the trivial identity AD mode.
lowerFU :: Functor f => (forall s. f (Id a s) -> Id a s) -> f a -> a
lowerFU f = unprobe . f . probed
{-# INLINE lowerFU #-}

-- | Evaluate a nonscalar-to-nonscalar function in the trivial identity AD mode.
lowerFF :: (Functor f, Functor g) => (forall s. f (Id a s) -> g (Id a s)) -> f a -> g a
lowerFF f = unprobed . f . probed
{-# INLINE lowerFF #-}

{'fraction_non_alphanumeric': 0.23164392462638075, 'fraction_numerical': 0.006172839506172839, 'mean_word_length': 1.7442067736185383, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2724165', 'n_tokens_mistral': 1027, 'n_tokens_neox': 996, 'n_words': 348}