- I work for GDS
- Cabinet Office
- we started by building GOV.UK
- replaced older sites like direct gov, business link
- we’re not just fixing websites
- we also build and run digital services
- working with depts across the country
- eg: register to vote
I was just sitting in a doctor surgery 45 minutes ago with an orthopaedic spine surgeon, who is one of the few who has worked out how to use software to his advantage. We were measuring a deformity that the previous surgeon has created. After 20 minutes of drawing lines and measurements all over this DICOM image, the following happened
Access Violation at address 0xGOFUCKYOURSELF
…so now I have to go back in two weeks while he can restart a plan for a difficult corrective surgery.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env stack | |
-- stack --install-ghc runghc --package turtle --package wreq | |
{-# LANGUAGE OverloadedStrings #-} | |
import qualified Control.Foldl as Fold | |
import Control.Lens ((^.)) | |
import Control.Monad (when) | |
import Data.ByteString.Lazy (hPut) | |
import Data.Maybe (fromMaybe) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Data(flavour = Flavour.FJ) | |
public abstract class Free<f, A> implements __2<Free.µ, f, A> { | |
Free() {} | |
interface Cases<f, A, R> { | |
R Return(A a); | |
R Suspend(__<f, A> fa); | |
R Gosub(Sub<f, A, ?> sub); | |
} | |
abstract <R> R match(Cases<f, A, R> cases); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* In this version of `Traverse`, sequencing always goes through `List` (or some other canonical sequence type), | |
* which can be done in a stack-safe manner using a balanced fold as in https://gist.github.com/pchiusano/7667597. | |
* It's quite nice that `sequence` and `traverse` are now derived functions. | |
*/ | |
trait Traverse[F[_]] extends Functor[F] { | |
/** Inefficient but correct implementation of `toList` in terms of `mapAccumulate`. */ | |
def toList[A](f: F[A]): List[A] = mapAccumulate(f, List())((a, rbuf) => (a, a :: rbuf))._2.reverse | |
/** The only function that must be implemented. Must be consistent with `map`. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE DeriveFunctor #-} | |
import Control.Lens | |
import Prelude hiding (readFile, writeFile, print) | |
import qualified Prelude as Prelude(readFile, writeFile, print) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package scalaworld.interpreters | |
/* | |
This file shows a simple language, an interpreter, and two | |
partial evaluators for that language, along with a profiling suite. | |
*/ | |
trait Expr // denotes a Vector[Double] => Vector[Double] | |
object Expr { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with builtins; | |
rec { | |
pkgs = import <nixpkgs> {}; | |
testGHC = pkgs.haskellPackages.ghcWithPackages (p: with p; [ | |
base base-orphans bifunctors comonad contravariant distributive | |
tagged transformers | |
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// These lines go in ~/.sbt/0.13/global.sbt | |
watchSources ++= ( | |
(baseDirectory.value * "*.sbt").get | |
++ (baseDirectory.value / "project" * "*.scala").get | |
++ (baseDirectory.value / "project" * "*.sbt").get | |
) | |
addCommandAlias("rtu", "; reload ; test:update") | |
addCommandAlias("rtc", "; reload ; test:compile") | |
addCommandAlias("ru", "; reload ; update") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Option<A> { | |
protected Option() { } | |
} | |
interface App<F, A> { | |
F proof(); | |
} | |
class OptionF { | |
private OptionF() {} | |
private static class AppOption<A> implements App<OptionF, A> { |
OlderNewer