    {-# LANGUAGE CPP #-}

    -- |
    -- Module      :  Linear.Vector.Compat
    -- Copyright   :  (c) 2024 diagrams-lib team (see LICENSE)
    -- License     :  BSD-style (see LICENSE)
    -- Maintainer  :  diagrams-discuss@googlegroups.com
    --
    -- Compatibility layer for working with versions of linear both before
    -- (< 1.23) and after (>= 1.23) the interpolation direction of `lerp`
    -- was reversed.
    module Linear.Vector.Compat (lerp) where

    import qualified Linear.Vector as V

    -- | Linearly interpolate between two vectors, such that @lerp 0 x y =
    --   x@ and @lerp 1 x y = 1@.
    lerp :: (V.Additive f, Num a) => a -> f a -> f a -> f a
    lerp :: forall (f :: * -> *) a.
    (Additive f, Num a) =>
    a -> f a -> f a -> f a
    lerp =
    #if MIN_VERSION_linear(1,23,0)
      V.lerp
    #else
      a -> f a -> f a -> f a
    forall a. Num a => a -> f a -> f a -> f a
    forall (f :: * -> *) a.
    (Additive f, Num a) =>
    a -> f a -> f a -> f a
    V.lerp (a -> f a -> f a -> f a) -> (a -> a) -> a -> f a -> f a -> f a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (a
    1a -> a -> a
    forall a. Num a => a -> a -> a
    -)
    #endif