Skip to content

Instantly share code, notes, and snippets.

@o1lo01ol1o
o1lo01ol1o / default.nix
Created April 27, 2018 21:58
transient-universe and nix
# default.nix
{}:
(import ./reflex-platform{}).project ({ pkgs, ... }:
{
packages = {
common = ./common;
backend = ./backend;
frontend = ./frontend;
@o1lo01ol1o
o1lo01ol1o / dataFamiliesVsTypeFamiliesVsGADTs.md
Last active December 6, 2017 22:14
Cheat sheet for haskell type level extenions.

To your other, more general question, "the uses of data families as distinct from type families and GADTs". Here's the space of possibilities: ​

  1. Is the type constructor generative and injective, and can it be partially applied?
  2. Is there a runtime tag passed along with the value to pattern match on?
  3. Can it be closed, can it be open? ​ And here's where GADTs and type/data families lie in this space: ​
@o1lo01ol1o
o1lo01ol1o / keybase.md
Created November 9, 2017 15:36
keybase.md

Keybase proof

I hereby claim:

  • I am o1lo01ol1o on github.
  • I am o1lo01ol1o (https://keybase.io/o1lo01ol1o) on keybase.
  • I have a public key ASAohfPzXdT8Wyi8YU0niXf89Jq--Mei5gg4FDVPwtKnbAo

To claim this, I am signing this object:

@o1lo01ol1o
o1lo01ol1o / gadtgraph.hs
Last active July 18, 2017 22:52
(Unsuccessful) Attempt at encoding type-level graph with constraints
--Pragmas are needed additionally for the project in which this snippet is included
{-# LANGUAGE TypeInType, DataKinds, PolyKinds, ScopedTypeVariables,
FlexibleInstances, FlexibleContexts, GADTs, TypeFamilies,
RankNTypes, LambdaCase, TypeOperators, TemplateHaskell,
ConstraintKinds, PolyKinds, NoImplicitPrelude,
UndecidableInstances, MultiParamTypeClasses, GADTSyntax,
AllowAmbiguousTypes, InstanceSigs, DeriveFunctor,
FunctionalDependencies #-}
-- Algebra.Graph is from the algebraic-graphs package
@o1lo01ol1o
o1lo01ol1o / script.fsx
Created June 2, 2017 23:04
Failing python deployment on VS2017 with MBrace
#I "../packages/MBrace.Thespian/tools"
#I "../packages/Streams/lib/net45"
#r "../packages/Streams/lib/net45/Streams.dll"
#I "../packages/Vagabond/lib/net45"
#r "../packages/Vagabond/lib/net45/Vagabond.dll"
#r "../packages/Vagabond/lib/net45/Vagabond.AssemblyParser.dll"
#I "../packages/MBrace.Flow/lib/net45"
#I "../packages/MBrace.Core/lib/net45"
#I "../packages/MBrace.Runtime/lib/net45"
#r "../packages/MBrace.Runtime/lib/net45/MBrace.Runtime.dll"
@o1lo01ol1o
o1lo01ol1o / ubuntu16_tensorflow_cuda8.sh
Created May 31, 2017 16:17 — forked from ksopyla/ubuntu16_tensorflow_cuda8.sh
How to set up tensorflow with CUDA 8 cuDNN 5.1 in virtualenv with Python 3.5 on Ubuntu 16.04 http://ksopyla.com/2017/02/tensorflow-gpu-virtualenv-python3/
# This is shorthened version of blog post
# http://ksopyla.com/2017/02/tensorflow-gpu-virtualenv-python3/
# update packages
sudo apt-get update
sudo apt-get upgrade
#Add the ppa repo for NVIDIA graphics driver
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FlexibleContexts, Arrows #-}
module Main where
import Euterpea.IO.Audio.Accelerate.BasicSigFuns
import Control.Monad ( when, unless )
import Data.List ( intersperse )
import System.Exit ( exitFailure )
import System.IO ( hPutStrLn, stderr )
@o1lo01ol1o
o1lo01ol1o / TH.hs
Created April 25, 2017 15:41
type-level broadcast and dimshuffle ops
{-# LANGUAGE DataKinds, PolyKinds, ScopedTypeVariables,
FlexibleInstances, FlexibleContexts, GADTs, TypeFamilies,
RankNTypes, LambdaCase, TypeOperators, TemplateHaskell,
NoImplicitPrelude, ConstraintKinds, PolyKinds, UndecidableInstances
#-}
module TH (DimShuffle, EvalBroadcast) where
import qualified Prelude as P
import Data.Singletons.TH (promote)
import Data.Singletons.Prelude.List
@o1lo01ol1o
o1lo01ol1o / stack.yaml
Created March 18, 2017 16:24 — forked from paolino/stack.yaml
reflex + servant + router stack
resolver: lts-7.2
compiler: ghcjs-0.2.1.9007002_ghc-8.0.1
compiler-check: match-exact
setup-info:
ghcjs:
source:
ghcjs-0.2.1.9007002_ghc-8.0.1:
url: http://ghcjs.tolysz.org/ghc-8.0-2016-10-01-lts-7.2-9007002.tar.gz
sha1: a41ae415328e2b257d40724d13d1386390c26322
@o1lo01ol1o
o1lo01ol1o / Client.fs
Last active February 24, 2017 16:52
websharper jquery listeners in client-server templates
namespace Testest
open WebSharper
open WebSharper.JavaScript
open WebSharper.UI.Next
open WebSharper.UI.Next.Client
open WebSharper.UI.Next.Html
open WebSharper.JavaScript
open WebSharper.JQuery