blob: be6016d032d384ade2b93090939a3dd21a9c7731 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
.. _safe-imports-ext:
Safe imports
~~~~~~~~~~~~
With the :extension:`Safe`, :extension:`Trustworthy` and :extension:`Unsafe`
language flags, GHC extends the import declaration syntax to take an optional
``safe`` keyword after the ``import`` keyword. This feature is part of the Safe
Haskell GHC extension. For example: ::
import safe qualified Network.Socket as NS
would import the module ``Network.Socket`` with compilation only
succeeding if ``Network.Socket`` can be safely imported. For a description of
when a import is considered safe see :ref:`safe-haskell`.
|