Skip to content

Instantly share code, notes, and snippets.

@fragamus
Created December 1, 2018 01:55
Show Gist options
  • Save fragamus/15afd05cc2ad381c984ca5353f0dcb15 to your computer and use it in GitHub Desktop.
Save fragamus/15afd05cc2ad381c984ca5353f0dcb15 to your computer and use it in GitHub Desktop.
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