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
11 import Language.Symantic.Type.Root
12 import Language.Symantic.Type.Type0
17 type Type_Unit = Type_Type0 (Proxy ())
19 pattern Type_Unit :: Type_Unit root ()
20 pattern Type_Unit = Type_Type0 Proxy
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 Constraint_Type Num (Type_Unit root)
28 instance Constraint_Type Integral (Type_Unit root)
29 instance -- String_from_Type
30 String_from_Type (Type_Unit root) where
31 string_from_type _ = "()"
33 -- | Inject 'Type_Unit' within a root type.
34 type_unit :: Lift_Type_Root Type_Unit root => root ()
35 type_unit = type_type0