summaryrefslogtreecommitdiff
path: root/compiler/GHC/Data/Bool.hs
blob: b82658120f78b042b431c290a5138929ecdbd95b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module GHC.Data.Bool
  ( OverridingBool(..)
  , overrideWith
  )
where

import GHC.Prelude.Basic

data OverridingBool
  = Auto
  | Never
  | Always
  deriving
    ( Show
    , Read    -- ^ @since 9.4.1
    , Eq      -- ^ @since 9.4.1
    , Ord     -- ^ @since 9.4.1
    , Enum    -- ^ @since 9.4.1
    , Bounded -- ^ @since 9.4.1
    )

overrideWith :: Bool -> OverridingBool -> Bool
overrideWith b Auto   = b
overrideWith _ Never  = False
overrideWith _ Always = True