{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeApplications #-}

module Ema.Asset where

-- | The type of assets that can be bundled in a static site.
data Asset a
  = -- | A file that is copied as-is from the source directory.
    --
    -- Relative paths are assumed relative to the source directory. Absolute
    -- paths allow copying static files outside of source directory.
    AssetStatic FilePath
  | -- | A file whose contents are generated at runtime by user code.
    AssetGenerated Format a
  deriving (Asset a -> Asset a -> Bool
(Asset a -> Asset a -> Bool)
-> (Asset a -> Asset a -> Bool) -> Eq (Asset a)
forall a. Eq a => Asset a -> Asset a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Asset a -> Asset a -> Bool
$c/= :: forall a. Eq a => Asset a -> Asset a -> Bool
== :: Asset a -> Asset a -> Bool
$c== :: forall a. Eq a => Asset a -> Asset a -> Bool
Eq, Int -> Asset a -> ShowS
[Asset a] -> ShowS
Asset a -> String
(Int -> Asset a -> ShowS)
-> (Asset a -> String) -> ([Asset a] -> ShowS) -> Show (Asset a)
forall a. Show a => Int -> Asset a -> ShowS
forall a. Show a => [Asset a] -> ShowS
forall a. Show a => Asset a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Asset a] -> ShowS
$cshowList :: forall a. Show a => [Asset a] -> ShowS
show :: Asset a -> String
$cshow :: forall a. Show a => Asset a -> String
showsPrec :: Int -> Asset a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> Asset a -> ShowS
Show, Eq (Asset a)
Eq (Asset a)
-> (Asset a -> Asset a -> Ordering)
-> (Asset a -> Asset a -> Bool)
-> (Asset a -> Asset a -> Bool)
-> (Asset a -> Asset a -> Bool)
-> (Asset a -> Asset a -> Bool)
-> (Asset a -> Asset a -> Asset a)
-> (Asset a -> Asset a -> Asset a)
-> Ord (Asset a)
Asset a -> Asset a -> Bool
Asset a -> Asset a -> Ordering
Asset a -> Asset a -> Asset a
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Ord a => Eq (Asset a)
forall a. Ord a => Asset a -> Asset a -> Bool
forall a. Ord a => Asset a -> Asset a -> Ordering
forall a. Ord a => Asset a -> Asset a -> Asset a
min :: Asset a -> Asset a -> Asset a
$cmin :: forall a. Ord a => Asset a -> Asset a -> Asset a
max :: Asset a -> Asset a -> Asset a
$cmax :: forall a. Ord a => Asset a -> Asset a -> Asset a
>= :: Asset a -> Asset a -> Bool
$c>= :: forall a. Ord a => Asset a -> Asset a -> Bool
> :: Asset a -> Asset a -> Bool
$c> :: forall a. Ord a => Asset a -> Asset a -> Bool
<= :: Asset a -> Asset a -> Bool
$c<= :: forall a. Ord a => Asset a -> Asset a -> Bool
< :: Asset a -> Asset a -> Bool
$c< :: forall a. Ord a => Asset a -> Asset a -> Bool
compare :: Asset a -> Asset a -> Ordering
$ccompare :: forall a. Ord a => Asset a -> Asset a -> Ordering
$cp1Ord :: forall a. Ord a => Eq (Asset a)
Ord, (forall x. Asset a -> Rep (Asset a) x)
-> (forall x. Rep (Asset a) x -> Asset a) -> Generic (Asset a)
forall x. Rep (Asset a) x -> Asset a
forall x. Asset a -> Rep (Asset a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (Asset a) x -> Asset a
forall a x. Asset a -> Rep (Asset a) x
$cto :: forall a x. Rep (Asset a) x -> Asset a
$cfrom :: forall a x. Asset a -> Rep (Asset a) x
Generic)

data Format = Html | Other
  deriving (Format -> Format -> Bool
(Format -> Format -> Bool)
-> (Format -> Format -> Bool) -> Eq Format
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Format -> Format -> Bool
$c/= :: Format -> Format -> Bool
== :: Format -> Format -> Bool
$c== :: Format -> Format -> Bool
Eq, Int -> Format -> ShowS
[Format] -> ShowS
Format -> String
(Int -> Format -> ShowS)
-> (Format -> String) -> ([Format] -> ShowS) -> Show Format
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Format] -> ShowS
$cshowList :: [Format] -> ShowS
show :: Format -> String
$cshow :: Format -> String
showsPrec :: Int -> Format -> ShowS
$cshowsPrec :: Int -> Format -> ShowS
Show, Eq Format
Eq Format
-> (Format -> Format -> Ordering)
-> (Format -> Format -> Bool)
-> (Format -> Format -> Bool)
-> (Format -> Format -> Bool)
-> (Format -> Format -> Bool)
-> (Format -> Format -> Format)
-> (Format -> Format -> Format)
-> Ord Format
Format -> Format -> Bool
Format -> Format -> Ordering
Format -> Format -> Format
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Format -> Format -> Format
$cmin :: Format -> Format -> Format
max :: Format -> Format -> Format
$cmax :: Format -> Format -> Format
>= :: Format -> Format -> Bool
$c>= :: Format -> Format -> Bool
> :: Format -> Format -> Bool
$c> :: Format -> Format -> Bool
<= :: Format -> Format -> Bool
$c<= :: Format -> Format -> Bool
< :: Format -> Format -> Bool
$c< :: Format -> Format -> Bool
compare :: Format -> Format -> Ordering
$ccompare :: Format -> Format -> Ordering
$cp1Ord :: Eq Format
Ord, (forall x. Format -> Rep Format x)
-> (forall x. Rep Format x -> Format) -> Generic Format
forall x. Rep Format x -> Format
forall x. Format -> Rep Format x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Format x -> Format
$cfrom :: forall x. Format -> Rep Format x
Generic)