Browse Source

added shell.nix moved focus point

master
parent
commit
a1d8187431
Signed by: yogsototh GPG Key ID: 7B19A4C650D59646
  1. 3
      .gitignore
  2. 2
      asciimandel.hs
  3. 26
      shell.nix

3
.gitignore

@ -0,0 +1,3 @@
*.o
*.hi
asciimandel

2
asciimandel.hs

@ -1,7 +1,7 @@
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
type C=(Double,Double)
instance Num C where (x,y)*(z,t)=(z*x-y*t,y*z+x*t);(x,y)+(z,t)=(x+z,y+t);abs((x,y))=(sqrt(x*x+y*y),0.0)
a=27;b=79;c=(-2.0,-1.0);d=(1.0,1.0);e=(-1.064,-0.15);r((x,y))=x;i((x,y))=y
a=27;b=79;c=(-2.0,-1.0);d=(1.0,1.0);e=(-2.791,-1.0000);r((x,y))=x;i((x,y))=y
f::C->C->Int->Int
f c z 0=0;f c z n=if(r(abs(z))>2)then n else f c ((z*z)+c) (n-1)
h j k = map(\z->(f (z) (0,0) 32,(fst z>l - q/2)))[(x,y)|y<-[p,(p+((o-p)/a))..o],x<-[m,(m + q)..l]]where o=i k;p=i j;m=r j;l=r k;q=(l-m)/b;

26
shell.nix

@ -0,0 +1,26 @@
{ nixpkgs ? import (fetchTarball https://github.com/NixOS/nixpkgs/archive/19.09.tar.gz) {} }:
let
inherit (nixpkgs) pkgs;
inherit (pkgs) haskellPackages;
haskellDeps = ps: with ps; [
base
protolude
containers
];
ghc = haskellPackages.ghcWithPackages haskellDeps;
nixPackages = [
ghc
pkgs.gdb
haskellPackages.cabal-install
];
in
pkgs.stdenv.mkDerivation {
name = "env";
buildInputs = nixPackages;
shellHook = ''
export PS1="\n[hs:\033[1;32m\]\W\[\033[0m\]]> "
'';
}
Loading…
Cancel
Save