Add infix operators to HLint.
[haskell/symantic.git] / symantic-lib / Language / Symantic / Lib / Text.hs
index 9d5cec9bd734588e0d288577d2ee9666855f247c..49e93752d3390499b8b79eeb1e24ad9e5f41f5f9 100644 (file)
@@ -14,7 +14,7 @@ import Language.Symantic.Lib.Char ()
 import Language.Symantic.Lib.MonoFunctor (Element)
 
 -- * Class 'Sym_Text'
-type instance Sym (Proxy Text) = Sym_Text
+type instance Sym Text = Sym_Text
 class Sym_Text term where
        text :: Text -> term Text
        default text :: Sym_Text (UnT term) => Trans term => Text -> term Text
@@ -33,18 +33,20 @@ instance (Sym_Text r1, Sym_Text r2) => Sym_Text (Dup r1 r2) where
 instance (Sym_Text term, Sym_Lambda term) => Sym_Text (BetaT term)
 
 -- Typing
+instance NameTyOf Text where
+       nameTyOf _c = ["Text"] `Mod` "Text"
 instance ClassInstancesFor Text where
-       proveConstraintFor _ (TyApp _ (TyConst _ _ q) c)
+       proveConstraintFor _ (TyConst _ _ q :$ c)
         | Just HRefl <- proj_ConstKiTy @_ @Text c
         = case () of
-                _ | Just Refl <- proj_Const @Eq q                -> Just Dict
-                  | Just Refl <- proj_Const @MT.MonoFoldable q   -> Just Dict
-                  | Just Refl <- proj_Const @MT.MonoFunctor q    -> Just Dict
-                  | Just Refl <- proj_Const @Monoid q            -> Just Dict
-                  | Just Refl <- proj_Const @Ord q               -> Just Dict
-                  | Just Refl <- proj_Const @Seqs.IsSequence q   -> Just Dict
+                _ | Just Refl <- proj_Const @Eq                q -> Just Dict
+                  | Just Refl <- proj_Const @MT.MonoFoldable   q -> Just Dict
+                  | Just Refl <- proj_Const @MT.MonoFunctor    q -> Just Dict
+                  | Just Refl <- proj_Const @Monoid            q -> Just Dict
+                  | Just Refl <- proj_Const @Ord               q -> Just Dict
+                  | Just Refl <- proj_Const @Seqs.IsSequence   q -> Just Dict
                   | Just Refl <- proj_Const @Seqs.SemiSequence q -> Just Dict
-                  | Just Refl <- proj_Const @Show q              -> Just Dict
+                  | Just Refl <- proj_Const @Show              q -> Just Dict
                 _ -> Nothing
        proveConstraintFor _c _q = Nothing
 instance TypeInstancesFor Text where
@@ -59,9 +61,9 @@ instance Gram_Term_AtomsFor src ss g Text -- TODO
 instance ModuleFor src ss Text
 
 -- ** 'Type's
-tyText :: Source src => Inj_Len vs => Type src vs Text
+tyText :: Source src => LenInj vs => Type src vs Text
 tyText = tyConst @(K Text) @Text
 
 -- ** 'Term's
-teText :: Source src => Inj_Sym ss Text => Text -> Term src ss ts '[] Text
+teText :: Source src => SymInj ss Text => Text -> Term src ss ts '[] (() #> Text)
 teText t = Term noConstraint tyText $ teSym @Text $ text t