Skip to content

Instantly share code, notes, and snippets.

View namin's full-sized avatar

Nada Amin namin

View GitHub Profile
@namin
namin / FlashFillCmdLine.cs
Created September 18, 2019 18:34
FlashFill Command Line
using System;
using System.Collections.Generic;
using Microsoft.ProgramSynthesis.Transformation.Text;
using Microsoft.ProgramSynthesis.Transformation.Text.Semantics;
using Microsoft.ProgramSynthesis.Wrangling.Constraints;
namespace FlashFillCmdLine
{
class FlashFillCmdLine
{
@namin
namin / gist:a03d57fe10ad4ae17ccc8732fcaf8a54
Created July 28, 2016 07:21 — forked from milessabin/gist:aae285025a32fac0f5c1
Trivial type safe heterogenous map using only dependent method types, singleton-typed String literal keys and implicits.
scala> trait Assoc[K] { type V ; val value: V }
defined trait Assoc
scala> def mkAssoc[V0](k: String, v: V0): Assoc[k.type] { type V = V0 } =
| new Assoc[k.type] { type V = V0 ; val value = v }
mkAssoc: [V0](k: String, v: V0)Assoc[k.type]{type V = V0}
scala> implicit def nameAssoc = mkAssoc("Name", "Mary")
nameAssoc: Assoc[String("Name")]{type V = String}
@namin
namin / ch.lhs
Created July 10, 2016 15:52
Curry-Howard
This is a literate haskell file, tested in GHC 7.8.2. If you are
running an earlier version that does not support EmptyCase, you can
remove it from the language extensions required below and replace the
definition of abort below to "cheat" by using an infinite loop to
produce any result type: abort x = abort x
> {-# LANGUAGE EmptyDataDecls, EmptyCase, RankNTypes, ScopedTypeVariables #-}
Curry-Howard Isomorphism: Proposition as Types
@namin
namin / index.html
Created December 17, 2013 00:56
Nature of Code: Cantor Set
<html>
<head>
<style>
* { margin: 0; padding: 0; overflow: hidden;}
#canvas { display: block; }
</style>
</head>
<body>
<canvas id="canvas"></canvas>
<script>