-
-
Save mmynsted/40d0d88d7fc67b69e1790c11aa95402e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- tsDefaultCompiler :: [Identifier] -> Context String -> Item String -> Compiler (Item String) | |
-- tsDefaultCompiler | |
siteIndexCompiler :: Context String -> Item String -> Compiler (Item String) | |
siteIndexCompiler ctx = | |
loadAndApplyTemplate "templates/site-index.html" ctx | |
>=> defaultCompiler ctx | |
sitePageCompiler :: Context String -> Item String -> Compiler (Item String) | |
sitePageCompiler ctx = | |
loadAndApplyTemplate "templates/site-page.html" ctx | |
>=> defaultCompiler ctx | |
defaultCompiler :: Context String -> Item String -> Compiler (Item String) | |
defaultCompiler ctx = | |
loadAndApplyTemplate "templates/default.html" ctx | |
>=> cleanAndRelUrls |
Author
mmynsted
commented
Jan 28, 2021
Here is error when I attempt to compile
6 of 7] Compiling Compilers ( src/Compilers.hs, /Users/mmynsted/projects/bytesizedworkbench-hakyll/dist-newstyle/build/x86_64-osx/ghc-8.8.4/bytesizedworkbench-hakyll-0.1.0.0/x/site/build/site/site-tmp/Compilers.o )
src/Compilers.hs:22:5: error:
• Couldn't match expected type ‘Item String
-> Compiler (Item String)’
with actual type ‘Compiler (Compiler (Item String))’
• Possible cause: ‘foldM’ is applied to too many arguments
In the expression:
foldM
(\ acc b -> acc >>= loadAndApplyTemplate b ctx)
(empty :: Compiler (Item String))
ts
In an equation for ‘tsDefaultCompiler’:
tsDefaultCompiler ts ctx
= foldM
(\ acc b -> acc >>= loadAndApplyTemplate b ctx)
(empty :: Compiler (Item String))
ts
|
22 | foldM
| ^^^^^...
src/Compilers.hs:23:20: error:
• Couldn't match type ‘Item’ with ‘Compiler’
Expected type: Compiler (Compiler (Item String))
Actual type: Compiler (Item String)
• In the expression: acc >>= loadAndApplyTemplate b ctx
In the first argument of ‘foldM’, namely
‘(\ acc b -> acc >>= loadAndApplyTemplate b ctx)’
In the expression:
foldM
(\ acc b -> acc >>= loadAndApplyTemplate b ctx)
(empty :: Compiler (Item String))
ts
|
23 | (\acc b -> acc >>= loadAndApplyTemplate b ctx)
If I change the function like this
tsDefaultCompiler ::
[Identifier] ->
Context String ->
Item String ->
Compiler (Item String)
tsDefaultCompiler ts ctx =
foldM
(\acc b -> loadAndApplyTemplate b ctx)
(empty :: Compiler (Item String))
ts
Then it compiles but the result is always the empty
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment