Created
February 18, 2014 01:44
-
-
Save jeremyjh/9062998 to your computer and use it in GitHub Desktop.
non-working example of declareFields
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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