{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Language.Symantic.Type.Tuple where import Data.Proxy import Language.Symantic.Type.Common -- * Type 'Type_Tuple2' -- | The (,) type. type Type_Tuple2 = Type_Type2 Constraint2_Empty (,) pattern Type_Tuple2 arg res = Type_Type2 Proxy Proxy arg res instance -- String_from_Type String_from_Type root => String_from_Type (Type_Tuple2 root) where string_from_type (Type_Type2 _ _ a b) = "(" ++ string_from_type a ++ ", " ++ string_from_type b ++ ")" -- | Convenient alias to include a 'Type_Tuple2' within a type. type_tuple2 :: forall root h_a h_b. Lift_Type_Root Type_Tuple2 root => root h_a -> root h_b -> root (h_a, h_b) type_tuple2 a b = lift_type_root (Type_Tuple2 a b ::Type_Tuple2 root (h_a, h_b))