Skip to content

Instantly share code, notes, and snippets.

@fizbin
fizbin / LensBuilder.hs
Last active December 26, 2015 21:39
Experimenting with the Builder pattern in Control.Lens
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE Arrows #-}
{- Some ideas on the common Builder pattern from the OO world in the context of lenses -}
module Main where
@fizbin
fizbin / LensHXTPickle.hs
Last active December 26, 2015 18:29
A little demonstration of HXT and Lenses including a full worked example to show how to pickle an involved data structure to XML.
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE RankNTypes #-}
{- A little demonstration of HXT and Lenses -}
module Main where
import Control.Arrow