Skip to content

Commit

Permalink
trees-that-shrink: update
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhavsagar committed Jan 28, 2024
1 parent 4343ebd commit dbea2b9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
31 changes: 16 additions & 15 deletions trees-that-shrink/TreesThatShrink.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -170,7 +170,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -189,7 +189,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -224,7 +224,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -259,7 +259,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -297,7 +297,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -322,7 +322,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -343,7 +343,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -354,7 +354,7 @@
" AbsUD f -> eval env f\n",
" AppUD f x -> let\n",
" x' = eval env x\n",
" in eval (x':env) f"
" in eval (env ++ [x']) f"
]
},
{
Expand All @@ -366,13 +366,13 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"2"
"1"
]
},
"metadata": {},
Expand All @@ -381,7 +381,7 @@
],
"source": [
"identity = AbsLet \"i\" (VarLet \"i\")\n",
"konst = (AbsLet \"x\" (AbsLet \"y\" (VarLet \"x\")))\n",
"konst = AbsLet \"x\" (AbsLet \"y\" (VarLet \"x\"))\n",
"\n",
"eval [] . anonymise . desugar Map.empty $ AppLet (AppLet konst (LitLet 1)) (LitLet 2)"
]
Expand All @@ -402,7 +402,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -496,11 +496,12 @@
"language_info": {
"codemirror_mode": "ihaskell",
"file_extension": ".hs",
"mimetype": "text/x-haskell",
"name": "haskell",
"pygments_lexer": "Haskell",
"version": "8.2.2"
"version": "9.4.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
19 changes: 16 additions & 3 deletions trees-that-shrink/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
let
pkgs = import ../pkgs.nix;
in import "${pkgs.ihaskell}/release.nix" {
compiler = "ghc928";
nixpkgs = import pkgs.nixpkgs {};
overlay = sel: sup: {
nix-filter = import pkgs.nix-filter;
haskell = sup.haskell // {
packages = sup.haskell.packages // {
ghc948 = sup.haskell.packages.ghc948.override {
overrides = self: super: {
ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0;
};
};
};
};
};
nixpkgs = (import pkgs.nixpkgs { overlays = [ overlay ]; });
jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]);
in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{
packages = self: with self; [ containers ];
extraEnvironmentBinaries = [jupyterlab];
}

0 comments on commit dbea2b9

Please sign in to comment.