File: GH24Spec.hs

package info (click to toggle)
haskell-deriving-compat 0.6.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 492 kB
  • sloc: haskell: 6,121; makefile: 5
file content (46 lines) | stat: -rw-r--r-- 872 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
39
40
41
42
43
44
45
46
{-# LANGUAGE CPP #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}

#if __GLASGOW_HASKELL__ >= 706
{-# LANGUAGE PolyKinds #-}
#endif

#if __GLASGOW_HASKELL__ >= 800 && __GLASGOW_HASKELL__ < 806
{-# LANGUAGE TypeInType #-}
#endif

{-|
Module:      GH24Spec
Copyright:   (C) 2019 Ryan Scott
License:     BSD-style (see the file LICENSE)
Maintainer:  Ryan Scott
Portability: Template Haskell

A regression test for
https://github.com/haskell-compat/deriving-compat/issues/24.
-}
module GH24Spec (main, spec) where

#if __GLASGOW_HASKELL__ >= 800
import Data.Deriving
#endif

import Prelude ()
import Prelude.Compat

import Test.Hspec

#if __GLASGOW_HASKELL__ >= 800
data family P (a :: j) (b :: k)
data instance P (a :: k) k = MkP deriving (Eq, Ord)

$(deriveEnum 'MkP)
$(deriveIx   'MkP)
#endif

main :: IO ()
main = hspec spec

spec :: Spec
spec = pure ()