packages feed

symantic 6.3.0.20170807 → 6.3.1.20180213

raw patch · 14 files changed

+150/−137 lines, 14 filesdep ~containersdep ~mono-traversabledep ~textPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: containers, mono-traversable, text, transformers

API changes (from Hackage documentation)

- Language.Symantic.Compiling.Grammar: class (Gram_Source src g, Gram_Error Error_Term_Gram g, Gram_Terminal g, Gram_Rule g, Gram_Alt g, Gram_App g, Gram_AltApp g, Gram_CF g, Gram_Comment g, Gram_Type src g, Gram_Term_Name g, Gram_Term_Type src g, Gram_Term_Atoms src ss g, Gram_State (Imports NameTe, Modules src ss) g) => Gram_Term src ss g where g_term = rule "term" $ choice [try g_term_abst, g_term_operators, g_term_let] g_term_operators = rule "term_operators" $ catch $ left Error_Term_Gram_Fixity <$> g_ops where g_ops :: CF g (Either Error_Fixity (AST_Term src ss)) g_ops = operators g_term_atom g_prefix g_infix g_postfix g_prefix :: CF g (Unifix, AST_Term src ss -> AST_Term src ss) g_infix :: CF g (Infix, AST_Term src ss -> AST_Term src ss -> AST_Term src ss) g_postfix :: CF g (Unifix, AST_Term src ss -> AST_Term src ss) g_prefix = catch $ source $ getAfter $ op_prefix <$> g_prefix_op g_infix = catch $ source $ getAfter $ op_infix <$> g_infix_op g_postfix = catch $ source $ getAfter $ op_postfix <$> g_postfix_op op_infix :: Mod NameTe -> (Imports NameTe, Modules src ss) -> src -> Either Error_Term_Gram (Infix, AST_Term src ss -> AST_Term src ss -> AST_Term src ss) op_infix name (imps, mods) src = do { t <- Error_Term_Gram_Module `left` lookupDefTerm FixyInfix imps name mods; Right $ (token_fixity t,) $ \ a b -> (BinTree0 (token_term t src) `BinTree2` a) `BinTree2` b } op_prefix, op_postfix :: Mod NameTe -> (Imports NameTe, Modules src ss) -> src -> Either Error_Term_Gram (Unifix, AST_Term src ss -> AST_Term src ss) op_prefix name (imps, mods) src = do { t <- Error_Term_Gram_Module `left` lookupDefTerm FixyPrefix imps name mods; Right $ (token_fixity t,) $ \ a -> BinTree0 (token_term t src) `BinTree2` a } op_postfix name (imps, mods) src = do { t <- Error_Term_Gram_Module `left` lookupDefTerm FixyPostfix imps name mods; Right $ (token_fixity t,) $ \ a -> BinTree0 (token_term t src) `BinTree2` a } g_postfix_op :: CF g (Mod NameTe) g_postfix_op = rule "term_op_postfix" $ lexeme $ g_backquote *> g_ModNameTeId <+> g_ModNameTeOp g_infix_op :: CF g (Mod NameTe) g_infix_op = rule "term_op_infix" $ lexeme $ between g_backquote g_backquote g_ModNameTeId <+> try (const <$> g_ModNameTeOp <*> (string " " <+> string "\n")) <+> pure (Mod [] " ") g_prefix_op :: CF g (Mod NameTe) g_prefix_op = rule "term_op_prefix" $ lexeme $ g_ModNameTeId <* g_backquote <+> g_ModNameTeOp g_backquote :: Gram_Terminal g' => g' Char g_backquote = char '`' g_term_atom = rule "term_atom" $ choice $ (try <$> g_term_atomsR @_ @_ @ss) <> [try $ catch $ source $ getAfter $ (\ m (imps, mods) src -> case lookupDefTerm FixyInfix imps m mods of { Right t -> Right $ BinTree0 $ token_term t src Left err -> case m of { [] `Mod` n -> Right $ BinTree0 $ Token_Term_Var src n _ -> Left $ Error_Term_Gram_Module err } }) <$> g_ModNameTe, g_term_group] g_term_group = rule "term_group" $ parens g_term g_term_abst = rule "term_abst" $ source $ ((\ (xs, te) src -> foldr (\ (x, ty_x) -> BinTree0 . Token_Term_Abst src x ty_x) te xs) <$>) $ g_term_abst_args_body (symbol "\\" *> some g_term_abst_decl <* symbol "->") g_term g_term_abst_args_body cf_args cf_body = stateBefore $ (\ a b (imps :: Imports NameTe, mods :: Modules src ss) -> ((imps, mods), (a, b))) <$> stateAfter ((<$> cf_args) $ \ args (imps :: Imports NameTe, mods) -> ((setArgsImps args imps, setArgsMods args mods), args)) <*> cf_body where setArgsImps args (Imports imps) = Imports $ alter (alterArgsImps args) [] imps alterArgsImps args = \case { Nothing -> Just mempty Just m -> Just $ mapMapFixity (delArgImp args) m } delArgImp :: [(NameTe, _a)] -> Map NameTe PathMod -> Map NameTe PathMod delArgImp = flip $ foldr $ \ (n, _) -> delete n setArgsMods args (Modules mods) = Modules $ alter (alterArgsMods args) [] mods alterArgsMods args = \case { Nothing -> Just (moduleEmpty {byInfix = mempty `insArgMod` args}) Just m -> Just (m {byPrefix = byPrefix m `delArgMod` args, byInfix = byInfix m `insArgMod` args, byPostfix = byPostfix m `delArgMod` args}) } delArgMod :: ModuleFixy src ss Unifix -> [(NameTe, _a)] -> ModuleFixy src ss Unifix delArgMod = foldr $ \ (n, _) -> delete n insArgMod :: ModuleFixy src ss Infix -> [(NameTe, _a)] -> ModuleFixy src ss Infix insArgMod = foldr $ \ (n, _) -> insert n (Tokenizer {token_term = (`Token_Term_Var` n), token_fixity = infixN5}) g_term_let = rule "term_let" $ source $ (\ name args bound body src -> BinTree0 $ Token_Term_Let src name (foldr (\ (x, ty_x) -> BinTree0 . Token_Term_Abst src x ty_x) bound args) body) <$ symbol "let" <*> g_NameTe <*> many g_term_abst_decl <* symbol "=" <*> g_term <* symbol "in" <*> g_term
- Language.Symantic.Compiling.Grammar: g_NameTeKey :: Gram_Term_Name g => Reg rl g String
- Language.Symantic.Compiling.Grammar: g_NameTeKeySym :: Gram_Term_Name g => Reg rl g String
- Language.Symantic.Compiling.Grammar: instance forall k src (ss :: [GHC.Types.Type]) (g :: * -> *) (t :: k) (rs :: [GHC.Types.*]). (Language.Symantic.Compiling.Grammar.Gram_Term_AtomsFor src ss g t, Language.Symantic.Compiling.Grammar.Gram_Term_AtomsR src ss rs g) => Language.Symantic.Compiling.Grammar.Gram_Term_AtomsR src ss (Data.Proxy.Proxy t : rs) g
- Language.Symantic.Compiling.Module: instance forall k src (ss :: [GHC.Types.Type]) (s :: k) (rs :: [GHC.Types.*]). (Language.Symantic.Compiling.Module.ModuleFor src ss s, Language.Symantic.Compiling.Module.ModulesInjR src ss rs) => Language.Symantic.Compiling.Module.ModulesInjR src ss (Data.Proxy.Proxy s : rs)
- Language.Symantic.Compiling.Term: instance forall k k1 p (ss :: [GHC.Types.Type]) (s :: k1) (not_s :: k). Language.Symantic.Compiling.Term.SymInjP p ss s => Language.Symantic.Compiling.Term.SymInjP (Language.Symantic.Typing.Peano.Succ p) (Data.Proxy.Proxy not_s : ss) s
- Language.Symantic.Typing.Grammar: g_type_name_const :: Gram_Type src g => CF g (AST_Type src)
- Language.Symantic.Typing.Grammar: g_type_name_var :: Gram_Type src g => CF g (AST_Type src)
- Language.Symantic.Typing.Show: instance forall kt src (vs :: [GHC.Types.Type]) (t :: kt). Language.Symantic.Grammar.Source.Source src => GHC.Show.Show (Language.Symantic.Typing.Type.Type src vs t)
- Language.Symantic.Typing.Type: class (x ~ y) => (#~) x y
- Language.Symantic.Typing.Type: data (:~~:) (a :: ka) (b :: kb)
- Language.Symantic.Typing.Type: data Proxy k (t :: k) :: forall k. k -> *
- Language.Symantic.Typing.Type: instance Language.Symantic.Typing.Module.NameTyOf (() :: Constraint)
- Language.Symantic.Typing.Type: instance Language.Symantic.Typing.Type.ClassInstancesFor (() :: Constraint)
- Language.Symantic.Typing.Type: instance Language.Symantic.Typing.Type.TypeInstancesFor (() :: Constraint)
- Language.Symantic.Typing.Type: instance forall k (k1 :: k) k2. (Language.Symantic.Typing.Kind.KindInj k2, Data.Typeable.Internal.Typeable k2) => Language.Symantic.Typing.Type.ClassInstancesFor (Language.Symantic.Typing.Type.#~)
- Language.Symantic.Typing.Type: instance forall kt src (vs :: [GHC.Types.Type]) (t :: kt). Language.Symantic.Grammar.Source.Source src => GHC.Classes.Eq (Language.Symantic.Typing.Type.Type src vs t)
- Language.Symantic.Typing.Type: instance forall kt src (vs :: [GHC.Types.Type]) (t :: kt). Language.Symantic.Grammar.Source.Source src => Language.Symantic.Grammar.Source.Sourced (Language.Symantic.Typing.Type.Type src vs t)
- Language.Symantic.Typing.Type: instance forall kt src (vs :: [GHC.Types.Type]) (t :: kt). Language.Symantic.Typing.Type.ConstsOf (Language.Symantic.Typing.Type.Type src vs t)
- Language.Symantic.Typing.Type: instance forall kt src (vs :: [GHC.Types.Type]) (t :: kt). Language.Symantic.Typing.Type.ExpandFam (Language.Symantic.Typing.Type.Type src vs t)
- Language.Symantic.Typing.Type: instance forall kt src (vs :: [GHC.Types.Type]) (t :: kt). Language.Symantic.Typing.Variable.LenVars (Language.Symantic.Typing.Type.Type src vs t)
- Language.Symantic.Typing.Type: instance forall kt src (vs :: [GHC.Types.Type]) (t :: kt). Language.Symantic.Typing.Variable.UsedVarsOf (Language.Symantic.Typing.Type.Type src vs t)
- Language.Symantic.Typing.Type: instance forall kt src (vs :: [GHC.Types.Type]) (t :: kt). Language.Symantic.Typing.Variable.VarOccursIn (Language.Symantic.Typing.Type.Type src vs t)
- Language.Symantic.Typing.Unify: instance forall kt src (vs :: [GHC.Types.Type]) (t :: kt). Language.Symantic.Typing.Unify.Substable (Language.Symantic.Typing.Type.Type src vs t)
- Language.Symantic.Typing.Variable: [HRefl] :: a :~~: a
- Language.Symantic.Typing.Variable: data (:~~:) (a :: ka) (b :: kb)
- Language.Symantic.Typing.Variable: instance forall kv src (tys :: [GHC.Types.Type]) (v :: kv). GHC.Show.Show (Language.Symantic.Typing.Variable.Var src tys v)
- Language.Symantic.Typing.Variable: instance forall kv src (vs :: [GHC.Types.Type]) (v :: kv). Language.Symantic.Typing.Variable.LenVars (Language.Symantic.Typing.Variable.Var src vs v)
+ Language.Symantic.Compiling.Grammar: class (Gram_Source src g, Gram_Error Error_Term_Gram g, Gram_Char g, Gram_Rule g, Gram_Alt g, Gram_App g, Gram_AltApp g, Gram_CF g, Gram_Comment g, Gram_Type src g, Gram_Term_Name g, Gram_Term_Type src g, Gram_Term_Atoms src ss g, Gram_State (Imports NameTe, Modules src ss) g) => Gram_Term src ss g
+ Language.Symantic.Compiling.Grammar: g_NameTeIdKey :: Gram_Term_Name g => Reg rl g String
+ Language.Symantic.Compiling.Grammar: g_NameTeOpKey :: Gram_Term_Name g => Reg rl g String
+ Language.Symantic.Compiling.Grammar: instance forall k src (ss :: [*]) (g :: * -> *) (t :: k) (rs :: [*]). (Language.Symantic.Compiling.Grammar.Gram_Term_AtomsFor src ss g t, Language.Symantic.Compiling.Grammar.Gram_Term_AtomsR src ss rs g) => Language.Symantic.Compiling.Grammar.Gram_Term_AtomsR src ss (Data.Proxy.Proxy t : rs) g
+ Language.Symantic.Compiling.Module: instance forall k src (ss :: [*]) (s :: k) (rs :: [*]). (Language.Symantic.Compiling.Module.ModuleFor src ss s, Language.Symantic.Compiling.Module.ModulesInjR src ss rs) => Language.Symantic.Compiling.Module.ModulesInjR src ss (Data.Proxy.Proxy s : rs)
+ Language.Symantic.Compiling.Term: instance forall k1 k2 p (ss :: [*]) (s :: k2) (not_s :: k1). Language.Symantic.Compiling.Term.SymInjP p ss s => Language.Symantic.Compiling.Term.SymInjP (Language.Symantic.Typing.Peano.Succ p) (Data.Proxy.Proxy not_s : ss) s
+ Language.Symantic.Typing.Grammar: g_type_const :: Gram_Type src g => CF g (AST_Type src)
+ Language.Symantic.Typing.Grammar: g_type_var :: Gram_Type src g => CF g (AST_Type src)
+ Language.Symantic.Typing.Show: instance forall kt src (vs :: [*]) (t :: kt). Language.Symantic.Grammar.Source.Source src => GHC.Show.Show (Language.Symantic.Typing.Type.Type src vs t)
+ Language.Symantic.Typing.Type: class (x ~ y) => x #~ y
+ Language.Symantic.Typing.Type: data (:~:) k (a :: k) (b :: k) :: forall k. () => k -> k -> *
+ Language.Symantic.Typing.Type: data (:~~:) k1 k2 (a :: k1) (b :: k2) :: forall k1 k2. () => k1 -> k2 -> *
+ Language.Symantic.Typing.Type: instance Language.Symantic.Typing.Module.NameTyOf () :: Constraint
+ Language.Symantic.Typing.Type: instance Language.Symantic.Typing.Type.ClassInstancesFor () :: Constraint
+ Language.Symantic.Typing.Type: instance Language.Symantic.Typing.Type.TypeInstancesFor () :: Constraint
+ Language.Symantic.Typing.Type: instance forall k1 (k2 :: k1) k3. (Language.Symantic.Typing.Kind.KindInj k3, Data.Typeable.Internal.Typeable k3) => Language.Symantic.Typing.Type.ClassInstancesFor (Language.Symantic.Typing.Type.#~)
+ Language.Symantic.Typing.Type: instance forall kt src (vs :: [*]) (t :: kt). Language.Symantic.Grammar.Source.Source src => GHC.Classes.Eq (Language.Symantic.Typing.Type.Type src vs t)
+ Language.Symantic.Typing.Type: instance forall kt src (vs :: [*]) (t :: kt). Language.Symantic.Grammar.Source.Source src => Language.Symantic.Grammar.Source.Sourced (Language.Symantic.Typing.Type.Type src vs t)
+ Language.Symantic.Typing.Type: instance forall kt src (vs :: [*]) (t :: kt). Language.Symantic.Typing.Type.ConstsOf (Language.Symantic.Typing.Type.Type src vs t)
+ Language.Symantic.Typing.Type: instance forall kt src (vs :: [*]) (t :: kt). Language.Symantic.Typing.Type.ExpandFam (Language.Symantic.Typing.Type.Type src vs t)
+ Language.Symantic.Typing.Type: instance forall kt src (vs :: [*]) (t :: kt). Language.Symantic.Typing.Variable.LenVars (Language.Symantic.Typing.Type.Type src vs t)
+ Language.Symantic.Typing.Type: instance forall kt src (vs :: [*]) (t :: kt). Language.Symantic.Typing.Variable.UsedVarsOf (Language.Symantic.Typing.Type.Type src vs t)
+ Language.Symantic.Typing.Type: instance forall kt src (vs :: [*]) (t :: kt). Language.Symantic.Typing.Variable.VarOccursIn (Language.Symantic.Typing.Type.Type src vs t)
+ Language.Symantic.Typing.Unify: instance forall kt src (vs :: [*]) (t :: kt). Language.Symantic.Typing.Unify.Substable (Language.Symantic.Typing.Type.Type src vs t)
+ Language.Symantic.Typing.Variable: instance forall kv src (tys :: [*]) (v :: kv). GHC.Show.Show (Language.Symantic.Typing.Variable.Var src tys v)
+ Language.Symantic.Typing.Variable: instance forall kv src (vs :: [*]) (v :: kv). Language.Symantic.Typing.Variable.LenVars (Language.Symantic.Typing.Variable.Var src vs v)
- Language.Symantic.Compiling.Beta: betaTerm :: forall src ss es vs fun arg. SourceInj (TypeVT src) src => Constable (->) => Term src ss es vs (fun :: Type) -> Term src ss es vs (arg :: Type) -> Either (Error_Beta src) (TermT src ss es vs)
+ Language.Symantic.Compiling.Beta: betaTerm :: forall src ss ts vs fun arg. SourceInj (TypeVT src) src => Constable (->) => Term src ss ts vs (fun :: Type) -> Term src ss ts vs (arg :: Type) -> Either (Error_Beta src) (TermT src ss ts vs)
- Language.Symantic.Compiling.Beta: betaTerms :: SourceInj (TypeVT src) src => Constable (->) => BinTree (TermVT src ss es) -> Either (Error_Beta src) (TermVT src ss es)
+ Language.Symantic.Compiling.Beta: betaTerms :: SourceInj (TypeVT src) src => Constable (->) => BinTree (TermVT src ss ts) -> Either (Error_Beta src) (TermVT src ss ts)
- Language.Symantic.Compiling.Grammar: class Gram_Term_AtomsFor src ss g t where g_term_atomsFor = []
+ Language.Symantic.Compiling.Grammar: class Gram_Term_AtomsFor src ss g t
- Language.Symantic.Compiling.Grammar: class (Gram_Terminal g, Gram_Rule g, Gram_Alt g, Gram_Try g, Gram_App g, Gram_AltApp g, Gram_RegL g, Gram_CF g, Gram_Comment g, Gram_Op g, Gram_Mod g) => Gram_Term_Name g where g_ModNameTe = rule "ModNameTe" $ lexeme $ g_ModNameTeId <+> parens g_ModNameTeOp g_NameTe = rule "NameTe" $ lexeme $ g_NameTeId <+> parens g_NameTeOp g_ModNameTeId = rule "ModNameTeId" $ Mod <$> option [] (try $ g_PathMod <* char '.') <*> g_NameTeId g_NameTeId = rule "NameTeId" $ (NameTe . pack <$>) $ (identG `minus`) $ const <$> g_NameTeKey <*. (any `but` g_NameTeIdTail) where identG = (:) <$> headG <*> many (cfOf g_NameTeIdTail) headG = unicat $ Unicat_Letter g_NameTeIdTail = rule "NameTeIdTail" $ unicat Unicat_Letter <+> unicat Unicat_Number g_NameTeKey = rule "NameTeKey" $ choice $ string <$> ["in", "let"] g_ModNameTeOp = rule "ModNameTeOp" $ Mod <$> option [] (try $ g_PathMod <* char '.') <*> g_NameTeOp g_NameTeOp = rule "NameTeOp" $ (NameTe . pack <$>) $ (some (cfOf g_NameTeOpOk) `minus`) $ const <$> g_NameTeKeySym <*. (any `but` g_NameTeOpOk) g_NameTeOpOk = rule "NameTeOpOk" $ choice (unicat <$> [Unicat_Symbol, Unicat_Punctuation, Unicat_Mark]) `but` koG where koG = choice (char <$> ['(', ')', '`', '\'', ',', '[', ']']) g_NameTeKeySym = rule "NameTeKeySym" $ choice $ string <$> ["\\", "->", "=", "@"]
+ Language.Symantic.Compiling.Grammar: class (Gram_Char g, Gram_Rule g, Gram_Alt g, Gram_Try g, Gram_App g, Gram_AltApp g, Gram_RegL g, Gram_CF g, Gram_Comment g, Gram_Op g, Gram_Mod g) => Gram_Term_Name g
- Language.Symantic.Compiling.Grammar: class (Gram_Terminal g, Gram_Rule g, Gram_Alt g, Gram_AltApp g, Gram_App g, Gram_CF g, Gram_Comment g, Gram_Term_Name g, Gram_Type src g) => Gram_Term_Type src g where g_term_abst_decl = rule "term_abst_decl" $ parens $ (,) <$> g_NameTe <* (symbol "::" <+> symbol ":") <*> g_type
+ Language.Symantic.Compiling.Grammar: class (Gram_Char g, Gram_Rule g, Gram_Alt g, Gram_AltApp g, Gram_App g, Gram_CF g, Gram_Comment g, Gram_Term_Name g, Gram_Type src g) => Gram_Term_Type src g
- Language.Symantic.Compiling.Module: class ModuleFor src ss s where moduleFor = ([], moduleEmpty)
+ Language.Symantic.Compiling.Module: class ModuleFor src ss s
- Language.Symantic.Compiling.Term: class Sym_Lambda term where apply = trans apply app = trans2 app lam f = trans $ lam (unTrans . f . trans) let_ x f = lam f `app` x lam1 = lam qual q = trans1 (qual q)
+ Language.Symantic.Compiling.Term: class Sym_Lambda term
- Language.Symantic.Transforming.Trans: class Trans tr where type UnT tr :: * -> * trans1 f = trans . f . unTrans trans2 f t1 t2 = trans $ f (unTrans t1) (unTrans t2) trans3 f t1 t2 t3 = trans $ f (unTrans t1) (unTrans t2) (unTrans t3) where {
+ Language.Symantic.Transforming.Trans: class Trans tr where {
- Language.Symantic.Typing.Grammar: class (Gram_Terminal g, Gram_Rule g, Gram_Alt g, Gram_Try g, Gram_App g, Gram_AltApp g, Gram_RegL g, Gram_CF g, Gram_Comment g, Gram_Op g) => Gram_Mod g where g_PathMod = rule "PathMod" $ infixrG (pure <$> g_NameMod) (op <$ char '.') where op = (<>) g_NameMod = rule "NameMod" $ NameMod . pack <$> identG where identG = (:) <$> headG <*> many (cfOf tailG) headG = unicat $ Unicat UppercaseLetter tailG :: Terminal g Char tailG = unicat Unicat_Letter <+> unicat Unicat_Number
+ Language.Symantic.Typing.Grammar: class (Gram_Char g, Gram_Rule g, Gram_Alt g, Gram_Try g, Gram_App g, Gram_AltApp g, Gram_RegL g, Gram_CF g, Gram_Comment g, Gram_Op g) => Gram_Mod g
- Language.Symantic.Typing.Grammar: class (Gram_Source src g, Gram_Terminal g, Gram_Rule g, Gram_Alt g, Gram_Try g, Gram_App g, Gram_AltApp g, Gram_CF g, Gram_Comment g, Gram_Op g, Gram_Type_Name g, Gram_Error (Error_Type src) g, Gram_State (Imports NameTy, ModulesTy src) g, Constable (->), Constable [], Constable (,)) => Gram_Type src g where g_type = rule "type" $ g_type_fun g_type_fun = rule "type_fun" $ infixrG g_type_list (source $ op <$ symbol "->") where op src = BinTree2 . BinTree2 (BinTree0 $ Token_Type_Const $ typeTLen @(->) src) g_type_list = rule "type_list" $ source $ inside mk (symbol "[") (optional g_type) (symbol "]") (const <$> g_type_tuple2) where mk Nothing src = tok src mk (Just a) src = BinTree2 (tok src) a tok = BinTree0 . Token_Type_Const . typeTLen @[] g_type_tuple2 = rule "type_tuple2" $ try (parens (infixrG (g_type) (source $ op <$ symbol ","))) <+> (g_type_app) where op src = BinTree2 . BinTree2 (BinTree0 $ Token_Type_Const $ typeTLen @(,) src) g_type_app = rule "type_app" $ foldl1' BinTree2 <$> some (g_type_atom) g_type_atom = rule "type_atom" $ try (parens g_type) <+> g_type_name_const <+> g_type_name_var g_type_name_const = rule "type_name_const" $ lexeme $ catch $ source $ getBefore $ (\ n (impsTy, modsTy) src -> BinTree0 . Token_Type_Const <$> readTyName impsTy modsTy src n) <$> g_ModNameTy g_type_name_var = rule "type_name_var" $ lexeme $ source $ (\ n ns src -> BinTree0 $ Token_Type_Var $ At src $ fromString $ n : ns) <$> unicat (Unicat LowercaseLetter) <*> many (choice $ unicat <$> [Unicat_Letter, Unicat_Number])
+ Language.Symantic.Typing.Grammar: class (Gram_Source src g, Gram_Char g, Gram_Rule g, Gram_Alt g, Gram_Try g, Gram_App g, Gram_AltApp g, Gram_CF g, Gram_Comment g, Gram_Op g, Gram_Type_Name g, Gram_Error (Error_Type src) g, Gram_State (Imports NameTy, ModulesTy src) g, Constable (->), Constable [], Constable (,)) => Gram_Type src g
- Language.Symantic.Typing.Grammar: class (Gram_Terminal g, Gram_Rule g, Gram_Alt g, Gram_Try g, Gram_App g, Gram_AltApp g, Gram_RegL g, Gram_CF g, Gram_Comment g, Gram_Op g, Gram_Mod g) => Gram_Type_Name g where g_ModNameTy = rule "ModNameTy" $ lexeme $ g_ModNameTyId <+> parens g_ModNameTyOp g_ModNameTyId = rule "ModNameTyId" $ Mod <$> option [] (try $ g_PathMod <* char '.') <*> g_NameTyId g_NameTyId = rule "NameTyId" $ NameTy . pack <$> identTyG where identTyG = (:) <$> headTyG <*> many (cfOf tailTyG) headTyG = unicat $ Unicat UppercaseLetter tailTyG :: Terminal g Char tailTyG = unicat Unicat_Letter <+> unicat Unicat_Number g_ModNameTyOp = rule "ModNameTyOp" $ Mod <$> option [] (try $ g_PathMod <* char '.') <*> g_NameTyOp g_NameTyOp = rule "NameTyOp" $ NameTy . pack <$> many (cfOf okG) where okG :: Terminal g Char okG = choice (unicat <$> [Unicat_Symbol, Unicat_Punctuation, Unicat_Mark]) `but` koG koG = choice (char <$> ['(', ')', '`', '\'', '[', ']'])
+ Language.Symantic.Typing.Grammar: class (Gram_Char g, Gram_Rule g, Gram_Alt g, Gram_Try g, Gram_App g, Gram_AltApp g, Gram_RegL g, Gram_CF g, Gram_Comment g, Gram_Op g, Gram_Mod g) => Gram_Type_Name g
- Language.Symantic.Typing.Module: class FixityOf (c :: kc) where fixityOf _c = Nothing
+ Language.Symantic.Typing.Module: class FixityOf (c :: kc)
- Language.Symantic.Typing.Module: class NameTyOf (c :: kc) where nameTyOf c = path (tyConModule repr) `Mod` fromString (tyConName repr) where repr = typeRepTyCon (typeRep c) path = fmap fromString . lines . fmap (\case { '.' -> '\n' x -> x }) isNameTyOp c = let _m `Mod` NameTy n = nameTyOf c in isOp n where isOp = all $ \case { '_' -> False '\'' -> False x -> case generalCategory x of { NonSpacingMark -> True SpacingCombiningMark -> True EnclosingMark -> True ConnectorPunctuation -> True DashPunctuation -> True OpenPunctuation -> True ClosePunctuation -> True InitialQuote -> True FinalQuote -> True OtherPunctuation -> True MathSymbol -> True CurrencySymbol -> True ModifierSymbol -> True OtherSymbol -> True UppercaseLetter -> False LowercaseLetter -> False TitlecaseLetter -> False ModifierLetter -> False OtherLetter -> False DecimalNumber -> False LetterNumber -> False OtherNumber -> False Space -> False LineSeparator -> False ParagraphSeparator -> False Control -> False Format -> False Surrogate -> False PrivateUse -> False NotAssigned -> False } }
+ Language.Symantic.Typing.Module: class NameTyOf (c :: kc)
- Language.Symantic.Typing.Type: [HRefl] :: a :~~: a
+ Language.Symantic.Typing.Type: [HRefl] :: (:~~:) k1 k1 a a
- Language.Symantic.Typing.Type: class ClassInstancesFor c where proveConstraintFor _c _q = Nothing
+ Language.Symantic.Typing.Type: class ClassInstancesFor c
- Language.Symantic.Typing.Type: class TypeInstancesFor (c :: kc) where expandFamFor _c _len _fam _as = Nothing
+ Language.Symantic.Typing.Type: class TypeInstancesFor (c :: kc)

Files

Language/Symantic/Compiling/Beta.hs view
@@ -11,12 +11,12 @@ -- | Term application: apply second given 'TermT' to the first, -- applying embedded 'TeSym's, or return an error. betaTerm ::- forall src ss es vs fun arg.+ forall src ss ts vs fun arg.  SourceInj (TypeVT src) src =>  Constable (->) =>- Term src ss es vs (fun::K.Type) ->- Term src ss es vs (arg::K.Type) ->- Either (Error_Beta src) (TermT src ss es vs)+ Term src ss ts vs (fun::K.Type) ->+ Term src ss ts vs (arg::K.Type) ->+ Either (Error_Beta src) (TermT src ss ts vs) betaTerm (Term qf tf (TeSym te_fun)) (Term qa ta (TeSym te_arg)) = 	case tf of 	 TyApp _ (TyApp _ a2b a2b_a) a2b_b@@ -41,8 +41,8 @@ betaTerms ::  SourceInj (TypeVT src) src =>  Constable (->) =>- BinTree (TermVT src ss es) ->- Either (Error_Beta src) (TermVT src ss es)+ BinTree (TermVT src ss ts) ->+ Either (Error_Beta src) (TermVT src ss ts) betaTerms t = 	collapseBT (\acc ele -> do 		TermVT (Term qf tf te_fun) <- acc@@ -61,8 +61,10 @@ 			let tf'' = subst mgu tf' 			let ta'' = subst mgu ta' 			TermT (Term qr tr te_res) <- betaTerm (Term qf'' tf'' te_fun) (Term qa'' ta'' te_arg)-			normalizeVarsTy (qr #> tr) $ \(TyApp _ (TyApp _ _c qr') tr') ->+			normalizeVarsTy (qr #> tr) $ \case+			 TyApp _ (TyApp _ _c qr') tr' -> 				Right $ TermVT $ Term qr' tr' te_res+			 _ -> undefined -- FIXME: as of GHC 8.2, GHC is no longer clever enough to rule out other cases 	 ) (Right <$> t)  -- * Type 'Error_Beta'
Language/Symantic/Compiling/Grammar.hs view
@@ -10,7 +10,7 @@ import Control.Monad (void) import Data.Semigroup (Semigroup(..)) import Data.Map.Strict (Map)-import Prelude hiding (mod, not, any)+import Prelude hiding (any) import qualified Data.Function as Fun import qualified Data.Map.Strict as Map import qualified Data.Text as Text@@ -21,7 +21,7 @@  -- * Class 'Gram_Term_Name' class- ( Gram_Terminal g+ ( Gram_Char g  , Gram_Rule g  , Gram_Alt g  , Gram_Try g@@ -54,7 +54,7 @@ 		(NameTe . Text.pack <$>) $ 		(identG `minus`) $ 		Fun.const-		 <$> g_NameTeKey+		 <$> g_NameTeIdKey 		 <*. (any `but` g_NameTeIdTail) 		where 		identG = (:) <$> headG <*> many (cfOf g_NameTeIdTail)@@ -63,8 +63,8 @@ 	g_NameTeIdTail = rule "NameTeIdTail" $ 		unicat Unicat_Letter <+> 		unicat Unicat_Number-	g_NameTeKey :: Reg rl g String-	g_NameTeKey = rule "NameTeKey" $+	g_NameTeIdKey :: Reg rl g String+	g_NameTeIdKey = rule "NameTeIdKey" $ 		choice $ string <$> ["in", "let"] 	 	g_ModNameTeOp :: CF g (Mod NameTe)@@ -77,7 +77,7 @@ 		(NameTe . Text.pack <$>) $ 		(some (cfOf g_NameTeOpOk) `minus`) $ 		Fun.const-		 <$> g_NameTeKeySym+		 <$> g_NameTeOpKey 		 <*. (any `but` g_NameTeOpOk) 	g_NameTeOpOk :: Terminal g Char 	g_NameTeOpOk = rule "NameTeOpOk" $@@ -88,8 +88,8 @@ 		 ]) `but` koG 		where 		koG = choice (char <$> ['(', ')', '`', '\'', ',', '[', ']'])-	g_NameTeKeySym :: Reg rl g String-	g_NameTeKeySym = rule "NameTeKeySym" $+	g_NameTeOpKey :: Reg rl g String+	g_NameTeOpKey = rule "NameTeOpKey" $ 		choice $ string <$> ["\\", "->", "=", "@"]  deriving instance Gram_Term_Name g => Gram_Term_Name (CF g)@@ -98,7 +98,7 @@  -- * Class 'Gram_Term_Type' class- ( Gram_Terminal g+ ( Gram_Char g  , Gram_Rule g  , Gram_Alt g  , Gram_AltApp g@@ -109,7 +109,7 @@  , Gram_Type src g  ) => Gram_Term_Type src g where 	g_term_abst_decl :: CF g (NameTe, AST_Type src)-	g_term_abst_decl = rule "term_abst_decl" $+	g_term_abst_decl = rule "TermAbstDecl" $ 		parens $ (,) 		 <$> g_NameTe 		 <*  (symbol "::" <+> symbol ":")@@ -145,7 +145,7 @@ class  ( Gram_Source src g  , Gram_Error Error_Term_Gram g- , Gram_Terminal g+ , Gram_Char g  , Gram_Rule g  , Gram_Alt g  , Gram_App g@@ -159,14 +159,14 @@  , Gram_State (Imports NameTe, Modules src ss) g  ) => Gram_Term src ss g where 	g_term :: CF g (AST_Term src ss)-	g_term = rule "term" $+	g_term = rule "Term" $ 		choice 		 [ try g_term_abst 		 , g_term_operators 		 , g_term_let 		 ] 	g_term_operators :: CF g  (AST_Term src ss)-	g_term_operators = rule "term_operators" $+	g_term_operators = rule "TermOperators" $ 		G.catch $ 		left Error_Term_Gram_Fixity <$> 		g_ops@@ -174,29 +174,30 @@ 		g_ops :: CF g (Either Error_Fixity  (AST_Term src ss)) 		g_ops = operators g_term_atom g_prefix g_infix g_postfix 		g_prefix  :: CF g (Unifix, AST_Term src ss -> AST_Term src ss)-		g_infix   :: CF g (Infix,  AST_Term src ss -> AST_Term src ss -> AST_Term src ss) 		g_postfix :: CF g (Unifix, AST_Term src ss -> AST_Term src ss)-		g_prefix  = G.catch $ G.source $ G.getAfter $ op_prefix  <$> g_prefix_op-		g_infix   = G.catch $ G.source $ G.getAfter $ op_infix   <$> g_infix_op-		g_postfix = G.catch $ G.source $ G.getAfter $ op_postfix <$> g_postfix_op-		op_infix-		 :: Mod NameTe-		 -> (Imports NameTe, Modules src ss)-		 -> src-		 -> Either Error_Term_Gram-		           (Infix, AST_Term src ss -> AST_Term src ss -> AST_Term src ss)+		g_infix, g_app :: CF g (Infix,  AST_Term src ss -> AST_Term src ss -> AST_Term src ss)+		g_app     = rule "TermApp"     $ G.source $ op_app <$> pure ()+		g_prefix  = rule "TermPrefix"  $ G.catch $ G.source $ G.getAfter $ op_prefix  <$> g_op_prefix+		g_postfix = rule "TermPostfix" $ G.catch $ G.source $ G.getAfter $ op_postfix <$> g_op_postfix+		g_infix   = rule "TermInfix"   $ try (G.catch $ G.source $ G.getAfter $ op_infix <$> g_op_infix) <+> g_app+		op_app :: () -> src -> (Infix, AST_Term src ss -> AST_Term src ss -> AST_Term src ss)+		op_app () src =+			(Infix (Just AssocL) 9,) $ \a b ->+				(BinTree0 (Token_Term_App src) `BinTree2` a) `BinTree2` b+		op_infix :: Mod NameTe -> (Imports NameTe, Modules src ss) -> src ->+		 Either Error_Term_Gram+		        (Infix, AST_Term src ss -> AST_Term src ss -> AST_Term src ss) 		op_infix name (imps, mods) src = do 			t <- Error_Term_Gram_Module `left` 				lookupDefTerm FixyInfix imps name mods 			Right $ (token_fixity t,) $ \a b -> 				(BinTree0 (token_term t src) `BinTree2` a) `BinTree2` b-		op_prefix, op_postfix-		 :: Mod NameTe-		 -> (Imports NameTe, Modules src ss)-		 -> src-		 -> Either Error_Term_Gram-		           ( Unifix-		           , AST_Term src ss -> AST_Term src ss )+		op_prefix, op_postfix ::+		 Mod NameTe ->+		 (Imports NameTe, Modules src ss) ->+		 src ->+		 Either Error_Term_Gram+		        (Unifix, AST_Term src ss -> AST_Term src ss) 		op_prefix name (imps, mods) src = do 			t <- Error_Term_Gram_Module `left` 				lookupDefTerm FixyPrefix imps name mods@@ -207,27 +208,27 @@ 				lookupDefTerm FixyPostfix imps name mods 			Right $ (token_fixity t,) $ \a -> 				BinTree0 (token_term t src) `BinTree2` a-		g_postfix_op :: CF g (Mod NameTe)-		g_postfix_op = rule "term_op_postfix" $+		g_op_postfix :: CF g (Mod NameTe)+		g_op_postfix = rule "TermOpPostfix" $ 			lexeme $ 				g_backquote *> g_ModNameTeId <+> -- <* (G.cfOf $ Gram.Term (pure ' ') `but` g_backquote) 				g_ModNameTeOp-		g_infix_op :: CF g (Mod NameTe)-		g_infix_op = rule "term_op_infix" $+		g_op_infix :: CF g (Mod NameTe)+		g_op_infix = rule "TermOpInfix" $ 			lexeme $ 				between g_backquote g_backquote g_ModNameTeId <+>-				try (Fun.const <$> g_ModNameTeOp <*> (string " " <+> string "\n")) <+>+				try g_ModNameTeOp <+> 				pure (Mod [] " ")-		g_prefix_op :: CF g (Mod NameTe)-		g_prefix_op = rule "term_op_prefix" $+		g_op_prefix :: CF g (Mod NameTe)+		g_op_prefix = rule "TermOpPrefix" $ 			lexeme $ 				g_ModNameTeId <* g_backquote <+> 				g_ModNameTeOp-		g_backquote :: Gram_Terminal g' => g' Char+		g_backquote :: Gram_Char g' => g' Char 		g_backquote = char '`' 	 	g_term_atom :: CF g  (AST_Term src ss)-	g_term_atom = rule "term_atom" $+	g_term_atom = rule "TermAtom" $ 		choice $ 		 {-(try ( 			G.source $@@ -235,8 +236,7 @@ 			 <$ char '@' <*> g_type) :) $ 		 -} 		 (try <$> g_term_atomsR @_ @_ @ss) <>-		 [ try $-			G.catch $ G.source $ G.getAfter $+		 [ try $ G.catch $ G.source $ G.getAfter $ 			(\m (imps, mods) src -> 				case lookupDefTerm FixyInfix imps m mods of 				 Right t -> Right $ BinTree0 $ token_term t src@@ -248,9 +248,9 @@ 		 , g_term_group 		 ] 	g_term_group :: CF g (AST_Term src ss)-	g_term_group = rule "term_group" $ parens g_term+	g_term_group = rule "TermGroup" $ parens g_term 	g_term_abst :: CF g (AST_Term src ss)-	g_term_abst = rule "term_abst" $+	g_term_abst = rule "TermAbst" $ 		G.source $ 		((\(xs, te) src -> 			foldr (\(x, ty_x) ->@@ -294,7 +294,7 @@ 			 , token_fixity = infixN5 			 } 	g_term_let :: CF g  (AST_Term src ss)-	g_term_let = rule "term_let" $+	g_term_let = rule "TermLet" $ 		G.source $ 		(\name args bound body src -> 			BinTree0 $@@ -365,11 +365,11 @@  , void g_NameTe  , void g_NameTeId  , void $ G.cfOf g_NameTeIdTail- , void $ G.cfOf g_NameTeKey+ , void $ G.cfOf g_NameTeIdKey  , void g_ModNameTeOp  , void g_NameTeOp  , void $ G.cfOf g_NameTeOpOk- , void $ G.cfOf g_NameTeKeySym+ , void $ G.cfOf g_NameTeOpKey  ] where 	voiD :: CF g (AST_Term () '[Proxy (->), Proxy Integer]) -> CF g () 	voiD = (() <$)
Language/Symantic/Compiling/Module.hs view
@@ -2,7 +2,6 @@ {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE GADTs #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE UndecidableInstances #-} module Language.Symantic.Compiling.Module where@@ -13,7 +12,7 @@ import Data.Semigroup (Semigroup(..)) import Data.Set (Set) import Data.String (IsString(..))-import Prelude hiding (mod, not, any)+import Prelude hiding (mod, not) import qualified Data.Map.Strict as Map  import Language.Symantic.Grammar
Language/Symantic/Compiling/Term.hs view
@@ -165,7 +165,7 @@ infixr 5 `CtxTeS`  -- ** Type 'TermDef'--- | Convenient type alias for defining 'Term'.+-- | Convenient type alias to define a 'Term'. type TermDef s vs t = forall src ss ts. Source src => SymInj ss s => Term src ss ts vs t  -- ** Type family 'Sym'
Language/Symantic/Interpreting/View.hs view
@@ -13,10 +13,10 @@ -- | Interpreter's data. newtype View a  =      View- {    unView -- Inherited attribuctx:+ {    unView -- Inherited attributes:              :: (Infix, Side)              -> DepthLam-             -- Synthetised attribuctx:+             -- Synthetised attributes:              -> Text  } type DepthLam = Int
Language/Symantic/Typing/Document.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE PolyKinds #-}+{-# LANGUAGE TypeInType #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Language.Symantic.Typing.Document where @@ -54,8 +55,8 @@ 	go v2n (infixB SideL pr, SideL) ty 	where 	go ::-	 forall x.-	 (Map IndexVar Name) -> -- names of variables+	 forall kx (x::kx).+	 Map IndexVar Name -> -- names of variables 	 (Infix, Side) -> 	 Type src vs x -> d 	-- Var
Language/Symantic/Typing/Grammar.hs view
@@ -11,7 +11,6 @@ import Data.Maybe (fromMaybe) import Data.Semigroup (Semigroup(..)) import Data.String (IsString(..))-import Prelude hiding (any) import qualified Data.Char as Char import qualified Data.Map.Strict as Map import qualified Data.Text as Text@@ -96,7 +95,7 @@  -- * Class 'Gram_Mod' class- ( Gram_Terminal g+ ( Gram_Char g  , Gram_Rule g  , Gram_Alt g  , Gram_Try g@@ -130,7 +129,7 @@  -- * Class 'Gram_Type_Name' class- ( Gram_Terminal g+ ( Gram_Char g  , Gram_Rule g  , Gram_Alt g  , Gram_Try g@@ -189,7 +188,7 @@ -- | Read an 'AST_Type' from a textual source. class  ( Gram_Source src g- , Gram_Terminal g+ , Gram_Char g  , Gram_Rule g  , Gram_Alt g  , Gram_Try g@@ -206,14 +205,14 @@  , Constable (,)  ) => Gram_Type src g where 	g_type :: CF g (AST_Type src)-	g_type = rule "type" $ g_type_fun+	g_type = rule "Type" $ g_type_fun 	g_type_fun :: CF g (AST_Type src)-	g_type_fun = rule "type_fun" $+	g_type_fun = rule "TypeFun" $ 		infixrG g_type_list (source $ op <$ symbol "->") 		where op src = BinTree2 . BinTree2 (BinTree0 $ Token_Type_Const $ typeTLen @(->) src) 	-- TODO: maybe not harcoding g_type_list and g_type_tuple2 	g_type_list :: CF g (AST_Type src)-	g_type_list = rule "type_list" $+	g_type_list = rule "TypeList" $ 		source $ inside mk 		 (symbol "[") (optional g_type) (symbol "]") 		 (const <$> g_type_tuple2)@@ -222,24 +221,24 @@ 		mk (Just a) src = BinTree2 (tok src) a 		tok = BinTree0 . Token_Type_Const . typeTLen @[] 	g_type_tuple2 :: CF g (AST_Type src)-	g_type_tuple2 = rule "type_tuple2" $+	g_type_tuple2 = rule "TypeTuple2" $ 		try (parens (infixrG (g_type) (source $ op <$ symbol ","))) <+> (g_type_app) 		where op src = BinTree2 . BinTree2 (BinTree0 $ Token_Type_Const $ typeTLen @(,) src) 	g_type_app :: CF g (AST_Type src)-	g_type_app = rule "type_app" $+	g_type_app = rule "TypeApp" $ 		foldl1' BinTree2 <$> some (g_type_atom) 	g_type_atom :: CF g (AST_Type src)-	g_type_atom = rule "type_atom" $+	g_type_atom = rule "TypeAtom" $ 		try (parens g_type) <+>-		g_type_name_const <+>-		g_type_name_var-	g_type_name_const :: CF g (AST_Type src)-	g_type_name_const = rule "type_name_const" $+		g_type_const <+>+		g_type_var+	g_type_const :: CF g (AST_Type src)+	g_type_const = rule "TypeConst" $ 		lexeme $ catch $ source $ getBefore $ 		(\n (impsTy, modsTy) src -> BinTree0 . Token_Type_Const <$> readTyName impsTy modsTy src n) 		 <$> g_ModNameTy-	g_type_name_var :: CF g (AST_Type src)-	g_type_name_var = rule "type_name_var" $+	g_type_var :: CF g (AST_Type src)+	g_type_var = rule "TypeVar" $ 		lexeme $ source $ 		(\n ns src -> BinTree0 $ Token_Type_Var $ At src $ fromString $ n:ns) 		 <$> unicat (Unicat Char.LowercaseLetter)@@ -292,7 +291,7 @@  , g_type_tuple2  , g_type_app  , g_type_atom- , g_type_name_const- , g_type_name_var+ , g_type_const+ , g_type_var  -- , g_type_symbol  ]
Language/Symantic/Typing/Peano.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE GADTs #-}-{-# OPTIONS_GHC -fno-warn-missing-methods #-} -- | Natural numbers inductivey defined at the type-level, and of kind @*@. module Language.Symantic.Typing.Peano where 
Language/Symantic/Typing/Type.hs view
@@ -1,11 +1,13 @@ {-# LANGUAGE AllowAmbiguousTypes #-}+{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE GADTs #-}+{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE TypeInType #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE UndecidableSuperClasses #-}-{-# language ConstraintKinds #-} {-# OPTIONS_GHC -fno-warn-orphans #-}+{-# OPTIONS_GHC -fno-warn-missing-pattern-synonym-signatures #-} module Language.Symantic.Typing.Type  ( module Language.Symantic.Typing.Type  , Proxy(..)@@ -59,6 +61,11 @@ 	            -> Type (x #~ y) src vs 	-} +pattern a :$ b <- TyApp _ a b+infixr 0 :$+pattern a :@ b <- TyApp _ a b+infixl 9 :@+ instance Source src => Eq (Type src vs t) where 	x == y = isJust $ eqType x y instance SourceInj (TypeVT src) src => TestEquality (Type src vs) where@@ -720,7 +727,7 @@ kindOfType (TyVar _src _n v)         = kindOfVar v kindOfType (TyFam _src _len fam _as) = kindOfConst fam --- | Remove unused 'Var's from ther context.+-- | Remove unused 'Var's from the context. normalizeVarsTy ::  Type src vs (t::kt) ->  (forall vs'. Type src vs' (t::kt) -> ret) -> ret
Language/Symantic/Typing/Unify.hs view
@@ -146,7 +146,7 @@  (TypeT src vs, [TypeT src vs]) spineTy typ = go [] typ 	where-	go :: forall x. [TypeT src vs] -> Type src vs x -> (TypeT src vs, [TypeT src vs])+	go :: forall kx (x::kx). [TypeT src vs] -> Type src vs x -> (TypeT src vs, [TypeT src vs]) 	go ctx (TyApp _ (TyApp _ (TyConst _ _ c) _q) t) 	 | Just HRefl <- proj_ConstKi @(K (#>)) @(#>) c 	 = go ctx t -- NOTE: skip the constraint @q@.
Language/Symantic/Typing/Variable.hs view
@@ -9,17 +9,12 @@ import Data.Proxy (Proxy(..)) import Data.String (IsString(..)) import Data.Text (Text)-import Data.Type.Equality ((:~:)(..))+import Data.Type.Equality ((:~:)(..), (:~~:)(..)) import qualified Data.Kind as K  import Language.Symantic.Grammar import Language.Symantic.Typing.List import Language.Symantic.Typing.Kind---- | /Heterogeneous propositional equality/:--- like (:~:) but prove also that the kinds are equal.-data (:~~:) (a::ka) (b::kb) where-	HRefl :: a :~~: a  -- * Type 'Var' -- | A /type variable/, indexed amongst a type-level list.
README.md view
@@ -65,14 +65,12 @@  # Usage -Please pick in [symantic-lib](https://hackage.haskell.org/package/symantic-lib)-a few specific `Lib/*.hs` files near what you want to do-and the corresponding `Lib/*/Test.hs` file,-if any in the [Git repository](git://git.autogeree.net/symantic),-to learn by examples how to use this library.+Please learn how to use this library by reading example source files in `test/`+in [symantic-lib](https://hackage.haskell.org/package/symantic-lib)+in [Git repository](git://git.autogeree.net/symantic). -Those `Lib/*/Test.hs` files use [megaparsec](https://hackage.haskell.org/package/megaparsec) as parser-(see `Grammar/Megaparsec.hs`) and a default grammar somehow sticking to Haskell's,+These `test` files use [megaparsec](https://hackage.haskell.org/package/megaparsec) as parser+(see `test/Testing/Megaparsec.hs`) and a default grammar somehow sticking to Haskell's, but staying context-free (so in particular: insensitive to the indentation), and supporting prefix and postfix operators. This grammar — itself written as a symantic embedded DSL@@ -157,7 +155,7 @@ * `PolyKinds` for avoiding a lot of uses of `Proxy`. * `Rank2Types` or `ExistentialQuantification` for parsing `GADT`s. * `TypeApplications` for having a more concise syntax-  to build `Type` (eg. `tyConst `Bool`).+  to build `Type` (eg. `tyConst @Bool`). * `TypeFamilies` for type-level programming. * `TypeInType` (introduced in GHC 8.0.1)   for `Type` to also bind a kind equality for the type `t` it encodes.
+ stack.yaml view
@@ -0,0 +1,7 @@+resolver: lts-10.5+packages:+- '.'+- location: '../symantic-grammar'+  extra-dep: true+- location: '../symantic-document'+  extra-dep: true
symantic.cabal view
@@ -1,52 +1,35 @@-author: Julien Moutinho <julm+symantic@autogeree.net>-bug-reports: Julien Moutinho <julm+symantic@autogeree.net>-build-type: Simple-cabal-version: >= 1.24-category: Language+name: symantic+-- PVP:  +-+------- breaking API changes+--       | | +----- non-breaking API additions+--       | | | +--- code changes with no API change+version: 6.3.1.20180213+synopsis: Library for Typed Tagless-Final Higher-Order Composable DSL description: This is an experimental library for composing, parsing,              typing, compiling, transforming and interpreting              a custom DSL (Domain-Specific Language)              expressing a subset of GHC's Haskell type system. extra-doc-files: README.md-extra-source-files:-extra-tmp-files:--- homepage: +category: Language license: GPL-3 license-file: COPYING-maintainer: Julien Moutinho <julm+symantic@autogeree.net>-name: symantic stability: experimental-synopsis: Library for Typed Tagless-Final Higher-Order Composable DSL-tested-with: GHC==8.0.2--- PVP:  +-+------- breaking API changes---       | | +----- non-breaking API additions---       | | | +--- code changes with no API change-version: 6.3.0.20170807+author:      Julien Moutinho <julm+symantic@autogeree.net>+maintainer:  Julien Moutinho <julm+symantic@autogeree.net>+bug-reports: Julien Moutinho <julm+symantic@autogeree.net>+-- homepage: +build-type: Simple+cabal-version: >= 1.24+tested-with: GHC==8.2.2+extra-source-files:+  stack.yaml+extra-tmp-files:+ Source-Repository head   location: git://git.autogeree.net/symantic   type:     git  Library-  default-extensions:-    DataKinds-    DefaultSignatures-    FlexibleContexts-    FlexibleInstances-    LambdaCase-    MultiParamTypeClasses-    NamedFieldPuns-    OverloadedStrings-    Rank2Types-    ScopedTypeVariables-    StandaloneDeriving-    TupleSections-    TypeApplications-    TypeFamilies-    TypeOperators-  ghc-options: -Wall-               -fno-warn-tabs-  default-language: Haskell2010   exposed-modules:     Language.Symantic     Language.Symantic.Compiling@@ -74,11 +57,34 @@     Language.Symantic.Typing.Type     Language.Symantic.Typing.Unify     Language.Symantic.Typing.Variable+  default-language: Haskell2010+  default-extensions:+    DataKinds+    DefaultSignatures+    FlexibleContexts+    FlexibleInstances+    LambdaCase+    MultiParamTypeClasses+    NamedFieldPuns+    OverloadedStrings+    Rank2Types+    ScopedTypeVariables+    StandaloneDeriving+    TupleSections+    TypeApplications+    TypeFamilies+    TypeOperators+  ghc-options:+    -Wall+    -Wincomplete-uni-patterns+    -Wincomplete-record-updates+    -fno-warn-tabs+    -fhide-source-paths   build-depends:-    base >= 4.6 && < 5-    , containers-    , mono-traversable-    , symantic-grammar+      symantic-grammar     , symantic-document-    , transformers-    , text+    , base             >= 4.6 && < 5+    , containers       >= 0.5+    , mono-traversable >= 1.0+    , transformers     >= 0.5+    , text             >= 1.2