Skip to content

Instantly share code, notes, and snippets.

@ocramz
ocramz / sch48h_ch4.hs
Last active March 1, 2019 16:43
sch48h_ch4
module Main where
import Control.Monad
import Text.ParserCombinators.Parsec hiding (spaces)
import System.Environment
import Control.Monad.Error
data LispVal = Atom String
| List [LispVal]
| DottedList [LispVal] LispVal
| Number Integer
$ sudo easy_install pymc
Password:
Searching for pymc
Reading http://pypi.python.org/simple/pymc/
Best match: pymc 2.3.3
Downloading https://pypi.python.org/packages/source/p/pymc/pymc-2.3.3.tar.gz#md5=99645bf558a41376be0e687ccf90a39f
Processing pymc-2.3.3.tar.gz
Running pymc-2.3.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ef6ul2/pymc-2.3.3/egg-dist-tmp-VEL4jG
IOError: [Errno 2] No such file or directory: 'skip:ppnd7'. Skipping file "skip:ppnd7".
Reading fortran codes...
@ocramz
ocramz / Success.hs
Last active August 29, 2015 14:25 — forked from ekmett/Success.hs
{-# LANGUAGE DeriveFunctor, TypeFamilies #-}
module Success
( Parser(..)
, parse
) where
import Control.Applicative
import Control.Monad
import Data.Bifunctor
import Data.Profunctor
@ocramz
ocramz / gist:56bb62e139321a204df2
Created November 6, 2015 13:31 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview
@ocramz
ocramz / existential-constraint.hs
Last active June 16, 2016 13:27 — forked from phadej/existential-constraint.hs
This is short gist about problem I run today into, and its solution. It feels that probably I'm over engineering stuff, so: please comment!
#!/usr/bin/env stack
-- stack --resolver=lts-6.0 runghc --package constraints --package mtl --package lens --package text --package time
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, ConstraintKinds, UndecidableInstances, ScopedTypeVariables, InstanceSigs, OverloadedStrings, TemplateHaskell #-}
-- This is short gist about problem I run today into,
layout title date comments author categories commentIssueId
post
A comonad of graph decompositions
2016-04-02 13:02:54 -0400
true
Rúnar
scala comonads
22
import qualified GHC.Generics as G
-- | generics-sop
import Generics.SOP
import Generics.SOP.NP (collapse_NP)
-- | Python in Haskell yay!
--
-- Example :
@ocramz
ocramz / scatterplot-over-heatmap-vega.json
Last active January 13, 2020 08:41
Overlay a scatterplot on top of a heatmap in `vega`
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"width": 200,
"height": 200,
"padding": 5,
"data": [
{
"name": "d1",
"values": [
{"a": 0, "b": 0, "c": "36.5"},
@ocramz
ocramz / histograms-vega.json
Created March 1, 2019 15:54
Multiple histograms in `vega`, colour-coded by a feature
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"width": 200,
"height": 200,
"padding": 5,
"data": [
{
"name": "d1",
"values": [
{"a": 0, "c": "2.5", "z": 0},
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}
module Invoicing
( invoiceRoutes
, newInvoice
, waitInvoices
) where