packages feed

document-build-0.2.0.0: src/Document/Build/Name/OutputGitDetails.hs

{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -Wall #-}

{- | The name @outputGitDetails@, targeting @'Maybe' 'Document.Build.GitDetails.GitDetails'@: the details of the last commit to change the source of an output file, if it is known.

Any value of the target type has the name, as the identity.

@since 0.2.0.0
-}
module Document.Build.Name.OutputGitDetails (
  OutputGitDetailsLike (..),
) where

import Control.Lens (Optic)
import Document.Build.GitDetails (GitDetails)

{- | A field or a constructor named @outputGitDetails@.

@since 0.2.0.0
-}
class OutputGitDetailsLike p f x x' where
  outputGitDetails ::
    Optic p f x x' (Maybe GitDetails) (Maybe GitDetails)

{- | Identity

@since 0.2.0.0
-}
instance (x' ~ Maybe GitDetails) => OutputGitDetailsLike p f (Maybe GitDetails) x' where
  outputGitDetails =
    id
  {-# INLINE outputGitDetails #-}