module Agda.Unused.Types.Root
(
Root(..)
, Roots(..)
, fromList
) where
import Agda.Unused.Types.Name
(QName)
import Data.Either
(lefts, rights)
data Root
= Root
{ Root -> QName
rootFile
:: QName
, Root -> Maybe [QName]
rootNames
:: Maybe [QName]
} deriving Int -> Root -> ShowS
[Root] -> ShowS
Root -> String
(Int -> Root -> ShowS)
-> (Root -> String) -> ([Root] -> ShowS) -> Show Root
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Root] -> ShowS
$cshowList :: [Root] -> ShowS
show :: Root -> String
$cshow :: Root -> String
showsPrec :: Int -> Root -> ShowS
$cshowsPrec :: Int -> Root -> ShowS
Show
data Roots
= Roots
{ Roots -> [Root]
rootsCheck
:: [Root]
, Roots -> [QName]
rootsIgnore
:: [QName]
} deriving Int -> Roots -> ShowS
[Roots] -> ShowS
Roots -> String
(Int -> Roots -> ShowS)
-> (Roots -> String) -> ([Roots] -> ShowS) -> Show Roots
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Roots] -> ShowS
$cshowList :: [Roots] -> ShowS
show :: Roots -> String
$cshow :: Roots -> String
showsPrec :: Int -> Roots -> ShowS
$cshowsPrec :: Int -> Roots -> ShowS
Show
fromList
:: [Either QName Root]
-> Roots
fromList :: [Either QName Root] -> Roots
fromList rs :: [Either QName Root]
rs
= [Root] -> [QName] -> Roots
Roots ([Either QName Root] -> [Root]
forall a b. [Either a b] -> [b]
rights [Either QName Root]
rs) ([Either QName Root] -> [QName]
forall a b. [Either a b] -> [a]
lefts [Either QName Root]
rs)