blob: 82d6dcd1771800a080d9a0b1435cbdf15d6cd2e8 (
plain)
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
|
{-# Language RebindableSyntax, NoImplicitPrelude, MagicHash, RankNTypes,
PolyKinds, ViewPatterns, TypeInType, FlexibleInstances #-}
module Main where
import Prelude hiding (Eq (..), Num(..))
import qualified Prelude as P
import GHC.Prim
import GHC.Types
class XNum (a :: TYPE rep) where
(+) :: a -> a -> a
fromInteger :: Integer -> a
instance P.Num a => XNum a where
(+) = (P.+)
fromInteger = P.fromInteger
instance XNum Int# where
(+) = (+#)
fromInteger i = case fromInteger i of
I# n -> n
u :: Bool
u = isTrue# v_
where
v_ :: forall rep (a :: TYPE rep). XNum a => a
v_ = fromInteger 10
main = print u
|