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.Either where
10 import Language.Symantic.Type.Root
11 import Language.Symantic.Type.Type0
12 import Language.Symantic.Type.Type2
14 -- * Type 'Type_Either'
15 -- | The 'Either' type.
16 type Type_Either = Type_Type2 (Proxy Either)
18 type instance Constraint2_of (Proxy Either)
23 -> Type_Either root (Either a b)
24 pattern Type_Either a b
25 = Type_Type2 Proxy a b
27 instance -- String_from_Type
28 String_from_Type root =>
29 String_from_Type (Type_Either root) where
30 string_from_type (Type_Type2 _ a b) =
32 ++ " (" ++ string_from_type a ++ ")"
33 ++ " (" ++ string_from_type b ++ ")"
35 -- | Inject 'Type_Either' within a root type.
37 :: forall root h_a h_b.
38 Lift_Type_Root Type_Either root
41 -> root (Either h_a h_b)
42 type_either a b = lift_type_root
44 ::Type_Either root (Either h_a h_b))