packages feed

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

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

{- | The name @repeatable@, targeting @()@: the constructor of a step that may appear any number of times in a trail.

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

@since 0.8.0.0
-}
module System.FilePather.Name.Repeatable (
  RepeatableLike (..),
) where

import Control.Lens (Optic)

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

@since 0.8.0.0
-}
class RepeatableLike p f x x' where
  repeatable ::
    Optic p f x x' () ()

{- | Identity

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