-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Tool for scaffolding fully configured batteries-included production-level Haskell projects. -- -- Tool for scaffolding fully configured batteries-included -- production-level Haskell projects. See README.md for details. @package summoner @version 1.3.0 -- | This module contains functions for colorful printing into terminal. module Summoner.Ansi data Color Black :: Color Red :: Color Green :: Color Yellow :: Color Blue :: Color Magenta :: Color Cyan :: Color White :: Color -- | Explicit flush ensures prompt messages are in the correct order on all -- systems. putStrFlush :: Text -> IO () -- | Takes list of formatting options, prints text using this format -- options. beautyPrint :: [IO ()] -> Text -> IO () boldCode :: String blueCode :: String -- | Starts bold printing. bold :: IO () boldText :: Text -> IO () boldDefault :: Text -> IO () italic :: IO () redCode :: String -- | Resets all previous settings. reset :: IO () resetCode :: String prompt :: IO Text setColor :: Color -> IO () successMessage :: Text -> IO () warningMessage :: Text -> IO () errorMessage :: Text -> IO () infoMessage :: Text -> IO () skipMessage :: Text -> IO () -- | Contains data type for GHC versions supported by Summoner and some -- useful functions for manipulation with them. module Summoner.GhcVer -- | Represents some selected set of GHC versions. data GhcVer Ghc7103 :: GhcVer Ghc801 :: GhcVer Ghc802 :: GhcVer Ghc822 :: GhcVer Ghc843 :: GhcVer Ghc844 :: GhcVer Ghc863 :: GhcVer Ghc864 :: GhcVer -- | Represents PVP versioning (4 numbers). data Pvp Pvp :: Int -> Int -> Int -> Int -> Pvp [pvpFirst] :: Pvp -> Int [pvpSecond] :: Pvp -> Int [pvpThird] :: Pvp -> Int [pvpFourth] :: Pvp -> Int -- | Converts GhcVer into dot-separated string. showGhcVer :: GhcVer -> Text parseGhcVer :: Text -> Maybe GhcVer -- | Returns latest known LTS resolver for all GHC versions except default -- one. latestLts :: GhcVer -> Text -- | Returns corresponding base version of the given GHC version. baseVer :: GhcVer -> Text -- | Returns the base bounds for the list of the given GHC -- versions. -- --
--   >>> cabalBaseVersions [Ghc844]
--   "^>= 4.11.1.0"
--   
-- --
--   >>> cabalBaseVersions [Ghc802, Ghc822, Ghc844]
--   ">= 4.9.0.0 && < 4.12"
--   
cabalBaseVersions :: [GhcVer] -> Text -- | These are old GHC versions that are not working with default GHC -- versions when using Stack. oldGhcs :: [GhcVer] instance GHC.Enum.Bounded Summoner.GhcVer.GhcVer instance GHC.Enum.Enum Summoner.GhcVer.GhcVer instance GHC.Show.Show Summoner.GhcVer.GhcVer instance GHC.Classes.Ord Summoner.GhcVer.GhcVer instance GHC.Classes.Eq Summoner.GhcVer.GhcVer instance GHC.Show.Show Summoner.GhcVer.Pvp -- | This module contains some default values to use. module Summoner.Default -- | Default GHC version is the latest available. defaultGHC :: GhcVer -- | Default version of the Cabal. defaultCabal :: Text defaultTomlFile :: FilePath defaultConfigFile :: IO FilePath defaultDescription :: Text currentYear :: IO Text -- | Data types that represent license names and license content and -- functions to work with them. module Summoner.License -- | Licenses supported by summoner. data LicenseName MIT :: LicenseName BSD2 :: LicenseName BSD3 :: LicenseName GPL2 :: LicenseName GPL3 :: LicenseName LGPL21 :: LicenseName LGPL3 :: LicenseName AGPL3 :: LicenseName Apache20 :: LicenseName MPL20 :: LicenseName None :: LicenseName newtype License License :: Text -> License [unLicense] :: License -> Text -- | As it will be shown in the cabal file. cabalLicense :: LicenseName -> Text -- | Replaces name/year placeholders with the actual data. customizeLicense :: LicenseName -> License -> Text -> Text -> License -- | Used for downloading the license text form Github. githubLicenseQueryNames :: LicenseName -> Text parseLicenseName :: Text -> Maybe LicenseName fetchLicense :: LicenseName -> IO License -- | Show short information for the LicenseName. licenseShortDesc :: LicenseName -> Text -- | Show license name along with its short description. showLicenseWithDesc :: LicenseName -> Text instance GHC.Generics.Generic Summoner.License.License instance GHC.Show.Show Summoner.License.License instance Data.String.IsString Summoner.License.License instance GHC.Generics.Generic Summoner.License.LicenseName instance GHC.Enum.Bounded Summoner.License.LicenseName instance GHC.Enum.Enum Summoner.License.LicenseName instance GHC.Classes.Ord Summoner.License.LicenseName instance GHC.Classes.Eq Summoner.License.LicenseName instance Data.Aeson.Types.FromJSON.FromJSON Summoner.License.License instance GHC.Show.Show Summoner.License.LicenseName -- | This module contains various function to work with commands. module Summoner.Process -- | Delete file, but just print a message if delete fails and continue -- instead of raising an error. deleteFile :: FilePath -> IO () module Summoner.Settings -- | Data needed for project creation. data Settings Settings :: !Text -> !Text -> !Text -> !Text -> !Text -> !Text -> !Text -> !LicenseName -> !License -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> ![GhcVer] -> !Text -> !Maybe CustomPrelude -> ![Text] -> ![Text] -> ![Text] -> !Bool -> !Bool -> !Maybe Text -> !Maybe Text -> !Bool -> Settings -- | repository name [settingsRepo] :: Settings -> !Text -- | github username [settingsOwner] :: Settings -> !Text -- | project description [settingsDescription] :: Settings -> !Text -- | full name [settingsFullName] :: Settings -> !Text -- | e-mail [settingsEmail] :: Settings -> !Text -- | year [settingsYear] :: Settings -> !Text -- | project category [settingsCategories] :: Settings -> !Text -- | type of license [settingsLicenseName] :: Settings -> !LicenseName -- | license text [settingsLicenseText] :: Settings -> !License -- | GitHub repository [settingsGitHub] :: Settings -> !Bool -- | private repository [settingsPrivate] :: Settings -> !Bool -- | Travis CI integration [settingsTravis] :: Settings -> !Bool -- | AppVeyor CI integration [settingsAppVeyor] :: Settings -> !Bool -- | is library [settingsIsLib] :: Settings -> !Bool -- | is executable [settingsIsExe] :: Settings -> !Bool -- | add tests [settingsTest] :: Settings -> !Bool -- | add benchmarks [settingsBench] :: Settings -> !Bool -- | GHC versions [settingsTestedVersions] :: Settings -> ![GhcVer] -- | Base library to use [settingsBaseType] :: Settings -> !Text -- | custom prelude to be used [settingsPrelude] :: Settings -> !Maybe CustomPrelude -- | default extensions [settingsExtensions] :: Settings -> ![Text] -- | default GHC options [settingsGhcOptions] :: Settings -> ![Text] -- | .gitignore file [settingsGitignore] :: Settings -> ![Text] [settingsCabal] :: Settings -> !Bool [settingsStack] :: Settings -> !Bool -- | .stylish-haskell.yaml file [settingsStylish] :: Settings -> !Maybe Text -- | CONTRIBUTING.md file [settingsContributing] :: Settings -> !Maybe Text -- | do not upload to GitHub [settingsNoUpload] :: Settings -> !Bool data CustomPrelude CustomPrelude :: Text -> Text -> CustomPrelude [cpPackage] :: CustomPrelude -> Text [cpModule] :: CustomPrelude -> Text customPreludeT :: TomlCodec CustomPrelude -- | Enum for supported build tools. data Tool Cabal :: Tool Stack :: Tool -- | Show Tool in lowercase. showTool :: Tool -> Text -- | Parse Tool from string. Inverse of showTool. parseTool :: Text -> Maybe Tool instance GHC.Enum.Bounded Summoner.Settings.Tool instance GHC.Enum.Enum Summoner.Settings.Tool instance GHC.Classes.Eq Summoner.Settings.Tool instance GHC.Show.Show Summoner.Settings.Tool instance GHC.Show.Show Summoner.Settings.Settings instance GHC.Classes.Eq Summoner.Settings.CustomPrelude instance GHC.Show.Show Summoner.Settings.CustomPrelude module Summoner.Source data Source -- | URL link to the source file. Url :: Text -> Source -- | File path to the local source file. File :: FilePath -> Source -- | Link to external file. Link :: Text -> Source sourceT :: Key -> TomlCodec Source fetchSource :: Bool -> Source -> IO (Maybe Text) instance GHC.Classes.Eq Summoner.Source.Source instance GHC.Show.Show Summoner.Source.Source -- | File templates for cabal and stack scripts. module Summoner.Template.Script -- | Text content for a single script file. scriptFile :: GhcVer -> Tool -> Text module Summoner.Text -- | Creates module name from the name of the package Ex: -- my-lovely-projectMyLovelyProject packageToModule :: Text -> Text -- | Converts every element of list into Text and then joins every -- element into single Text like intercalate. intercalateMap :: Text -> (a -> Text) -> [a] -> Text headToUpper :: Text -> Text -- | Convert every element of a list into text, and squash the results tconcatMap :: (a -> Text) -> [a] -> Text -- | This module contains function to proper questioning in terminal. module Summoner.Question -- | Allows users to choose one of the given options. It asks the question -- until the appropriate answer is received. choose :: Show a => (Text -> Maybe a) -> Text -> [a] -> IO a -- | Like choose but the possible answer are Y or N. chooseYesNo :: YesNoPrompt -> IO a -> IO a -> IO a -- | Like chooseYesNo but returns Bool. chooseYesNoBool :: YesNoPrompt -> IO Bool -- | Build a prompt -- -- For example, -- --
--   YesNoPrompt
--     { yesNoTarget = Cabal
--     , yesNoPrompt = "Do you want to add a cabal integration?"}
--   
-- -- will generate a following prompt message to the user -- --
--   Do you want to add a cabal integration? [y]/n
--    -> y
--   [Cabal] will be added to the project
--   
data YesNoPrompt YesNoPrompt :: Text -> Text -> YesNoPrompt -- | target (e.g., TARGET will be added to the project) [yesNoTarget] :: YesNoPrompt -> Text -- | prompt (e.g., PROMPT [y]/n) [yesNoPrompt] :: YesNoPrompt -> Text -- | Build a prompt with the TARGET name only -- -- It will generate a simple default prompt such that -- --
--   Add TARGET? [y]/n
--   
mkDefaultYesNoPrompt :: Text -> YesNoPrompt -- | Queries for any answer. -- --
--   Short project description:
--   ->
--   
query :: Text -> IO Text -- | Queries for an non-empty answer. queryNotNull :: Text -> IO Text -- | Like query but has the default answer if no answer is -- specified. queryDef :: Text -> Text -> IO Text -- | Queries many answers. If answers are not parsable shows the failing -- part and queries again queryManyRepeatOnFail :: forall a. (Text -> Maybe a) -> IO [a] checkUniqueName :: Text -> IO Text -- | The message after yes/no questions. The output depends on the answer. -- --
--   Benchmarks will be added to the project
--   
targetMessageWithText :: Bool -> Text -> Text -> IO Bool -- | Like targetMessageWithText but the text is "added to the -- project" targetMessage :: Bool -> Text -> IO Bool trueMessage :: Text -> IO Bool falseMessage :: Text -> IO Bool -- | Decision data type. module Summoner.Decision -- | Used for detecting the user decision during CLI input. data Decision Idk :: Decision Nop :: Decision Yes :: Decision decisionToBool :: Decision -> YesNoPrompt -> IO Bool instance GHC.Generics.Generic Summoner.Decision.Decision instance GHC.Enum.Bounded Summoner.Decision.Decision instance GHC.Enum.Enum Summoner.Decision.Decision instance GHC.Classes.Eq Summoner.Decision.Decision instance GHC.Show.Show Summoner.Decision.Decision instance GHC.Base.Semigroup Summoner.Decision.Decision instance GHC.Base.Monoid Summoner.Decision.Decision instance Generics.Deriving.Semigroup.GSemigroup Summoner.Decision.Decision instance Generics.Deriving.Monoid.GMonoid Summoner.Decision.Decision -- | Summoner configurations. module Summoner.Config -- | Potentially incomplete configuration. data ConfigP (p :: Phase) Config :: !p :- Text -> !p :- Text -> !p :- Text -> !p :- LicenseName -> !p :- [GhcVer] -> !Decision -> !Decision -> !Decision -> !Decision -> !Decision -> !Decision -> !Decision -> !Decision -> !Decision -> !Decision -> !Last CustomPrelude -> ![Text] -> ![Text] -> ![Text] -> ![Text] -> !Last Source -> !Last Source -> !Any -> ConfigP [cOwner] :: ConfigP -> !p :- Text [cFullName] :: ConfigP -> !p :- Text [cEmail] :: ConfigP -> !p :- Text [cLicense] :: ConfigP -> !p :- LicenseName [cGhcVer] :: ConfigP -> !p :- [GhcVer] [cCabal] :: ConfigP -> !Decision [cStack] :: ConfigP -> !Decision [cGitHub] :: ConfigP -> !Decision [cTravis] :: ConfigP -> !Decision [cAppVey] :: ConfigP -> !Decision [cPrivate] :: ConfigP -> !Decision [cLib] :: ConfigP -> !Decision [cExe] :: ConfigP -> !Decision [cTest] :: ConfigP -> !Decision [cBench] :: ConfigP -> !Decision [cPrelude] :: ConfigP -> !Last CustomPrelude [cExtensions] :: ConfigP -> ![Text] [cWarnings] :: ConfigP -> ![Text] -- | GHC options to add every stanza [cGhcOptions] :: ConfigP -> ![Text] [cGitignore] :: ConfigP -> ![Text] [cStylish] :: ConfigP -> !Last Source [cContributing] :: ConfigP -> !Last Source -- | Do not upload to the GitHub (even if enabled) [cNoUpload] :: ConfigP -> !Any -- | Incomplete configurations. type PartialConfig = ConfigP 'Partial -- | Complete configurations. type Config = ConfigP 'Final -- | Identifies how to read ConfigP data from the .toml -- file. configT :: TomlCodec PartialConfig -- | Default ConfigP configurations. defaultConfig :: PartialConfig -- | Make sure that all the required configurations options were specified. finalise :: PartialConfig -> Validation [Text] Config -- | Read configuration from the given file and return it in data type. loadFileConfig :: MonadIO m => FilePath -> m PartialConfig instance GHC.Generics.Generic (Summoner.Config.ConfigP p) instance (Generics.Deriving.Semigroup.GSemigroup (p Summoner.Config.:- Data.Text.Internal.Text), Generics.Deriving.Semigroup.GSemigroup (p Summoner.Config.:- Summoner.License.LicenseName), Generics.Deriving.Semigroup.GSemigroup (p Summoner.Config.:- [Summoner.GhcVer.GhcVer])) => Generics.Deriving.Semigroup.GSemigroup (Summoner.Config.ConfigP p) instance (Generics.Deriving.Monoid.GMonoid (p Summoner.Config.:- Data.Text.Internal.Text), Generics.Deriving.Monoid.GMonoid (p Summoner.Config.:- Summoner.License.LicenseName), Generics.Deriving.Monoid.GMonoid (p Summoner.Config.:- [Summoner.GhcVer.GhcVer])) => Generics.Deriving.Monoid.GMonoid (Summoner.Config.ConfigP p) instance (GHC.Classes.Eq (p Summoner.Config.:- Data.Text.Internal.Text), GHC.Classes.Eq (p Summoner.Config.:- Summoner.License.LicenseName), GHC.Classes.Eq (p Summoner.Config.:- [Summoner.GhcVer.GhcVer])) => GHC.Classes.Eq (Summoner.Config.ConfigP p) instance (GHC.Show.Show (p Summoner.Config.:- Data.Text.Internal.Text), GHC.Show.Show (p Summoner.Config.:- Summoner.License.LicenseName), GHC.Show.Show (p Summoner.Config.:- [Summoner.GhcVer.GhcVer])) => GHC.Show.Show (Summoner.Config.ConfigP p) instance GHC.Base.Semigroup Summoner.Config.PartialConfig instance GHC.Base.Monoid Summoner.Config.PartialConfig module Summoner.Tree -- | Describes simple structure of filesystem tree. data TreeFs -- | Name of directory (relative) and its containing entries Dir :: FilePath -> [TreeFs] -> TreeFs -- | File name (relative) and file content File :: FilePath -> Text -> TreeFs -- | Walks through directory tree and write file contents, creating all -- intermediate directories. traverseTree :: TreeFs -> IO () -- | Pretty shows the directory tree content. showBoldTree :: TreeFs -> Text -- | Pretty shows tree with options. showTree :: Bool -> TreeFs -> Text instance GHC.Classes.Ord Summoner.Tree.TreeFs instance GHC.Classes.Eq Summoner.Tree.TreeFs instance GHC.Show.Show Summoner.Tree.TreeFs instance GHC.Generics.Generic Summoner.Tree.TreeFs module Summoner.Template.Stack stackFiles :: Settings -> [TreeFs] module Summoner.Template.Haskell haskellFiles :: Settings -> [TreeFs] -- | This module contains template for GitHub related docs: -- -- -- -- + https://github.com/commercialhaskell/stack/issues/4488 module Summoner.Template.GitHub gitHubFiles :: Settings -> [TreeFs] module Summoner.Template.Doc docFiles :: Settings -> [TreeFs] module Summoner.Template.Cabal cabalFile :: Settings -> TreeFs -- | This module contains functions for stack template creation. module Summoner.Template -- | Creating tree structure of the project. createProjectTemplate :: Settings -> TreeFs -- | This module introduces functions for the project creation. module Summoner.Project -- | Generate the project. generateProject :: Bool -> Text -> Config -> IO () -- | Creates the directory and run GitHub commands. initializeProject :: Settings -> IO () -- | This module contains functions and data types to parse CLI inputs. module Summoner.CLI -- | Represent all available commands data Command -- | new command creates a new project New :: NewOpts -> Command -- | script command creates Haskell script Script :: ScriptOpts -> Command -- | show command shows supported licenses or GHC versions ShowInfo :: ShowOpts -> Command -- | Options parsed with new command data NewOpts NewOpts :: Text -> Bool -> Bool -> Maybe FilePath -> PartialConfig -> NewOpts -- | project name [newOptsProjectName] :: NewOpts -> Text -- | ignore all config files if True [newOptsIgnoreFile] :: NewOpts -> Bool -- | Offline mode [newOptsOffline] :: NewOpts -> Bool -- | file with custom configuration [newOptsConfigFile] :: NewOpts -> Maybe FilePath -- | config gathered during CLI [newOptsCliConfig] :: NewOpts -> PartialConfig -- | Commands parsed with show command data ShowOpts GhcList :: ShowOpts LicenseList :: Maybe String -> ShowOpts -- | Main function that parses CLI commands and runs them using -- given Command handler. summon :: Version -> (Command -> IO ()) -> IO () -- | Runs summoner in CLI mode. summonCli :: IO () -- | Runs script command. -- --
--   Usage: summon script BUILD_TOOL (-g|--ghc GHC_VERSION) (-n|--name FILE_NAME)
--     Create a new Haskell script
--   
--   Available options:
--     -h,--help                Show this help text
--     -g,--ghc GHC_VERSION     Version of the compiler to be used for script
--     -n,--name FILE_NAME      Name of the script file
--   
runScript :: ScriptOpts -> IO () -- | By the given NewOpts return the final configurations. getFinalConfig :: NewOpts -> IO Config module Summoner