File: Reify.hs

package info (click to toggle)
haskell-type-level-numbers 0.1.1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 136 kB
  • sloc: haskell: 663; makefile: 5
file content (27 lines) | stat: -rw-r--r-- 695 bytes parent folder | download | duplicates (5)
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
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE DeriveDataTypeable    #-}
-- |
-- Module      : TypeLevel.Reify
-- Copyright   : Alexey Khudyakov
-- License     : BSD3-style (see LICENSE)
--
-- Maintainer  : Alexey Khudyakov <alexey.skladnoy@gmail.com>
-- Stability   : unstable
-- Portability : unportable (GHC only)
module TypeLevel.Reify ( Witness(..)
                       , Reify(..)
                       ) where

import Data.Data (Data,Typeable)


-- | Value with type tag
data Witness t a = Witness { getValue :: a }
                   deriving (Show,Eq,Typeable,Data)

-- | Convert type level into value level using 
class Reify t a where
  witness :: Witness t a