summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/T13105.hs
blob: b2b23c74425f431f62b8fa8fd36529d98d19e570 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{-# LANGUAGE UnicodeSyntax, MagicHash, DataKinds, PolyKinds, TypeFamilies #-}

-- from Conal Elliott
-- Actually, this *should* work. But I want to put it in the testsuite
-- as a succeeding "compile_fail" test to make sure that we don't panic.

module RepRep where

import GHC.Exts

type family RepRep a ∷ RuntimeRep

class HasRep a where
  type Rep a ∷ TYPE (RepRep a)
  repr ∷ a → Rep a
  abst ∷ Rep a → a

type instance RepRep Int = IntRep

instance HasRep Int where
  type Rep Int = Int#
  abst n = I# n
  repr (I# n) = n