added shell.nix moved focus point

This commit is contained in:
Yann Esposito (Yogsototh) 2020-01-05 10:29:46 +01:00
parent 8ded5bb330
commit a1d8187431
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646
3 changed files with 30 additions and 1 deletions

3
.gitignore vendored Normal file
View file

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

View file

@ -1,7 +1,7 @@
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
type C=(Double,Double) 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) 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->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) 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; 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 Normal file
View file

@ -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\]]> "
'';
}