1 {-# LANGUAGE FlexibleContexts #-}
2 {-# LANGUAGE FlexibleInstances #-}
3 {-# LANGUAGE MultiParamTypeClasses #-}
4 {-# LANGUAGE PatternSynonyms #-}
5 {-# LANGUAGE ScopedTypeVariables #-}
6 {-# LANGUAGE TypeFamilies #-}
7 {-# LANGUAGE UndecidableInstances #-}
8 {-# OPTIONS_GHC -fno-warn-orphans #-}
9 module Language.Symantic.Type.Text where
11 import qualified Data.MonoTraversable as MT
13 import Data.Text (Text)
15 import Language.Symantic.Type.Root
16 import Language.Symantic.Type.Type0
20 type Type_Text = Type_Type0 (Proxy Text)
22 pattern Type_Text :: Type_Type0 (Proxy Text) root Text
23 pattern Type_Text = Type_Type0 Proxy
25 instance Constraint_Type Eq (Type_Text root) where
26 constraint_type _c Type_Type0{} = Just Dict
27 instance Constraint_Type Ord (Type_Text root) where
28 constraint_type _c Type_Type0{} = Just Dict
29 instance Constraint_Type Monoid (Type_Text root) where
30 constraint_type _c Type_Type0{} = Just Dict
31 instance Constraint_Type Num (Type_Text root)
32 instance Constraint_Type Integral (Type_Text root)
33 instance Constraint_Type MT.MonoFunctor (Type_Text root) where
34 constraint_type _c Type_Type0{} = Just Dict
35 instance -- String_from_Type
36 String_from_Type (Type_Text root) where
37 string_from_type _ = "Text"
39 -- | Inject 'Type_Text' within a root type.
40 type_text :: Lift_Type_Root Type_Text root => root Text
41 type_text = type_type0