Browse Source

new clean repo

master
Rubik 3 years ago
commit
7490566f22
  1. 9
      .gitignore
  2. 17
      IDEAS.md
  3. 1
      README.md
  4. 2
      TODO.md
  5. 27
      darcs/Main.hs
  6. 3
      darcs/darcs.svg
  7. 6
      darcs/render.sh
  8. 28
      shell.nix

9
.gitignore vendored

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
*
!*.*
!*/
*.hi
*.o
.*.sw*

17
IDEAS.md

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
The following logos seem to be not to hard to build parametric:
Amethyst
Atom
Clojure
Docker
Elasticsearch
Elixir
Elm
Flutter
Grafana
Racket
Haskell
NixOS
Pr0gramm
Python
Scala

1
README.md

@ -0,0 +1 @@ @@ -0,0 +1 @@
Make cool SVGs with the Diagrams library.

2
TODO.md

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
Write render file `render.sh` with a directory as argument.
Alternatively use Shake.

27
darcs/Main.hs

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
import Diagrams.Prelude
import Diagrams.Backend.SVG.CmdLine
import Data.Colour hiding (atop)
alpha = 22.5 @@ deg
darcsgreen = RGB 118 255 0
ground :: Diagram B
ground = circle 1.8 # fc gray # lw veryThick # lc black
middleCirc :: Diagram B
middleCirc = circle 0.15 # fc gray # lw veryThick # lc green
node :: Diagram B
node = circle 0.3 # fc green # lw none # showOrigin
nodes = atPoints (trailVertices $ regPoly 8 0.9 # rotate alpha) (repeat node)
example = middleCirc `atop` nodes `atop` ground
main = mainWith example

3
darcs/darcs.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.5 KiB

6
darcs/render.sh

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
#!/bin/bash
FILE='Main'
ghc --make $FILE.hs
./$FILE -o darcs.svg -w 800

28
shell.nix

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:
let
inherit (nixpkgs) pkgs;
f = { mkDerivation, base, diagrams, stdenv }:
mkDerivation {
pname = "haskell-libs";
version = "0.1.0.0";
src = ./.;
libraryHaskellDepends = [ base diagrams ];
testHaskellDepends = [ base diagrams ];
description = "Modules for Project Euler and similar";
license = stdenv.lib.licenses.gpl3;
};
haskellPackages = if compiler == "default"
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};
variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
drv = variant (haskellPackages.callPackage f {});
in
if pkgs.lib.inNixShell then drv.env else drv
Loading…
Cancel
Save