packages feed

filepather-0.8.0.0: src/System/FilePather/Name/File.hs

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

{- | The name @file@, targeting 'FilePath': a file that something is about, such as the file that a step would make again.

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

@since 0.8.0.0
-}
module System.FilePather.Name.File (
  FileLike (..),
) where

import Control.Lens (Optic)

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

@since 0.8.0.0
-}
class FileLike p f x x' where
  file ::
    Optic p f x x' FilePath FilePath

{- | Identity

@since 0.8.0.0
-}
instance (x' ~ FilePath) => FileLike p f FilePath x' where
  file =
    id
  {-# INLINE file #-}