Add test case for #40
commit218704ebc071f0b55fee14353bab65ed36648492
authorCsongor Kiss <kiss.csongor.kiss@gmail.com>
dateMon 2 Apr 2018, 01:26 (9 years ago)
parent3d9c1ae
generic-lens.cabal+1−1
@@ -84,7 +84,7 @@ test-suite generic-lens-test
8484 type: exitcode-stdio-1.0
8585 hs-source-dirs: test
8686 main-is: Spec.hs
87− other-modules: Util Test24 Test25
87+ other-modules: Util Test24 Test25 Test40
8888
8989 build-depends: base >= 4.9 && <= 5.0
9090 , generic-lens
test/Test40.hsnew file+22
@@ -0,0 +1,22 @@
1+{-# LANGUAGE TypeFamilies #-}
2+{-# LANGUAGE TypeApplications #-}
3+{-# LANGUAGE DataKinds #-}
4+{-# LANGUAGE DeriveGeneric #-}
5+{-# OPTIONS_GHC -Wall #-}
6+
7+module Test40 where
8+
9+import Data.Generics.Product
10+import GHC.Generics
11+
12+class MyClass a where
13+ data AssocData a
14+
15+instance MyClass Int where
16+ data AssocData Int = SomeData
17+ { val :: Int
18+ } deriving (Generic)
19+
20+main :: IO ()
21+main
22+ = print $ getField @"val" (SomeData 3)