-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Persistent module discover utilities -- -- This package provides an executable for discovering Persistent model -- definition files, as well as a library function to glob all persistent -- model files. Please see the README on GitHub at -- https://github.com/parsonsmatt/persistent-discover#readme @package persistent-discover @version 0.1.0.2 -- | This module contains types, definitions, and the logic behind finding -- persistent definitions. -- -- In brief, we do an import of all the models defined in the current -- directory or any subdirectories. These imports are "instances only" -- imports. Then we splice in $(discoverEntities) to -- -- The result module is named All, and it's placed in the -- hierarchy where you define this. So if you have a source file: -- --
-- -- srcPersistentModelsAll.hs
--
-- {-# OPTIONS_GHC -F -pgmF persistent-discover
--
--
-- Then it will translate to:
--
-- -- -- srcPersistentModelsAll.hs -- -- module PersistentModels.All where -- -- import PersistentModels.Foo () -- import PersistentModels.Bar () -- import PersistentModels.Baz () -- -- allEntityDefs :: [EntityDef] -- allEntityDefs = $(discoverEntities) --module Database.Persist.Discover.Exe newtype Source Source :: FilePath -> Source newtype Destination Destination :: FilePath -> Destination data AllModelsFile AllModelsFile :: Module -> [Module] -> AllModelsFile [amfModuleBase] :: AllModelsFile -> Module [amfModuleImports] :: AllModelsFile -> [Module] render :: Render -> String renderLine :: Render -> Render newtype Render' a Render :: State (DList String) a -> Render' a [unRender] :: Render' a -> State (DList String) a type Render = Render' () indent :: Int -> Render -> Render discoverModels :: Source -> Destination -> IO () -- | Returns a list of relative paths to all files in the given directory. getFilesRecursive :: FilePath -> IO [FilePath] renderFile :: AllModelsFile -> String data Module Module :: String -> FilePath -> Module [moduleName] :: Module -> String [modulePath] :: Module -> FilePath mkModulePieces :: FilePath -> [String] isLowerFirst :: String -> Bool pathToModule :: FilePath -> Maybe Module -- | Returns True if the given string is a valid task module name. See -- ModuleName (http:/git.iobj34) isValidModuleName :: String -> Bool -- | Returns True if the given Char is a valid taks module character. isValidModuleChar :: Char -> Bool -- | Convert a String in camel case to snake case. casify :: String -> String stripSuffix :: Eq a => [a] -> [a] -> Maybe [a] instance GHC.Base.Monad Database.Persist.Discover.Exe.Render' instance GHC.Base.Applicative Database.Persist.Discover.Exe.Render' instance GHC.Base.Functor Database.Persist.Discover.Exe.Render' instance GHC.Show.Show Database.Persist.Discover.Exe.Module instance GHC.Classes.Eq Database.Persist.Discover.Exe.Module instance (a GHC.Types.~ ()) => Data.String.IsString (Database.Persist.Discover.Exe.Render' a) module Database.Persist.Discover -- | Returns a list of all files with the .persistentmodels -- suffix. -- --
-- allFiles :: [FilePath] -- allFiles = $$(findPersistentModelFiles "config/models/") --findPersistentModelFiles :: FilePath -> Q (TExp [FilePath]) module Lib someFunc :: IO ()