packages feed

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

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

{- | The name @targetComplete@, targeting @'Map' 'FilePath' 'System.FilePather.Trail.Trail'@: the constructor of the target of a build that is complete, with every file it knows.

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

@since 0.2.0.0
-}
module Document.Build.Name.TargetComplete (
  TargetCompleteLike (..),
) where

import Control.Lens (Optic)
import Data.Map (Map)
import System.FilePather.Trail (Trail)

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

@since 0.2.0.0
-}
class TargetCompleteLike p f x x' where
  targetComplete ::
    Optic p f x x' (Map FilePath Trail) (Map FilePath Trail)

{- | Identity

@since 0.2.0.0
-}
instance (x' ~ Map FilePath Trail) => TargetCompleteLike p f (Map FilePath Trail) x' where
  targetComplete =
    id
  {-# INLINE targetComplete #-}