packages feed

hs2ats 0.2.1.8 → 0.2.1.9

raw patch · 3 files changed

+20/−23 lines, 3 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Language.ATS.Generate: exec :: IO ()
- Language.ATS.Generate: instance GHC.Generics.Generic Language.ATS.Generate.Program
- Language.ATS.Generate: instance Options.Generic.ParseRecord Language.ATS.Generate.Program

Files

app/Main.hs view
@@ -1,6 +1,20 @@+{-# LANGUAGE DataKinds         #-}+{-# LANGUAGE DeriveAnyClass    #-}+{-# LANGUAGE DeriveGeneric     #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TypeOperators     #-}+ module Main where -import           Language.ATS.Generate (exec)+import           Language.ATS.Generate+import           Options.Generic +data Program = Program { src    :: FilePath <?> "Haskell source file"+                       , target :: FilePath <?> "ATS target"+                       , cpphs  :: Bool <?> "Use cpphs as a preprocessor"+                       } deriving (Generic, ParseRecord)+ main :: IO ()-main = exec+main = do+    x <- getRecord "Generate ATS types for Haskell source code" :: IO Program+    genATSTypes (unHelpful . src $ x) (unHelpful . target $ x) (unHelpful . cpphs $ x)
hs2ats.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: hs2ats-version: 0.2.1.8+version: 0.2.1.9 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2018 Vanessa McHale@@ -40,7 +40,6 @@         language-ats >=1.0.0.0,         casing -any,         microlens -any,-        optparse-generic -any,         ansi-wl-pprint -any,         composition-prelude -any,         deepseq -any,@@ -60,6 +59,7 @@     ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall     build-depends:         base -any,+        optparse-generic -any,         hs2ats -any          if flag(no-executable)
src/Language/ATS/Generate.hs view
@@ -1,13 +1,7 @@-{-# LANGUAGE DataKinds         #-}-{-# LANGUAGE DeriveAnyClass    #-}-{-# LANGUAGE DeriveGeneric     #-}-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE PatternSynonyms   #-}-{-# LANGUAGE TypeOperators     #-}+{-# LANGUAGE PatternSynonyms #-}  module Language.ATS.Generate-    ( exec-    , generateATS+    ( generateATS     , genATSTypes     , ErrM     ) where@@ -23,14 +17,8 @@ import           Language.Haskell.Exts.Syntax as HS import           Language.Preprocessor.Cpphs  (defaultCpphsOptions, runCpphs) import           Lens.Micro                   (over, _head)-import           Options.Generic import           Text.Casing                  (quietSnake) -data Program = Program { src    :: FilePath <?> "Haskell source file"-                       , target :: FilePath <?> "ATS target"-                       , cpphs  :: Bool <?> "Use cpphs as a preprocessor"-                       } deriving (Generic, ParseRecord)- convertConventions :: String -> String convertConventions = filterKeys . quietSnake @@ -186,8 +174,3 @@     contents <- proc =<< readFile p     let warnDo (x, es) = mapM_ displayErr es >> writeFile p' x     either displayErr warnDo (generateATS p contents)--exec :: IO ()-exec = do-    x <- getRecord "Generate ATS types for Haskell source code" :: IO Program-    genATSTypes (unHelpful . src $ x) (unHelpful . target $ x) (unHelpful . cpphs $ x)