Skip to content

Instantly share code, notes, and snippets.

@milesrout
Created August 28, 2017 06:53
Show Gist options
  • Save milesrout/838367fd3f6f1f23487205b9a5810a26 to your computer and use it in GitHub Desktop.
Save milesrout/838367fd3f6f1f23487205b9a5810a26 to your computer and use it in GitHub Desktop.
type Double a = (a, a)
data DoubleTree a = DLeaf a | DBranch (DoubleTree a, DoubleTree a)
type List a = [a]
data ListTree a = LLeaf a | LBranch [ListTree a]
type Maybe a
data MaybeTree a = MLeaf a | MBranch (Maybe (MaybeTree a))
= MLeaf a | MJust (MaybeTree a) | MNothing
data Tree a = Leaf a | Branch (Tree a, Tree a)
data TreeTree a = TLeaf a | TBranch (Tree (TreeTree a))
= TLeaf a | TBranchLeaf (TreeTree a) | TBranchBranch (TreeTree a) (TreeTree a)
type Reader a = ((->) a)
type ReaderInt a = (a -> Int)
data ReaderIntTree a = RILeaf a | RIBranch (ReaderInt (ReaderIntTree a))
= RILeaf a | RIBranch ((ReaderIntTree a) -> Int)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment