aboutsummaryrefslogtreecommitdiffstats
path: root/app/Tuple.hs
blob: 8b4327959253b82768ee2d854dc9f52fbe410113 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{-# OPTIONS_GHC -fno-warn-orphans #-}

module Tuple where

import GHC.Records (HasField (..))

instance HasField "_1" (a, b) a where
  getField (a, _) = a

instance HasField "_2" (a, b) b where
  getField (_, b) = b

instance HasField "_1" (a, b, c) a where
  getField (a, _, _) = a

instance HasField "_2" (a, b, c) b where
  getField (_, b, _) = b

instance HasField "_3" (a, b, c) c where
  getField (_, _, c) = c