Skip to content

Instantly share code, notes, and snippets.

@skliew
skliew / create_avro_file.pl
Last active April 14, 2016 15:15
Create Avro-backed Hive table (and write Avro files directly into its storage location)
#!/usr/bin/env perl
use strict;
use warnings;
use Avro::Schema;
use Avro::DataFileWriter;
my $value = shift || "1234";
my $fn = shift || "0";
my $schema = Avro::Schema->parse(<<EOP);
@skliew
skliew / closconv.lhs
Created June 17, 2021 07:48 — forked from jozefg/closconv.lhs
Tutorial on Closure Conversion and Lambda Lifting
This is my short-ish tutorial on how to implement closures in
a simple functional language: Foo.
First, some boilerplate.
> {-# LANGUAGE DeriveFunctor, TypeFamilies #-}
> import Control.Applicative
> import Control.Monad.Gen
> import Control.Monad.Writer
> import Data.Functor.Foldable