1{-# LANGUAGE FlexibleInstances #-}
3{-# LANGUAGE GeneralizedNewtypeDeriving #-}
4{-# LANGUAGE StandaloneDeriving #-}
5{-# LANGUAGE TypeFamilies #-}
7module DataFamilies.Types where
9import Types (ApproxEq(..))
12data instance Nullary Int = C1 | C2 | C3 deriving (Eq, Show)
13data instance Nullary Char = C4 deriving (Eq, Show)
15data family SomeType a b c
16data instance SomeType c () a = Nullary
18 | Product String (Maybe Char) a
19 | Record { testOne :: Double
20 , testTwo :: Maybe Bool
21 , testThree :: Maybe a
25newtype instance Approx a = Approx { fromApprox :: a }
26 deriving (Show, ApproxEq, Num)
28instance (ApproxEq a) => Eq (Approx a) where
29 Approx a == Approx b = a =~ b
32data instance GADT a where
33 GADT :: { gadt :: String } -> GADT String
35deriving instance Eq (GADT a)
36deriving instance Show (GADT a)
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