git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| For each pixel on the screen do: | |
| { | |
| x0 = scaled x co-ordinate of pixel (must be scaled to lie somewhere in the interval (-2.5 to 1) | |
| y0 = scaled y co-ordinate of pixel (must be scaled to lie somewhere in the interval (-1, 1) | |
| ESCAPE = 2*2 | |
| x = 0 | |
| y = 0 | |
| iteration = 0 |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
I'm currently the lead instructor at Code Platoon and an instructor/developer at the Turing School of Software and Design.
I've been advocating the Fish shell and when the choice is up to me, I choose that for my students. Enough people ask about the decision, particularly in relation to the preinstalled Bash shell, that I figured it's worth laying out my reasoning.
| {-# LANGUAGE RankNTypes #-} | |
| import Control.Monad.State (State, gets, put) | |
| import Data.Set (Set) | |
| import qualified Data.Set as S | |
| newtype SetF a = | |
| SetF (forall x. Ord x => (a -> x) -> Set x) | |
| instance Ord a => Eq (SetF a) where |
| chris@renzo ~> cat ~/.stack/config.yaml | |
| # This file contains default non-project-specific settings for 'stack', used | |
| # in all projects. For more information about stack's configuration, see | |
| # http://docs.haskellstack.org/en/stable/yaml_configuration.html | |
| # | |
| nix: | |
| enable: true | |
| pure: false | |
| shell-file: /home/chris/.stack/shell.nix |
| newtype ConjList a = ConjList [a] deriving Show | |
| instance Monoid a => Monoid (ConjList a) where | |
| mempty = ConjList $ repeat mempty | |
| mappend (ConjList x) (ConjList y) = ConjList $ zipWith mappend x y | |
| λ> mappend (ConjList ["ab", "cd"]) (ConjList ["xc", "xy", "xp"]) | |
| ConjList ["abxc","cdxy"] | |
| it :: (Monoid a, Data.String.IsString a) => ConjList a |
| CONFIGURATION.NIX(5) NixOS Reference Pages CONFIGURATION.NIX(5) | |
| NAME | |
| configuration.nix - NixOS system configuration specification | |
| DESCRIPTION | |
| The file /etc/nixos/configuration.nix contains the declarative | |
| specification of your NixOS system configuration. The command |
| @-moz-document domain("github.com"), domain("gist.github.com"), domain("render.githubusercontent.com") { | |
| /* Hasklig https://github.com/i-tu/Hasklig */ | |
| /* Fira Code https://github.com/tonsky/FiraCode */ | |
| /* Ligaturizer https://github.com/ToxicFrog/Ligaturizer */ | |
| .branch-name, | |
| .blob-num, | |
| .blob-code-inner, | |
| .CodeMirror pre, | |
| .commit .sha, | |
| .commit-desc pre, |
Let's say we want to test whether the list [1,2,3,4,5] contains 2.
We could do this by turning the list of integers [1,2,3,4,5]
into a list of Booleans [False, True, False, False, False] indicating,
for each element in the original list, whether it is equal to 2.
λ> x = map (== 2) [1..5]| -- This gist provides an explanation for why Haskell is significantly | |
| -- faster than ATS and Rust in [vmchale’s great | |
| -- benchmarks](https://github.com/vmchale/ats-benchmarks). What’s | |
| -- happening is that the `derangements` list gets memoized so the | |
| -- benchmark only checks the performance of (!!). `derangements'` | |
| -- prevents GHC from memoizing the list and results in a significant | |
| -- loss of performance. Criterion does try to prevent memoization but | |
| -- it only prevents memoization of the function application (that’s | |
| -- why the function and the argument need to be passed separately to | |
| -- `nf`). It cannot prevent the memoization of the `derangements` |