]> Git — Sourcephile - haskell/symantic.git/blob - Language/Symantic/Type/Int.hs
Monad
[haskell/symantic.git] / Language / Symantic / Type / Int.hs
1 {-# LANGUAGE FlexibleContexts #-}
2 {-# LANGUAGE FlexibleInstances #-}
3 {-# LANGUAGE PatternSynonyms #-}
4 {-# LANGUAGE ScopedTypeVariables #-}
5 {-# LANGUAGE TypeFamilies #-}
6 {-# OPTIONS_GHC -fno-warn-orphans #-}
7 module Language.Symantic.Type.Int where
8
9 import Data.Proxy
10 import Language.Symantic.Type.Root
11 import Language.Symantic.Type.Type0
12
13 -- * Type 'Type_Int'
14 -- | The 'Int' type.
15 type Type_Int = Type_Type0 (Proxy Int)
16
17 pattern Type_Int :: Type_Type0 (Proxy Int) root Int
18 pattern Type_Int = Type_Type0 Proxy
19
20 instance -- String_from_Type
21 String_from_Type (Type_Int root) where
22 string_from_type _ = "Int"
23
24 -- | Inject 'Type_Int' within a root type.
25 type_int :: Lift_Type_Root Type_Int root => root Int
26 type_int = type_type0