What does "instance [safe]" mean in ghci ":info" output?

Viewed 77

In ghci, I declare a data type as follows.

data Example = MakeExample deriving Show

Then, when I call :info Example to see that the derived Show instance is recognized, I get the following output.

> :i Example
data Example = MakeExample      -- Defined at <interactive>:17:1
instance [safe] Show Example -- Defined at <interactive>:17:37

The Show instance is recognized as expected. However, I do not understand why that [safe] is there.

By contrast, [safe] does not appear when I call :info on Bool.

> :i Bool
data Bool = False | True        -- Defined in ‘GHC.Types’
instance Bounded Bool -- Defined in ‘GHC.Enum’
instance Enum Bool -- Defined in ‘GHC.Enum’
instance Eq Bool -- Defined in ‘GHC.Classes’
instance Ord Bool -- Defined in ‘GHC.Classes’
instance Read Bool -- Defined in ‘GHC.Read’
instance Show Bool -- Defined in ‘GHC.Show’

What does instance [safe] mean in ghci's :info output?

0 Answers
Related