]> Git — Sourcephile - haskell/symantic.git/blob - Language/Symantic/Type/Text.hs
IO, Monoid, Foldable, Text
[haskell/symantic.git] / Language / Symantic / Type / Text.hs
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.Text where
8
9 import Data.Proxy
10 import Data.Text (Text)
11 import Language.Symantic.Type.Root
12 import Language.Symantic.Type.Type0
13
14 -- * Type 'Type_Text'
15 -- | The 'Text' type.
16 type Type_Text = Type_Type0 (Proxy Text)
17
18 pattern Type_Text :: Type_Type0 (Proxy Text) root Text
19 pattern Type_Text = Type_Type0 Proxy
20
21 instance -- String_from_Type
22 String_from_Type (Type_Text root) where
23 string_from_type _ = "Text"
24
25 -- | Inject 'Type_Text' within a root type.
26 type_text :: Lift_Type_Root Type_Text root => root Text
27 type_text = type_type0