blob: 201e7da742d275f1ab6133071ba6cf6a0bda97b9 (
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
31
32
33
34
35
36
|
{-# LANGUAGE MagicHash, UnboxedTuples, UnboxedSums, ScopedTypeVariables, TypeApplications, AllowAmbiguousTypes #-}
module Main where
import Type.Reflection
import Data.Proxy
import GHC.Types
import GHC.Prim
moduleOf :: forall a . Typeable a => String
moduleOf = case someTypeRep (Proxy @a) of
SomeTypeRep tr -> (show tr ++ ": " ++ (tyConModule $ typeRepTyCon tr))
main = do
-- These are in GHC.Types
putStrLn $ moduleOf @Levity
putStrLn $ moduleOf @'Lifted
putStrLn $ moduleOf @RuntimeRep
putStrLn $ moduleOf @'IntRep
putStrLn $ moduleOf @'BoxedRep
putStrLn $ moduleOf @'Lifted
putStrLn $ moduleOf @VecCount
putStrLn $ moduleOf @'Vec2
putStrLn $ moduleOf @VecElem
putStrLn $ moduleOf @'Int8ElemRep
-- This is from GHC.Tuple
putStrLn $ moduleOf @((),())
-- These are in GHC.Prim
putStrLn $ moduleOf @(# () , () #)
-- putStrLn $ moduleOf @(# () | () #)
--
putStrLn $ moduleOf @(Int64#)
putStrLn $ moduleOf @(Word64#)
putStrLn $ moduleOf @TYPE
putStrLn $ moduleOf @CONSTRAINT
|