Skip to content

Instantly share code, notes, and snippets.

@silky
Created July 10, 2018 03:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save silky/7388f1e01c5ae4671bad40a7f7be3a74 to your computer and use it in GitHub Desktop.
Save silky/7388f1e01c5ae4671bad40a7f7be3a74 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine
import Data.List.Split (chunksOf)
main :: IO ()
main = mainWith ( d # frame 0.1 ) >> putStrLn "Done"
d1 :: [Diagram B]
d1 = map (\d -> d # lw 0 # centerXY <> square 1.2 # lw 0)
[ square 1 # fc red
, circle 0.5 # fc blue
, triangle 1 # fc orange
]
d :: Diagram B
d = vcat $ map hcat dss
where
ds = take 300 $ cycle d1
dss = chunksOf 11 ds
name: Five-Minute-Dots
version: 0.1.0.0
license: BSD3
author: Noon van der Silk
maintainer: noonsilk@gmail.com
copyright: Noon van der Silk
category: Web
extra-source-files:
- README.md
dependencies:
- base >= 4.7 && < 5
- diagrams
- diagrams-cairo
- diagrams-contrib
- diagrams-lib
- random
- split
executables:
Five-Minute-Dots:
source-dirs: src
main: Main.hs
import Distribution.Simple
main = defaultMain
resolver: lts-10.7
packages:
- .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment