1{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
2{-# LANGUAGE DeriveGeneric, StandaloneDeriving #-}
6import qualified Data.Map as Map
10import Test.QuickCheck (Property, counterexample)
15 , fooTuple :: (String, Text, Int)
16 -- This definition causes an infinite loop in genericTo and genericFrom!
17 -- , fooMap :: Map.Map String Foo
18 , fooMap :: Map.Map String (Text,Int)
19 } deriving (Show, Typeable, Data)
24 } deriving (Show, Eq, Data, Typeable)
26data OneConstructor = OneConstructor
27 deriving (Show, Eq, Typeable, Data)
29data Product2 a b = Product2 a b
30 deriving (Show, Eq, Typeable, Data)
32data Product6 a b c d e f = Product6 a b c d e f
33 deriving (Show, Eq, Typeable, Data)
35data Sum4 a b c d = Alt1 a | Alt2 b | Alt3 c | Alt4 d
36 deriving (Show, Eq, Typeable, Data)
39 (=~) :: a -> a -> Bool
41newtype Approx a = Approx { fromApprox :: a }
42 deriving (Show, Data, Typeable, ApproxEq, Num)
44instance (ApproxEq a) => Eq (Approx a) where
45 Approx a == Approx b = a =~ b
47data Nullary = C1 | C2 | C3 deriving (Eq, Show)
49data SomeType a = Nullary
51 | Product String (Maybe Char) a
52 | Record { testOne :: Double
53 , testTwo :: Maybe Bool
54 , testThree :: Maybe a
57deriving instance Generic Foo
58deriving instance Generic UFoo
59deriving instance Generic OneConstructor
60deriving instance Generic (Product2 a b)
61deriving instance Generic (Product6 a b c d e f)
62deriving instance Generic (Sum4 a b c d)
63deriving instance Generic (Approx a)
64deriving instance Generic Nullary
65deriving instance Generic (SomeType a)
67failure :: Show a => String -> String -> a -> Property
68failure func msg v = counterexample
69 (func ++ " failed: " ++ msg ++ ", " ++ show v) False
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list