packages feed

dhscanner-ast 1.1.2 → 1.1.3

raw patch · 2 files changed

+12/−2 lines, 2 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

+ Ast: ImportLocal :: ImportLocalContent -> ImportSource
+ Ast: ImportLocalContent :: FilePath -> ImportLocalContent
+ Ast: ImportThirdParty :: ImportThirdPartyContent -> ImportSource
+ Ast: ImportThirdPartyContent :: String -> ImportThirdPartyContent
+ Ast: data ImportSource
+ Ast: instance Data.Aeson.Types.FromJSON.FromJSON Ast.ImportLocalContent
+ Ast: instance Data.Aeson.Types.FromJSON.FromJSON Ast.ImportSource
+ Ast: instance Data.Aeson.Types.FromJSON.FromJSON Ast.ImportThirdPartyContent
+ Ast: instance Data.Aeson.Types.ToJSON.ToJSON Ast.ImportLocalContent
+ Ast: instance Data.Aeson.Types.ToJSON.ToJSON Ast.ImportSource
+ Ast: instance Data.Aeson.Types.ToJSON.ToJSON Ast.ImportThirdPartyContent
+ Ast: instance GHC.Classes.Eq Ast.ImportLocalContent
+ Ast: instance GHC.Classes.Eq Ast.ImportSource
+ Ast: instance GHC.Classes.Eq Ast.ImportThirdPartyContent
+ Ast: instance GHC.Classes.Ord Ast.ImportLocalContent
+ Ast: instance GHC.Classes.Ord Ast.ImportSource
+ Ast: instance GHC.Classes.Ord Ast.ImportThirdPartyContent
+ Ast: instance GHC.Generics.Generic Ast.ImportLocalContent
+ Ast: instance GHC.Generics.Generic Ast.ImportSource
+ Ast: instance GHC.Generics.Generic Ast.ImportThirdPartyContent
+ Ast: instance GHC.Show.Show Ast.ImportLocalContent
+ Ast: instance GHC.Show.Show Ast.ImportSource
+ Ast: instance GHC.Show.Show Ast.ImportThirdPartyContent
+ Ast: newtype ImportLocalContent
+ Ast: newtype ImportThirdPartyContent
- Ast: StmtImportContent :: String -> Maybe String -> Maybe String -> Location -> StmtImportContent
+ Ast: StmtImportContent :: ImportSource -> Maybe String -> Maybe String -> Location -> StmtImportContent
- Ast: [stmtImportSource] :: StmtImportContent -> String
+ Ast: [stmtImportSource] :: StmtImportContent -> ImportSource

Files

dhscanner-ast.cabal view
@@ -22,7 +22,7 @@     and models both of them as plain sequential code blocks. Every file has exactly one ast that represents it.
     Non Haskell parogrammers note: The ast is /immutable/ (like everything else in Haskell ...)
 
-version:            1.1.2
+version:            1.1.3
 license:            GPL-3.0-only
 license-file:       LICENSE
 author:             OrenGitHub
src/Ast.hs view
@@ -353,12 +353,22 @@ data StmtImportContent
    = StmtImportContent
      {
-         stmtImportSource :: String,
+         stmtImportSource :: ImportSource,
          stmtImportFromSource :: Maybe String,
          stmtImportAlias :: Maybe String,
          stmtImportLocation :: Location
      }
      deriving ( Show, Eq, Ord, Generic, ToJSON, FromJSON )
+
+data ImportSource
+   = ImportLocal ImportLocalContent
+   | ImportThirdParty ImportThirdPartyContent
+   deriving ( Show, Eq, Ord, Generic, ToJSON, FromJSON )
+
+-- | Filename or directory
+newtype ImportLocalContent = ImportLocalContent FilePath deriving ( Show, Eq, Ord, Generic, ToJSON, FromJSON )
+
+newtype ImportThirdPartyContent = ImportThirdPartyContent String deriving ( Show, Eq, Ord, Generic, ToJSON, FromJSON )
 
 data StmtContinueContent
    = StmtContinueContent