]> Git — Sourcephile - haskell/symantic.git/blob - Language/Symantic/Type/Unit.hs
Map
[haskell/symantic.git] / Language / Symantic / Type / Unit.hs
1 {-# LANGUAGE FlexibleContexts #-}
2 {-# LANGUAGE FlexibleInstances #-}
3 {-# LANGUAGE MultiParamTypeClasses #-}
4 {-# LANGUAGE PatternSynonyms #-}
5 {-# LANGUAGE ScopedTypeVariables #-}
6 {-# LANGUAGE TypeFamilies #-}
7 {-# OPTIONS_GHC -fno-warn-orphans #-}
8 module Language.Symantic.Type.Unit where
9
10 import Data.Proxy
11 import Language.Symantic.Type.Root
12 import Language.Symantic.Type.Type0
13
14
15 -- * Type 'Type_Unit'
16 -- | The @()@ type.
17 type Type_Unit = Type_Type0 (Proxy ())
18
19 pattern Type_Unit :: Type_Unit root ()
20 pattern Type_Unit = Type_Type0 Proxy
21
22 instance Constraint_Type Eq (Type_Unit root) where
23 constraint_type _c Type_Type0{} = Just Dict
24 instance Constraint_Type Ord (Type_Unit root) where
25 constraint_type _c Type_Type0{} = Just Dict
26 instance Constraint_Type Monoid (Type_Unit root)
27 instance -- String_from_Type
28 String_from_Type (Type_Unit root) where
29 string_from_type _ = "()"
30
31 -- | Inject 'Type_Unit' within a root type.
32 type_unit :: Lift_Type_Root Type_Unit root => root ()
33 type_unit = type_type0