Skip to content

Instantly share code, notes, and snippets.

@tebello-thejane
tebello-thejane / Example.java
Last active July 17, 2020 13:20
Yet another Java lens design
import lombok.*;
public class App {
public static void main(String[] args) {
// We can't go down a series of lenses if an intermediate lens focuses on an uninstantiated field --
// how are you going to modify or read a null field?
Person thePerson = new Person(
new Company(null,
new Address(null, 15)),
@tebello-thejane
tebello-thejane / Given_example.hs
Last active April 24, 2017 18:02
Abusing EKmett's `reflection` library to thread (almost-)arbitrary state through your program.
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
module Main where
import Data.Reflection
import Data.Proxy
data T a = T a deriving Show

Keybase proof

I hereby claim:

  • I am tebello-thejane on github.
  • I am tebellothejane (https://keybase.io/tebellothejane) on keybase.
  • I have a public key whose fingerprint is 5BAA 7182 CBF0 7C70 7FAF 8BF2 9F57 9703 4244 2615

To claim this, I am signing this object: