Created
December 1, 2018 01:55
-
-
Save fragamus/15afd05cc2ad381c984ca5353f0dcb15 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
Hi I'm trying to ressurect this code: | |
https://www.schoolofhaskell.com/user/edwardk/cellular-automata/part-1 | |
I have resolved everything except this bit: | |
grid :: [[Bool]] -> Diagram SVG R2 | |
grid = cat unitY . reverse . map (hcat . map cell) where | |
cell b = unitSquare D.# fc (if b then black else white) | |
svg :: Diagram SVG R2 -> Strict.ByteString | |
svg = Strict.concat . Lazy.toChunks . renderSvg . renderDia SVG (SVGOptions (Width 400) Nothing) | |
I get errors like this: | |
/src/Lib.hs:65:21: error: | |
• Expected kind ‘((* -> *) -> Constraint) -> *’, | |
but ‘Diagram SVG’ has kind ‘*’ | |
• In the type signature: grid :: [[Bool]] -> Diagram SVG R2 | |
| | |
65 | grid :: [[Bool]] -> Diagram SVG R2 | |
| ^^^^^^^^^^^^^^ | |
/src/Lib.hs:68:8: error: | |
• Expected kind ‘((* -> *) -> Constraint) -> *’, | |
but ‘Diagram SVG’ has kind ‘*’ | |
• In the type signature: svg :: Diagram SVG R2 -> Strict.ByteString | |
| | |
68 | svg :: Diagram SVG R2 -> Strict.ByteString | |
| ^^^^^^^^^^^^^^ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment