🐙 Templated web page generator for your git repositories
git clone https://github.com/m-col/gitja
Files | Refs | Readme | License

Commit d2e1084ee621a1c67b0b59ec0fd7647940db29d0
Parent: 4c70db20972441bbfc282ce305f414e250a299ec
Author: mcol <mcol@posteo.net>
Date: 2021-09-30 01:28:05 +0100
Committer: mcol <mcol@posteo.net>
Committed: 2021-09-30 01:28:05 +0100

Pointfree listTemplates

src/Templates.hs Modified

@@ -18,7 +18,7 @@
     generate,
 ) where
 
-import Control.Monad (filterM, (<=<))
+import Control.Monad (filterM, (<=<), ap)
 import Data.Char (toLower)
 import Data.Either (rights)
 import Data.List (isSuffixOf)
@@ -135,7 +135,8 @@
 directory's contents.
 -}
 listTemplates :: FilePath -> IO [FilePath]
-listTemplates directory = fmap (directory </>) <$> getDirectoryContents directory
+-- ap :: m (a -> b) -> m a -> m b, where m is (->) r
+listTemplates = ap (fmap . fmap . (</>)) getDirectoryContents
 
 {-
 getFiles will look inside the template directory and generate a list of paths to likely