{- |
Module: Agda.Unused

Definitions and interface for the 'Unused' type, which represents a collection
of unused Agda code structures.
-}
module Agda.Unused
  ( Unused(..)
  , UnusedItems(..)
  , UnusedOptions(..)
  ) where

import Agda.Unused.Types.Range
  (Range, RangeInfo)

import Data.Text
  (Text)

-- ## Types

-- | A collection of unused items and files.
data Unused
  = Unused
  { Unused -> [FilePath]
unusedFiles
    :: [FilePath]
  , Unused -> UnusedItems
unusedItems
    :: UnusedItems
  } deriving Int -> Unused -> ShowS
[Unused] -> ShowS
Unused -> FilePath
(Int -> Unused -> ShowS)
-> (Unused -> FilePath) -> ([Unused] -> ShowS) -> Show Unused
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
showList :: [Unused] -> ShowS
$cshowList :: [Unused] -> ShowS
show :: Unused -> FilePath
$cshow :: Unused -> FilePath
showsPrec :: Int -> Unused -> ShowS
$cshowsPrec :: Int -> Unused -> ShowS
Show

-- | A collection of unused items.
newtype UnusedItems
  = UnusedItems
  { UnusedItems -> [(Range, RangeInfo)]
unusedItemsList
    :: [(Range, RangeInfo)]
  } deriving Int -> UnusedItems -> ShowS
[UnusedItems] -> ShowS
UnusedItems -> FilePath
(Int -> UnusedItems -> ShowS)
-> (UnusedItems -> FilePath)
-> ([UnusedItems] -> ShowS)
-> Show UnusedItems
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
showList :: [UnusedItems] -> ShowS
$cshowList :: [UnusedItems] -> ShowS
show :: UnusedItems -> FilePath
$cshow :: UnusedItems -> FilePath
showsPrec :: Int -> UnusedItems -> ShowS
$cshowsPrec :: Int -> UnusedItems -> ShowS
Show

-- | Options required by check functions.
data UnusedOptions
  = UnusedOptions
  { UnusedOptions -> [FilePath]
unusedOptionsInclude
    :: [FilePath]
  , UnusedOptions -> [Text]
unusedOptionsLibraries
    :: [Text]
  , UnusedOptions -> Maybe FilePath
unusedOptionsLibrariesFile
    :: Maybe FilePath
  , UnusedOptions -> Bool
unusedOptionsUseLibraries
    :: Bool
  , UnusedOptions -> Bool
unusedOptionsUseDefaultLibraries
    :: Bool
  } deriving Int -> UnusedOptions -> ShowS
[UnusedOptions] -> ShowS
UnusedOptions -> FilePath
(Int -> UnusedOptions -> ShowS)
-> (UnusedOptions -> FilePath)
-> ([UnusedOptions] -> ShowS)
-> Show UnusedOptions
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
showList :: [UnusedOptions] -> ShowS
$cshowList :: [UnusedOptions] -> ShowS
show :: UnusedOptions -> FilePath
$cshow :: UnusedOptions -> FilePath
showsPrec :: Int -> UnusedOptions -> ShowS
$cshowsPrec :: Int -> UnusedOptions -> ShowS
Show