File: ImportUnsafe.hs

package info (click to toggle)
haskell-dlist 1.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 156 kB
  • sloc: haskell: 702; makefile: 2
file content (38 lines) | stat: -rwxr-xr-x 977 bytes parent folder | download | duplicates (2)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
{- ORMOLU_DISABLE -}
{-# LANGUAGE CPP #-}

-- CPP: GHC >= 7.8 for Safe Haskell
#if __GLASGOW_HASKELL__ >= 708
{-# LANGUAGE Safe #-}
#else
#error "Your GHC does not support Safe Haskell. That's okay!"
#endif

-----------------------------------------------------------------------------

{-|

This module is declared @Safe@ but imports a module declared @Unsafe@.
Therefore, any attempt to compile this module should fail.

We use @#error@ above just to make it fail for older versions of GHC that did
not support Safe Haskell.

Run this test in the top-level directory with the following command:

> ! ghc tests/ImportUnsafe.hs

-}
{- ORMOLU_ENABLE -}

module ImportUnsafe (main) where

-----------------------------------------------------------------------------

-- CPP: GHC >= 7.8 for Safe Haskell
#if __GLASGOW_HASKELL__ >= 708
import Data.DList.Unsafe ()
#endif

main :: IO ()
main = putStrLn "You should not see this message because this module should fail to compile."