1- {-# LANGUAGE DeriveGeneric #-}
2- {-# LANGUAGE OverloadedStrings #-}
3- {-# LANGUAGE RecordWildCards #-}
1+ {-# LANGUAGE DeriveDataTypeable #-}
2+ {-# LANGUAGE DeriveGeneric #-}
3+ {-# LANGUAGE OverloadedStrings #-}
4+ {-# LANGUAGE RecordWildCards #-}
45
56module Dhall.Syntax.Import
67 ( Directory (.. )
@@ -14,9 +15,11 @@ module Dhall.Syntax.Import
1415 , Scheme (.. )
1516 ) where
1617
18+ import Data.Data (Data )
1719import Data.Text (Text )
1820import Dhall.Src (Src (.. ))
1921import Dhall.Syntax.Expr (Expr (.. ))
22+ import Dhall.Syntax.Instances.Data ()
2023import Dhall.Syntax.Instances.Functor ()
2124import GHC.Generics (Generic )
2225
@@ -29,15 +32,15 @@ import qualified Dhall.Crypto
2932 @Directory { components = [ "baz", "bar", "foo" ] }@
3033-}
3134newtype Directory = Directory { components :: [Text ] }
32- deriving Generic
35+ deriving ( Data , Generic )
3336
3437{-| A `File` is a `directory` followed by one additional path component
3538 representing the `file` name
3639-}
3740data File = File
3841 { directory :: Directory
3942 , file :: Text
40- } deriving Generic
43+ } deriving ( Data , Generic )
4144
4245-- | The beginning of a file path which anchors subsequent path components
4346data FilePrefix
@@ -49,11 +52,11 @@ data FilePrefix
4952 -- ^ Path relative to @..@
5053 | Home
5154 -- ^ Path relative to @~@
52- deriving Generic
55+ deriving ( Data , Generic )
5356
5457-- | The URI scheme
5558data Scheme = HTTP | HTTPS
56- deriving Generic
59+ deriving ( Data , Generic )
5760
5861-- | This type stores all of the components of a remote import
5962data URL = URL
@@ -62,7 +65,7 @@ data URL = URL
6265 , path :: File
6366 , query :: Maybe Text
6467 , headers :: Maybe (Expr Src Import )
65- } deriving Generic
68+ } deriving ( Data , Generic )
6669
6770-- | The type of import (i.e. local vs. remote vs. environment)
6871data ImportType
@@ -73,23 +76,23 @@ data ImportType
7376 | Env Text
7477 -- ^ Environment variable
7578 | Missing
76- deriving Generic
79+ deriving ( Data , Generic )
7780
7881-- | How to interpret the import's contents (i.e. as Dhall code or raw text)
7982data ImportMode = Code | RawText | Location
80- deriving Generic
83+ deriving ( Data , Generic )
8184
8285-- | A `ImportType` extended with an optional hash for semantic integrity checks
8386data ImportHashed = ImportHashed
8487 { hash :: Maybe Dhall.Crypto. SHA256Digest
8588 , importType :: ImportType
86- } deriving Generic
89+ } deriving ( Data , Generic )
8790
8891-- | Reference to an external resource
8992data Import = Import
9093 { importHashed :: ImportHashed
9194 , importMode :: ImportMode
92- } deriving Generic
95+ } deriving ( Data , Generic )
9396
9497
9598
0 commit comments