Skip to content

Instantly share code, notes, and snippets.

@jeremyjh
Created February 18, 2014 01:44
Show Gist options
  • Save jeremyjh/9062998 to your computer and use it in GitHub Desktop.
Save jeremyjh/9062998 to your computer and use it in GitHub Desktop.
non-working example of declareFields
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE FlexibleInstances #-}
module Main where
import Control.Lens
declareFields [d|
data Foo = Foo {fooXy :: String
,fooYz :: String } deriving Show
|]
{-makeFields ''Foo-}
main = do
let foo = Foo "hi" "there"
putStrLn $ foo^.xy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment