diff --git a/.gitmodules b/.gitmodules index e8c2de51..01ad2f25 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3649,4 +3649,17 @@ url = https://github.com/engstrand-config/guix-dotfiles [submodule "2024/03/26/pick-up-nix"] path = 2024/03/26/pick-up-nix - url = https://github.com/jmikedupont2/pick-up-nix.git + url = https://github.com/jmikedupont2/pick-up-nix +[submodule "2024/03/27/hivemind"] + path = 2024/03/27/hivemind + url = https://github.com/learning-at-home/hivemind + +[submodule "2024/03/27/swarm"] + path = 2024/03/27/swarm + url = https://github.com/yandex-research/swarm +[submodule "2024/03/27/petals-api"] + path = 2024/03/27/petals-api + url = https://huggingface.co/spaces/bigscience/petals-api +[submodule "2024/03/27/peft"] + path = 2024/03/27/peft + url = https://github.com/huggingface/peft diff --git a/2023/06/26/test.hs b/2023/06/26/test.hs new file mode 100644 index 00000000..907d2e5b --- /dev/null +++ b/2023/06/26/test.hs @@ -0,0 +1,18 @@ + +{-# LANGUAGE TemplateHaskell #-} + +import Language.Haskell.TH +import Language.Haskell.TH.Syntax + +listMembers :: Q [Dec] +listMembers = do + info <- reify (mkName "Language.Haskell.TH.Syntax") + case info of + TyConI (DataD _ _ _ _ constructors _) -> return constructors + _ -> fail "Invalid type" + +main :: IO () +main = do + members <- runQ listMembers + putStrLn "Members:" + mapM_ (putStrLn . pprint) members diff --git a/2023/06/26/test2 b/2023/06/26/test2 new file mode 100755 index 00000000..6f6f445e Binary files /dev/null and b/2023/06/26/test2 differ diff --git a/2023/06/26/test2.dyn_hi b/2023/06/26/test2.dyn_hi new file mode 100644 index 00000000..f70d2ac9 Binary files /dev/null and b/2023/06/26/test2.dyn_hi differ diff --git a/2023/06/26/test2.dyn_o b/2023/06/26/test2.dyn_o new file mode 100644 index 00000000..b4611c19 Binary files /dev/null and b/2023/06/26/test2.dyn_o differ diff --git a/2023/06/26/test2.hi b/2023/06/26/test2.hi new file mode 100644 index 00000000..5ec321ef Binary files /dev/null and b/2023/06/26/test2.hi differ diff --git a/2023/06/26/test2.hs b/2023/06/26/test2.hs new file mode 100644 index 00000000..dea4019a --- /dev/null +++ b/2023/06/26/test2.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE TemplateHaskell #-} + +import Language.Haskell.TH +import Language.Haskell.TH.Syntax + +listMembers :: Q [Con] +listMembers = do + info <- reify (mkName "Language.Haskell.TH.Syntax") + case info of + TyConI (DataD _ _ _ _ constructors _) -> return constructors + _ -> fail "Invalid type" + +main :: IO () +main = do + members <- runQ listMembers + putStrLn "Members:" + mapM_ (putStrLn . pprint) members diff --git a/2023/06/26/test2.o b/2023/06/26/test2.o new file mode 100644 index 00000000..641121d2 Binary files /dev/null and b/2023/06/26/test2.o differ diff --git a/2023/06/26/test3.hs b/2023/06/26/test3.hs new file mode 100644 index 00000000..96b98462 --- /dev/null +++ b/2023/06/26/test3.hs @@ -0,0 +1,25 @@ +{-# LANGUAGE TemplateHaskell #-} + +module THExample where + +import Language.Haskell.TH +import Language.Haskell.TH.Syntax + +listMembers :: Q [Con] +listMembers = do + info <- reify (mkName "Language.Haskell.TH.Syntax") + case info of + TyConI (DataD _ _ _ _ constructors _) -> return constructors + _ -> fail "Invalid type" +import Language.Haskell.TH + +getMembers :: Q [Dec] -> Q [Dec] +getMembers qDecs = qDecs + +doTheThing :: Q [Dec] -> Q [Dec] +doTheThing = getMembers + +main :: IO () +main = do + let constructors = $(doTheThing [d| data Color = Red |]) + mapM_ (putStrLn . pprint) constructors diff --git a/2023/06/26/test4.hs b/2023/06/26/test4.hs new file mode 100644 index 00000000..0b31a9ba --- /dev/null +++ b/2023/06/26/test4.hs @@ -0,0 +1,12 @@ +import Language.Haskell.TH + +getMembers :: Q [Dec] -> Q [Dec] +getMembers qDecs = qDecs + +doTheThing :: Q [Dec] -> Q [Dec] +doTheThing = getMembers + +main :: IO () +main = do + let constructors = $(doTheThing [d| data Color = Red |]) + mapM_ (putStrLn . pprint) constructors diff --git a/2023/06/26/test5.hs b/2023/06/26/test5.hs new file mode 100644 index 00000000..94bd30a0 --- /dev/null +++ b/2023/06/26/test5.hs @@ -0,0 +1,18 @@ +{-# LANGUAGE TemplateHaskell #-} + +import Language.Haskell.TH + +getMembers :: Q [Dec] -> Q [Dec] +getMembers qDecs = qDecs +listMembers :: Q a -> Q [Con] +listMembers continuation = do + info <- reify (mkName "Language.Haskell.TH.Syntax" +) + case info of + TyConI (DataD _ _ _ _ constructors _) -> continu +ation >> return constructors + _ -> fail "Invalid type" +main :: IO () +main = do + let constructors = listMembers + mapM_ (putStrLn . pprint) constructors diff --git a/2023/06/26/test7.hs b/2023/06/26/test7.hs new file mode 100644 index 00000000..4754e998 --- /dev/null +++ b/2023/06/26/test7.hs @@ -0,0 +1,26 @@ +{-# LANGUAGE TemplateHaskell #-} + +module Main where + +import Language.Haskell.TH + +-- Helper function to list the names of functions in the current module +listFunctionNames :: Q [Name] +listFunctionNames = do + info <- reify ''Main -- Replace 'Main' with the actual module name + case info of + TyConI (DataD _ _ _ _ decs _) -> return $ extractFunctionNames decs + _ -> fail "Invalid module" + +-- Extracts the names of functions from a list of declarations +extractFunctionNames :: [Dec] -> [Name] +extractFunctionNames = foldr extract [] where + extract (FunD name _) names = name : names + extract _ names = names + +-- Print the names of functions in the current module +main :: IO () +main = do + functionNames <- runQ listFunctionNames + putStrLn "Functions in the current module:" + mapM_ print functionNames diff --git a/2023/06/26/test8.hs b/2023/06/26/test8.hs new file mode 100644 index 00000000..d7a9f5c4 --- /dev/null +++ b/2023/06/26/test8.hs @@ -0,0 +1,26 @@ +{-# LANGUAGE TemplateHaskell #-} + +module Main where + +import Language.Haskell.TH + +-- Helper function to list the names of functions in the current module +listFunctionNames :: Q [Name] +listFunctionNames = do + info <- reify (mkName "Main") + case info of + ModuleInfo _ declarations _ _ -> return $ extractFunctionNames declarations + _ -> fail "Invalid module" + +-- Extracts the names of functions from a list of declarations +extractFunctionNames :: [Dec] -> [Name] +extractFunctionNames = foldr extract [] where + extract (FunD name _) names = name : names + extract _ names = names + +-- Print the names of functions in the current module +main :: IO () +main = do + functionNames <- runQ listFunctionNames + putStrLn "Functions in the current module:" + mapM_ print functionNames diff --git a/2023/06/27/Makefile b/2023/06/27/Makefile new file mode 100644 index 00000000..5b1d049c --- /dev/null +++ b/2023/06/27/Makefile @@ -0,0 +1,3 @@ +tt: + ghc test24.hs + ./test24 diff --git a/2023/06/27/good1.hs b/2023/06/27/good1.hs new file mode 100644 index 00000000..f53dec45 --- /dev/null +++ b/2023/06/27/good1.hs @@ -0,0 +1,38 @@ + +{-# LANGUAGE TemplateHaskell #-} + +import Language.Haskell.TH + +-- Foo data type +data Foo + = FooIdentifier Name + | FooVariable Name String + | FooComposed [Foo] + +-- Convert Q Exp to Foo +qToFoo :: Q Exp -> Q Foo +qToFoo qexp = qexp >>= convertExp + where + convertExp (VarE name) = return (FooVariable name "") + convertExp (ConE name) = return (FooIdentifier name) + convertExp (AppE e1 e2) = do + foo1 <- qToFoo (return e1) + foo2 <- qToFoo (return e2) + return (FooComposed [foo1, foo2]) + convertExp _ = error "Unsupported expression" + +-- Convert Foo to String +fooToString :: Foo -> String +fooToString (FooIdentifier name) = show name +fooToString (FooVariable name value) = show name ++ " (" ++ value ++ ")" +fooToString (FooComposed foos) = concatMap fooToString foos + +-- Example usage +main :: IO () +main = do + let example = [| fooToString |] + foo <- runQ (qToFoo example) + putStrLn "Original Q expression:" + -- putStrLn (pprint example) + putStrLn "\nFoo conversion:" + putStrLn (fooToString foo) diff --git a/2023/06/27/mod.txt b/2023/06/27/mod.txt new file mode 100644 index 00000000..8958d4e9 --- /dev/null +++ b/2023/06/27/mod.txt @@ -0,0 +1,14 @@ +data AnnLookup = AnnLookupModule Module | AnnLookupName Name + = ModuleAnnotation | TypeAnnotation Name | ValueAnnotation Name + = ModuleDoc | DeclDoc Name | ArgDoc Name Int | InstDoc Type + loc_module :: String, +type Module :: * +data Module = Module PkgName ModName +type ModuleInfo :: * +data ModuleInfo = ModuleInfo [Module] + qReifyModule :: Module -> m ModuleInfo + qReifyAnnotations, qReifyModule, qReifyConStrictness, qLocation, +nameModule :: Name -> Maybe String +reifyModule :: Module -> Q ModuleInfo +moduleAnnotation :: AnnTarget +thisModule :: Q Module diff --git a/2023/06/27/name.txt b/2023/06/27/name.txt new file mode 100644 index 00000000..e4ff24e0 --- /dev/null +++ b/2023/06/27/name.txt @@ -0,0 +1,211 @@ +data AnnLookup = AnnLookupModule Module | AnnLookupName Name + = ModuleAnnotation | TypeAnnotation Name | ValueAnnotation Name + = NormalC Name [BangType] + | RecC Name [VarBangType] + | InfixC BangType Name BangType + | GadtC [Name] [BangType] Type + | RecGadtC [Name] [VarBangType] Type + = FunD Name [Clause] + | DataD Cxt Name [TyVarBndr ()] (Maybe Kind) [Con] [DerivClause] + | NewtypeD Cxt Name [TyVarBndr ()] (Maybe Kind) Con [DerivClause] + | TySynD Name [TyVarBndr ()] Type + | ClassD Cxt Name [TyVarBndr ()] [FunDep] [Dec] + | SigD Name Type + | KiSigD Name Kind + | InfixD Fixity Name + | DataFamilyD Name [TyVarBndr ()] (Maybe Kind) + | RoleAnnotD Name [Role] + | DefaultSigD Name Type + | PatSynD Name PatSynArgs PatSynDir Pat + | PatSynSigD Name PatSynType + = ModuleDoc | DeclDoc Name | ArgDoc Name Int | InstDoc Type + = VarE Name + | ConE Name + | DoE (Maybe ModName) [Stmt] + | MDoE (Maybe ModName) [Stmt] + | RecConE Name [FieldExp] + | UnboundVarE Name +type FieldExp = (Name, Exp) +type FieldPat = (Name, Pat) + = ImportF Callconv Safety String Name Type + | ExportF Callconv String Name Type +data FunDep = FunDep [Name] [Name] + | ClassOpI Name Type ParentName + | PrimTyConI Name Arity Unlifted + | DataConI Name Type ParentName + | PatSynI Name PatSynType + | VarI Name Type (Maybe Dec) + | TyVarI Name Type +data InjectivityAnn = InjectivityAnn Name [Name] + = Loc {loc_filename :: String, +type ModName :: * +newtype ModName = ModName String +data Module = Module PkgName ModName +type Name :: * +data Name = Name OccName NameFlavour +type NameFlavour :: * +data NameFlavour + = NameS + | NameQ ModName + | NameU !Uniq + | NameL !Uniq + | NameG NameSpace PkgName ModName +type NameIs :: * +data NameIs = Alone | Applied | Infix +type NameSpace :: * +data NameSpace = VarName | DataName | TcClsName +type OccName :: * +newtype OccName = OccName String +type ParentName :: * +type ParentName = Name + | VarP Name + | ConP Name [Type] [Pat] + | InfixP Pat Name Pat + | UInfixP Pat Name Pat + | AsP Name Pat + | RecP Name [FieldPat] + = PrefixPatSyn [Name] | InfixPatSyn Name Name | RecordPatSyn [Name] +type PkgName :: * +newtype PkgName = PkgName String + = InlineP Name Inline RuleMatch Phases + | SpecialiseP Name Type (Maybe Inline) Phases + | CompleteP [Name] (Maybe Name) + qNewName :: String -> m Name + qLookupName :: Bool -> String -> m (Maybe Name) + qReify :: Name -> m Info + qReifyFixity :: Name -> m (Maybe Fixity) + qReifyType :: Name -> m Type + qReifyInstances :: Name -> [Type] -> m [Dec] + qReifyRoles :: Name -> m [Role] + qReifyConStrictness :: Name -> m [DecidedStrictness] + {-# MINIMAL qNewName, qReport, qRecover, qLookupName, qReify, + newName :: String -> m Name + {-# MINIMAL newName #-} +data RuleBndr = RuleVar Name | TypedRuleVar Name Type +data TyVarBndr flag = PlainTV Name flag | KindedTV Name flag Kind + | VarT Name + | ConT Name + | PromotedT Name + | InfixT Type Name Type + | UInfixT Type Name Type + = TypeFamilyHead Name +type VarBangType = (Name, Bang, Type) + (Name -> k) +falseName :: Name +isInstance :: Name -> [Type] -> Q Bool +justName :: Name +leftName :: Name +lookupName :: Bool -> String -> Q (Maybe Name) +lookupTypeName :: String -> Q (Maybe Name) +lookupValueName :: String -> Q (Maybe Name) +manyName :: Name +mkModName :: String -> ModName +mkName :: String -> Name +mkNameG :: NameSpace -> String -> String -> String -> Name +mkNameG_d :: String -> String -> String -> Name +mkNameG_tc :: String -> String -> String -> Name +mkNameG_v :: String -> String -> String -> Name +mkNameL :: String -> Uniq -> Name +mkNameS :: String -> Name +mkNameU :: String -> Uniq -> Name +mkOccName :: String -> OccName +mkPkgName :: String -> PkgName +mk_tup_name :: Int -> NameSpace -> Bool -> Name +modString :: ModName -> String +nameBase :: Name -> String +nameModule :: Name -> Maybe String +namePackage :: Name -> Maybe String +nameSpace :: Name -> Maybe NameSpace +newNameIO :: String -> IO Name +nonemptyName :: Name +nothingName :: Name +occString :: OccName -> String +oneName :: Name +pkgString :: PkgName -> String +reify :: Name -> Q Info +reifyConStrictness :: Name -> Q [DecidedStrictness] +reifyFixity :: Name -> Q (Maybe Fixity) +reifyInstances :: Name -> [Type] -> Q [InstanceDec] +reifyRoles :: Name -> Q [Role] +reifyType :: Name -> Q Type +rightName :: Name +showName :: Name -> String +showName' :: NameIs -> Name -> String +trueName :: Name +tupleDataName :: Int -> Name +tupleTypeName :: Int -> Name +unboxedSumDataName :: SumAlt -> SumArity -> Name +unboxedSumTypeName :: SumArity -> Name +unboxedTupleDataName :: Int -> Name +unboxedTupleTypeName :: Int -> Name + | ExplicitNamespaces + | NamedWildCards +asP :: Quote m => Name -> m Pat -> m Pat + m Cxt -> Name -> [m (TyVarBndr ())] -> [FunDep] -> [m Dec] -> m Dec +classP :: Quote m => Name -> [m Type] -> m Pred + Name +conE :: Quote m => Name -> m Exp +conK :: Name -> Kind + Quote m => Name -> [m Type] -> [m Pat] -> m Pat +conT :: Quote m => Name -> m Type + -> Name + -> Name + Quote m => Name -> [m (TyVarBndr ())] -> Maybe (m Kind) -> m Dec +defaultSigD :: Quote m => Name -> m Type -> m Dec + Quote m => Maybe ModName -> [m Stmt] -> m Exp +fieldExp :: Quote m => Name -> m Exp -> m (Name, Exp) +fieldPat :: Quote m => Name -> m Pat -> m FieldPat + Quote m => Callconv -> Safety -> String -> Name -> m Type -> m Dec +funD :: Quote m => Name -> [m Clause] -> m Dec + Name -> [Q Clause] -> Maybe String -> [Maybe String] -> Q Dec +funDep :: [Name] -> [Name] -> FunDep +gadtC :: Quote m => [Name] -> [m StrictType] -> m Type -> m Con + Quote m => m (Bang, Type) -> Name -> m (Bang, Type) -> m Con +infixLD :: Quote m => Int -> Name -> m Dec +infixND :: Quote m => Int -> Name -> m Dec +infixP :: Quote m => m Pat -> Name -> m Pat -> m Pat +infixPatSyn :: Quote m => Name -> Name -> m PatSynArgs +infixRD :: Quote m => Int -> Name -> m Dec +infixT :: Quote m => m Type -> Name -> m Type -> m Type + Name -> [Name] -> Language.Haskell.TH.Lib.Internal.InjectivityAnn +kiSigD :: Quote m => Name -> m Kind -> m Dec + Name -> Specificity -> m Kind -> m (TyVarBndr Specificity) + Quote m => Name -> m Kind -> m (TyVarBndr ()) + Quote m => Maybe ModName -> [m Stmt] -> m Exp + -> Name + -> Name +normalC :: Quote m => Name -> [m BangType] -> m Con + Name + Quote m => Name -> m PatSynArgs -> m PatSynDir -> m Pat -> m Dec + Name +patSynSigD :: Quote m => Name -> m Type -> m Dec + Quote m => Name -> Specificity -> m (TyVarBndr Specificity) + Quote m => Name -> m (TyVarBndr ()) +pragCompleteD :: Quote m => [Name] -> Maybe Name -> m Dec + Quote m => Name -> Inline -> RuleMatch -> Phases -> m Dec +pragSpecD :: Quote m => Name -> m Type -> Phases -> m Dec + Quote m => Name -> m Type -> Inline -> Phases -> m Dec +prefixPatSyn :: Quote m => [Name] -> m PatSynArgs +promotedT :: Quote m => Name -> m Type +recC :: Quote m => Name -> [m VarBangType] -> m Con +recConE :: Quote m => Name -> [m (Name, Exp)] -> m Exp + Quote m => [Name] -> [m VarStrictType] -> m Type -> m Con +recP :: Quote m => Name -> [m FieldPat] -> m Pat +recUpdE :: Quote m => m Exp -> [m (Name, Exp)] -> m Exp +recordPatSyn :: Quote m => [Name] -> m PatSynArgs + Quote m => Name -> [Language.Haskell.TH.Lib.Internal.Role] -> m Dec +ruleVar :: Quote m => Name -> m RuleBndr +sigD :: Quote m => Name -> m Type -> m Dec + Quote m => Name -> [m (TyVarBndr ())] -> m Type -> m Dec +typeAnnotation :: Name -> AnnTarget +typedRuleVar :: Quote m => Name -> m Type -> m RuleBndr +uInfixP :: Quote m => m Pat -> Name -> m Pat -> m Pat +uInfixT :: Quote m => m Type -> Name -> m Type -> m Type +unboundVarE :: Quote m => Name -> m Exp +valueAnnotation :: Name -> AnnTarget +varBangType :: Quote m => Name -> m BangType -> m VarBangType +varE :: Quote m => Name -> m Exp +varK :: Name -> Kind +varP :: Quote m => Name -> m Pat +varStrictType :: Quote m => Name -> m StrictType -> m VarStrictType +varT :: Quote m => Name -> m Type diff --git a/2023/06/27/straight.el b/2023/06/27/straight.el new file mode 100644 index 00000000..83de0f52 --- /dev/null +++ b/2023/06/27/straight.el @@ -0,0 +1,12 @@ +(defvar bootstrap-version) +(let ((bootstrap-file + (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) + (bootstrap-version 6)) + (unless (file-exists-p bootstrap-file) + (with-current-buffer + (url-retrieve-synchronously + "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el" + 'silent 'inhibit-cookies) + (goto-char (point-max)) + (eval-print-last-sexp))) + (load bootstrap-file nil 'nomessage)) diff --git a/2023/06/27/test10.hs b/2023/06/27/test10.hs new file mode 100644 index 00000000..e34cbefe --- /dev/null +++ b/2023/06/27/test10.hs @@ -0,0 +1,30 @@ + +import Language.Haskell.TH +import Language.Haskell.TH.Syntax (Module(Module), reifyModule) + +-- modString :: ModName -> String +-- data Exp +-- ... +-- | DoE (Maybe ModName) [Stmt] +-- | MDoE (Maybe ModName) [Stmt] +-- type ModName :: * +-- newtype ModName = ModName String +-- type Module :: * +-- data Module = Module PkgName ModName +-- type ModuleInfo :: * +-- data ModuleInfo = ModuleInfo [Module] +-- type Name :: * +-- data Name = Name OccName NameFlavour + + +-- Assuming you have a `Module` object named `myModule` +getModuleName :: Module -> String +getModuleName (Module _ (ModuleName modName)) = modName + +main :: IO () +main = do + moduleName <- runQ $ do + mod <- thisModule + reifyMod <- reifyModule mod + return $ nameModule reifyMod + putStrLn moduleName diff --git a/2023/06/27/test11 b/2023/06/27/test11 new file mode 100755 index 00000000..fba88e85 Binary files /dev/null and b/2023/06/27/test11 differ diff --git a/2023/06/27/test11.hi b/2023/06/27/test11.hi new file mode 100644 index 00000000..fdc1d267 Binary files /dev/null and b/2023/06/27/test11.hi differ diff --git a/2023/06/27/test11.hs b/2023/06/27/test11.hs new file mode 100644 index 00000000..40d8a43e --- /dev/null +++ b/2023/06/27/test11.hs @@ -0,0 +1,19 @@ +{-# LANGUAGE TemplateHaskell #-} + + + +import Language.Haskell.TH +import Language.Haskell.TH.Syntax +import Language.Haskell.TH.Syntax (Module(Module), Q, reifyModule) + +getModuleName :: Module -> String +--getModuleName (Module _ modName) = nameBase modName +getModuleName (Module _ modName) = modString modName + +main :: IO () +main = do + moduleName <- runQ $ do + mod <- thisModule + reifyMod <- reifyModule mod + return $ getModuleName mod + putStrLn moduleName diff --git a/2023/06/27/test11.o b/2023/06/27/test11.o new file mode 100644 index 00000000..99b9171a Binary files /dev/null and b/2023/06/27/test11.o differ diff --git a/2023/06/27/test12 b/2023/06/27/test12 new file mode 100755 index 00000000..59ec40cd Binary files /dev/null and b/2023/06/27/test12 differ diff --git a/2023/06/27/test12.dyn_hi b/2023/06/27/test12.dyn_hi new file mode 100644 index 00000000..84f86066 Binary files /dev/null and b/2023/06/27/test12.dyn_hi differ diff --git a/2023/06/27/test12.dyn_o b/2023/06/27/test12.dyn_o new file mode 100644 index 00000000..fc2f38c8 Binary files /dev/null and b/2023/06/27/test12.dyn_o differ diff --git a/2023/06/27/test12.hi b/2023/06/27/test12.hi new file mode 100644 index 00000000..84ea6da6 Binary files /dev/null and b/2023/06/27/test12.hi differ diff --git a/2023/06/27/test12.hs b/2023/06/27/test12.hs new file mode 100644 index 00000000..3a7f7656 --- /dev/null +++ b/2023/06/27/test12.hs @@ -0,0 +1,37 @@ + +{-# LANGUAGE TemplateHaskell #-} + +import Language.Haskell.TH + +-- Define the Unparse class +class Unparse a where + unparse :: a -> String + +-- Implement Unparse for Name +instance Unparse Name where + unparse = show + +-- Implement Unparse for Type +instance Unparse Type where + unparse = show + +-- Implement Unparse for Dec +instance Unparse Dec where + unparse = show + +-- Implement Unparse for Exp +instance Unparse Exp where + unparse = show + +-- Example usage +main :: IO () +main = do + let exampleName = mkName "example" + exampleType = ConT ''Int + exampleDec = ValD (VarP exampleName) (NormalB (LitE (IntegerL 42))) [] + exampleExp = AppE (VarE exampleName) (LitE (IntegerL 10)) + + putStrLn $ unparse exampleName + putStrLn $ unparse exampleType + putStrLn $ unparse exampleDec + putStrLn $ unparse exampleExp diff --git a/2023/06/27/test12.o b/2023/06/27/test12.o new file mode 100644 index 00000000..84543be6 Binary files /dev/null and b/2023/06/27/test12.o differ diff --git a/2023/06/27/test13.hs b/2023/06/27/test13.hs new file mode 100644 index 00000000..8beda062 --- /dev/null +++ b/2023/06/27/test13.hs @@ -0,0 +1,28 @@ +{-# LANGUAGE TemplateHaskell #-} + +import Language.Haskell.TH + +-- Define the Unparse class +class Unparse a where + unparse :: a -> String + +-- Implement Unparse for Name +instance Unparse Name where + unparse = show + +-- Implement Unparse for Type +instance Unparse Type where + unparse (ConT name) = [("Type", show name)] + unparse (AppT t1 t2) = [("Type", "AppT")]ff ++ unparse t1 ++ unparse t2 + unparse (ListT) = [("Type", "ListT")] + -- Add more cases for other types as needed + +-- Example usage +main :: IO () +main = do + let exampleType = AppT (ConT ''Maybe) (AppT ListT (ConT ''Int)) + + printKeyValuePairs $ unparse exampleType + +printKeyValuePairs :: [(String, String)] -> IO () +printKeyValuePairs = mapM_ (\(k, v) -> putStrLn $ k ++ ": " ++ v) diff --git a/2023/06/27/test14 b/2023/06/27/test14 new file mode 100755 index 00000000..a096d4d8 Binary files /dev/null and b/2023/06/27/test14 differ diff --git a/2023/06/27/test14.dyn_hi b/2023/06/27/test14.dyn_hi new file mode 100644 index 00000000..7f47391e Binary files /dev/null and b/2023/06/27/test14.dyn_hi differ diff --git a/2023/06/27/test14.dyn_o b/2023/06/27/test14.dyn_o new file mode 100644 index 00000000..5e166f0e Binary files /dev/null and b/2023/06/27/test14.dyn_o differ diff --git a/2023/06/27/test14.hi b/2023/06/27/test14.hi new file mode 100644 index 00000000..d582a203 Binary files /dev/null and b/2023/06/27/test14.hi differ diff --git a/2023/06/27/test14.hs b/2023/06/27/test14.hs new file mode 100644 index 00000000..9177af19 --- /dev/null +++ b/2023/06/27/test14.hs @@ -0,0 +1,59 @@ +{-# LANGUAGE TemplateHaskell #-} + +import Language.Haskell.TH +import Data.List (intercalate) + +-- Define the AST data type +data AST + = Identity String + | KeyValue [(String, AST)] + | Object [AST] + +-- Define a helper function to convert a list of key-value pairs into AST +toKeyValue :: [(String, AST)] -> AST +toKeyValue pairs = KeyValue pairs + +-- Define the Unparse class +class Unparse a where + unparse :: a -> AST + +-- Implement Unparse for Name +instance Unparse Name where + unparse = Identity . show + +-- Implement Unparse for Type +instance Unparse Type where + unparse (ConT name) = toKeyValue [("Typ33e", unparse name)] + unparse otherType = Identity $ show otherType + +-- Implement Unparse for Dec +instance Unparse Dec where + unparse = Identity . show + +-- Implement Unparse for Exp +instance Unparse Exp where + unparse = Identity . show + +-- Function to print the AST as a string +printAST :: AST -> String +printAST (Identity value) = value +printAST (KeyValue pairs) = "{" ++ intercalate ", " (map (\(key, val) -> key ++ ": " ++ printAST val) pairs) ++ "}" +printAST (Object nodes) = "[" ++ intercalate ", " (map printAST nodes) ++ "]" + +-- Example usage +main :: IO () +main = do + let exampleName = mkName "example" + exampleType = ConT ''Int + exampleDec = ValD (VarP exampleName) (NormalB (LitE (IntegerL 42))) [] + exampleExp = AppE (VarE exampleName) (LitE (IntegerL 10)) + + let astName = unparse exampleName + astType = unparse exampleType + astDec = unparse exampleDec + astExp = unparse exampleExp + + putStrLn $ printAST astName + putStrLn $ printAST astType + putStrLn $ printAST astDec + putStrLn $ printAST astExp diff --git a/2023/06/27/test14.o b/2023/06/27/test14.o new file mode 100644 index 00000000..bf01f44e Binary files /dev/null and b/2023/06/27/test14.o differ diff --git a/2023/06/27/test15.hs b/2023/06/27/test15.hs new file mode 100644 index 00000000..545f444e --- /dev/null +++ b/2023/06/27/test15.hs @@ -0,0 +1,38 @@ +{-# LANGUAGE TemplateHaskell #-} + +import Language.Haskell.TH + +-- Define the Unparse class +class Unparse a where + unparse :: a -> String + +-- Implement Unparse for Name +instance Unparse Name where + unparse = show + +-- Implement Unparse for Type +instance Unparse Type where + unparse = show + +-- Implement Unparse for Dec +instance Unparse Dec where + unparse = show + +-- Implement Unparse for Exp +instance Unparse Exp where + unparse = show + +-- Get all the function names in the current module +getFunctionNames :: Q [Name] +getFunctionNames = do + info <- reify ''Unparse -- You can replace 'Unparse' with any other type or value in your module + case info of + ClassI _ decs -> return [name | FunD name _ <- decs] + _ -> return [] + +-- Example usage +main :: IO () +main = do + functionNames <- runQ getFunctionNames + putStrLn "Functions in the current module:" + mapM_ (putStrLn . unparse) functionNames diff --git a/2023/06/27/test22.hs b/2023/06/27/test22.hs new file mode 100644 index 00000000..7636fd9b --- /dev/null +++ b/2023/06/27/test22.hs @@ -0,0 +1,47 @@ + +{-# LANGUAGE TemplateHaskell #-} + +-- hellkell.TH +import Language.Haskell.TH.Syntax +import Language.Haskell.TH +import Language.Haskell.TH.Ppr +import Language.Haskell.TH.PprLib + +-- Define the QFoo data type +data QFoo = QFoo + +-- Define the Q to Foo conversion function +qToFoo :: Q Exp -> QFoo +qToFoo q = QFoo + +-- Define the Foo to Q conversion function +fooToQ :: QFoo -> Q Exp +fooToQ foo = [| undefined |] + +-- Define the seed function +seed :: Name -> QFoo +seed name = QFoo + +-- Define the expand function +expand :: QFoo -> QFoo +expand foo = QFoo + +-- Define the reduce function +reduce :: QFoo -> QFoo +reduce foo = QFoo + + +-- runQ (print =<< example) +-- Example function using QuasiQuoters +example :: Q Exp +example = [e| "Hello, World!" |] + +main :: IO () +main = do + let qfoo = qToFoo example + putStrLn "Original Q expression:" + putStrLn (showSDocUnsafe (pprintQ example)) + putStrLn "\nQFoo conversion:" + putStrLn (showSDocUnsafe (pprintQ qfoo)) + putStrLn "\nFoo to Q conversion:" + putStrLn (showSDocUnsafe (pprintQ (fooToQ qfoo))) diff --git a/2023/06/27/test23.hs b/2023/06/27/test23.hs new file mode 100644 index 00000000..c10f8682 --- /dev/null +++ b/2023/06/27/test23.hs @@ -0,0 +1,33 @@ +{-# LANGUAGE TemplateHaskell #-} + +import Language.Haskell.TH + +-- Foo data type +data Foo + = FooIdentifier Name + | FooVariable Name String + | FooComposed [Foo] + +-- Convert Q Exp to Foo +qToFoo :: Q Exp -> Foo +qToFoo qexp = case unTypeQ qexp of + VarE name -> FooVariable name "" + ConE name -> FooIdentifier name + AppE e1 e2 -> FooComposed [qToFoo (return e1), qToFoo (return e2)] + _ -> error "Unsupported expression" + +-- Convert Foo to String +fooToString :: Foo -> String +fooToString (FooIdentifier name) = show name +fooToString (FooVariable name value) = show name ++ " (" ++ value ++ ")" +fooToString (FooComposed foos) = concatMap fooToString foos + +-- Example usage +main :: IO () +main = do + let example = [| (x + 1) * y |] + foo = qToFoo example + putStrLn "Original Q expression:" + putStrLn (pprint example) + putStrLn "\nFoo conversion:" + putStrLn (fooToString foo) diff --git a/2023/06/27/test24 b/2023/06/27/test24 new file mode 100755 index 00000000..41abb565 Binary files /dev/null and b/2023/06/27/test24 differ diff --git a/2023/06/27/test24.dyn_hi b/2023/06/27/test24.dyn_hi new file mode 100644 index 00000000..62a46bf7 Binary files /dev/null and b/2023/06/27/test24.dyn_hi differ diff --git a/2023/06/27/test24.dyn_o b/2023/06/27/test24.dyn_o new file mode 100644 index 00000000..0c9ea82a Binary files /dev/null and b/2023/06/27/test24.dyn_o differ diff --git a/2023/06/27/test24.hi b/2023/06/27/test24.hi new file mode 100644 index 00000000..69281237 Binary files /dev/null and b/2023/06/27/test24.hi differ diff --git a/2023/06/27/test24.hs b/2023/06/27/test24.hs new file mode 100644 index 00000000..856da19c --- /dev/null +++ b/2023/06/27/test24.hs @@ -0,0 +1,38 @@ + +{-# LANGUAGE TemplateHaskell #-} + +import Language.Haskell.TH + +-- Foo data type +data Foo + = FooIdentifier Name + | FooVariable Name String + | FooComposed [Foo] + +-- Convert Q Exp to Foo +qToFoo :: Q Exp -> Q Foo +qToFoo qexp = qexp >>= convertExp + where + convertExp (VarE name) = return (FooVariable name "") + convertExp (ConE name) = return (FooIdentifier name) + convertExp (AppE e1 e2) = do + foo1 <- qToFoo (return e1) + foo2 <- qToFoo (return e2) + return (FooComposed [foo1, foo2]) + convertExp _ = error "Unsupported expression" + +-- Convert Foo to String +fooToString :: Foo -> String +fooToString (FooIdentifier name) = show name +fooToString (FooVariable name value) = show name ++ " (" ++ value ++ ")" +fooToString (FooComposed foos) = concatMap fooToString foos + +-- Example usage +main :: IO () +main = do + let example = [| qToFoo qToFoo|] + foo <- runQ (qToFoo example) + -- putStrLn "Original Q expression:" + -- putStrLn (pprint example) + putStrLn "\nFoo conversion:" + putStrLn (fooToString foo) diff --git a/2023/06/27/test24.o b/2023/06/27/test24.o new file mode 100644 index 00000000..ade84cc3 Binary files /dev/null and b/2023/06/27/test24.o differ diff --git a/2023/06/27/test9.hs b/2023/06/27/test9.hs new file mode 100644 index 00000000..d772982d --- /dev/null +++ b/2023/06/27/test9.hs @@ -0,0 +1,25 @@ +{-# LANGUAGE TemplateHaskell #-} + +module Main where + +import Language.Haskell.TH +import Language.Haskell.TH.Syntax (lift) + +-- Helper function to list the names of functions in the current module +listFunctionNames :: Q [Name] +listFunctionNames = do + currentModule <- thisModule + annotations <- reify currentModule + return $ extractFunctionNames annotations + +-- Extracts the names of functions from a list of annotations +--extractFunctionNames :: [AnnTargetInfo] -> [Name] +extractFunctionNames = foldr extract [] where + extract names = names + +-- Print the names of functions in the current module +main :: IO () +main = do + functionNames <- runQ listFunctionNames + putStrLn "Functions in the current module:" + mapM_ print functionNames diff --git a/2023/06/27/types.txt b/2023/06/27/types.txt new file mode 100644 index 00000000..69882578 --- /dev/null +++ b/2023/06/27/types.txt @@ -0,0 +1,1088 @@ +:type Language.Haskell.TH.Syntax + +:1:1: error: + Not in scope: data constructor ‘Language.Haskell.TH.Syntax’ + Perhaps you meant one of these: + ‘Language.Haskell.TH.Syntax.Q’ (imported from Language.Haskell.TH.Syntax), + ‘Language.Haskell.TH.Syntax.AsP’ (imported from Language.Haskell.TH.Syntax), + ‘Language.Haskell.TH.DataD’ (imported from Language.Haskell.TH) +ghci> :browse Language.Haskell.TH.Syntax +type AnnLookup :: * +data AnnLookup = AnnLookupModule Module | AnnLookupName Name +type AnnTarget :: * +data AnnTarget + = ModuleAnnotation | TypeAnnotation Name | ValueAnnotation Name +type Arity :: * +type Arity = Int +type Bang :: * +data Bang = Bang SourceUnpackedness SourceStrictness +type BangType :: * +type BangType = (Bang, Type) +type Body :: * +data Body = GuardedB [(Guard, Exp)] | NormalB Exp +type Bytes :: * +data Bytes + = Bytes {bytesPtr :: GHC.ForeignPtr.ForeignPtr GHC.Word.Word8, + bytesOffset :: Word, + bytesSize :: Word} +type Callconv :: * +data Callconv = CCall | StdCall | CApi | Prim | JavaScript +type CharPos :: * +type CharPos = (Int, Int) +type Clause :: * +data Clause = Clause [Pat] Body [Dec] +type role Code representational nominal +type Code :: (* -> *) -> * -> * +newtype Code m a = Code {examineCode :: m (TExp a)} +type Con :: * +data Con + = NormalC Name [BangType] + | RecC Name [VarBangType] + | InfixC BangType Name BangType + | ForallC [TyVarBndr Specificity] Cxt Con + | GadtC [Name] [BangType] Type + | RecGadtC [Name] [VarBangType] Type +type Cxt :: * +type Cxt = [Pred] +type Dec :: * +data Dec + = FunD Name [Clause] + | ValD Pat Body [Dec] + | DataD Cxt Name [TyVarBndr ()] (Maybe Kind) [Con] [DerivClause] + | NewtypeD Cxt Name [TyVarBndr ()] (Maybe Kind) Con [DerivClause] + | TySynD Name [TyVarBndr ()] Type + | ClassD Cxt Name [TyVarBndr ()] [FunDep] [Dec] + | InstanceD (Maybe Overlap) Cxt Type [Dec] + | SigD Name Type + | KiSigD Name Kind + | ForeignD Foreign + | InfixD Fixity Name + | PragmaD Pragma + | DataFamilyD Name [TyVarBndr ()] (Maybe Kind) + | DataInstD Cxt + (Maybe [TyVarBndr ()]) + Type + (Maybe Kind) + [Con] + [DerivClause] + | NewtypeInstD Cxt + (Maybe [TyVarBndr ()]) + Type + (Maybe Kind) + Con + [DerivClause] + | TySynInstD TySynEqn + | OpenTypeFamilyD TypeFamilyHead + | ClosedTypeFamilyD TypeFamilyHead [TySynEqn] + | RoleAnnotD Name [Role] + | StandaloneDerivD (Maybe DerivStrategy) Cxt Type + | DefaultSigD Name Type + | PatSynD Name PatSynArgs PatSynDir Pat + | PatSynSigD Name PatSynType + | ImplicitParamBindD String Exp +type DecidedStrictness :: * +data DecidedStrictness + = DecidedLazy | DecidedStrict | DecidedUnpack +type DerivClause :: * +data DerivClause = DerivClause (Maybe DerivStrategy) Cxt +type DerivStrategy :: * +data DerivStrategy + = StockStrategy + | AnyclassStrategy + | NewtypeStrategy + | ViaStrategy Type +type DocLoc :: * +data DocLoc + = ModuleDoc | DeclDoc Name | ArgDoc Name Int | InstDoc Type +type Exp :: * +data Exp + = VarE Name + | ConE Name + | LitE Lit + | AppE Exp Exp + | AppTypeE Exp Type + | InfixE (Maybe Exp) Exp (Maybe Exp) + | UInfixE Exp Exp Exp + | ParensE Exp + | LamE [Pat] Exp + | LamCaseE [Match] + | TupE [Maybe Exp] + | UnboxedTupE [Maybe Exp] + | UnboxedSumE Exp SumAlt SumArity + | CondE Exp Exp Exp + | MultiIfE [(Guard, Exp)] + | LetE [Dec] Exp + | CaseE Exp [Match] + | DoE (Maybe ModName) [Stmt] + | MDoE (Maybe ModName) [Stmt] + | CompE [Stmt] + | ArithSeqE Range + | ListE [Exp] + | SigE Exp Type + | RecConE Name [FieldExp] + | RecUpdE Exp [FieldExp] + | StaticE Exp + | UnboundVarE Name + | LabelE String + | ImplicitParamVarE String + | GetFieldE Exp String + | ProjectionE (GHC.Base.NonEmpty String) +type FamilyResultSig :: * +data FamilyResultSig + = NoSig | KindSig Kind | TyVarSig (TyVarBndr ()) +type FieldExp :: * +type FieldExp = (Name, Exp) +type FieldPat :: * +type FieldPat = (Name, Pat) +type Fixity :: * +data Fixity = Fixity Int FixityDirection +type FixityDirection :: * +data FixityDirection = InfixL | InfixR | InfixN +type Foreign :: * +data Foreign + = ImportF Callconv Safety String Name Type + | ExportF Callconv String Name Type +type FunDep :: * +data FunDep = FunDep [Name] [Name] +type Guard :: * +data Guard = NormalG Exp | PatG [Stmt] +type Info :: * +data Info + = ClassI Dec [InstanceDec] + | ClassOpI Name Type ParentName + | TyConI Dec + | FamilyI Dec [InstanceDec] + | PrimTyConI Name Arity Unlifted + | DataConI Name Type ParentName + | PatSynI Name PatSynType + | VarI Name Type (Maybe Dec) + | TyVarI Name Type +type InjectivityAnn :: * +data InjectivityAnn = InjectivityAnn Name [Name] +type Inline :: * +data Inline = NoInline | Inline | Inlinable +type InstanceDec :: * +type InstanceDec = Dec +type Kind :: * +type Kind = Type +type Lift :: * -> Constraint +class Lift t where + lift :: Quote m => t -> m Exp + default lift :: (r ~ 'GHC.Types.BoxedRep 'GHC.Types.Lifted, + Quote m) => + t -> m Exp + liftTyped :: Quote m => t -> Code m t + {-# MINIMAL liftTyped #-} +type Lit :: * +data Lit + = CharL Char + | StringL String + | IntegerL Integer + | RationalL Rational + | IntPrimL Integer + | WordPrimL Integer + | FloatPrimL Rational + | DoublePrimL Rational + | StringPrimL [GHC.Word.Word8] + | BytesPrimL Bytes + | CharPrimL Char +type Loc :: * +data Loc + = Loc {loc_filename :: String, + loc_package :: String, + loc_module :: String, + loc_start :: CharPos, + loc_end :: CharPos} +type Match :: * +data Match = Match Pat Body [Dec] +type ModName :: * +newtype ModName = ModName String +type Module :: * +data Module = Module PkgName ModName +type ModuleInfo :: * +data ModuleInfo = ModuleInfo [Module] +type Name :: * +data Name = Name OccName NameFlavour +type NameFlavour :: * +data NameFlavour + = NameS + | NameQ ModName + | NameU !Uniq + | NameL !Uniq + | NameG NameSpace PkgName ModName +type NameIs :: * +data NameIs = Alone | Applied | Infix +type NameSpace :: * +data NameSpace = VarName | DataName | TcClsName +type OccName :: * +newtype OccName = OccName String +type Overlap :: * +data Overlap = Overlappable | Overlapping | Overlaps | Incoherent +type ParentName :: * +type ParentName = Name +type Pat :: * +data Pat + = LitP Lit + | VarP Name + | TupP [Pat] + | UnboxedTupP [Pat] + | UnboxedSumP Pat SumAlt SumArity + | ConP Name [Type] [Pat] + | InfixP Pat Name Pat + | UInfixP Pat Name Pat + | ParensP Pat + | TildeP Pat + | BangP Pat + | AsP Name Pat + | WildP + | RecP Name [FieldPat] + | ListP [Pat] + | SigP Pat Type + | ViewP Exp Pat +type PatSynArgs :: * +data PatSynArgs + = PrefixPatSyn [Name] | InfixPatSyn Name Name | RecordPatSyn [Name] +type PatSynDir :: * +data PatSynDir = Unidir | ImplBidir | ExplBidir [Clause] +type PatSynType :: * +type PatSynType = Type +type Phases :: * +data Phases = AllPhases | FromPhase Int | BeforePhase Int +type PkgName :: * +newtype PkgName = PkgName String +type Pragma :: * +data Pragma + = InlineP Name Inline RuleMatch Phases + | SpecialiseP Name Type (Maybe Inline) Phases + | SpecialiseInstP Type + | RuleP String (Maybe [TyVarBndr ()]) [RuleBndr] Exp Exp Phases + | AnnP AnnTarget Exp + | LineP Int String + | CompleteP [Name] (Maybe Name) +type Pred :: * +type Pred = Type +type role Q nominal +type Q :: * -> * +newtype Q a = Q {unQ :: forall (m :: * -> *). Quasi m => m a} +type Quasi :: (* -> *) -> Constraint +class (Control.Monad.IO.Class.MonadIO m, MonadFail m) => + Quasi m where + qNewName :: String -> m Name + qReport :: Bool -> String -> m () + qRecover :: m a -> m a -> m a + qLookupName :: Bool -> String -> m (Maybe Name) + qReify :: Name -> m Info + qReifyFixity :: Name -> m (Maybe Fixity) + qReifyType :: Name -> m Type + qReifyInstances :: Name -> [Type] -> m [Dec] + qReifyRoles :: Name -> m [Role] + qReifyAnnotations :: Data.Data.Data a => AnnLookup -> m [a] + qReifyModule :: Module -> m ModuleInfo + qReifyConStrictness :: Name -> m [DecidedStrictness] + qLocation :: m Loc + qRunIO :: IO a -> m a + qAddDependentFile :: FilePath -> m () + qAddTempFile :: String -> m FilePath + qAddTopDecls :: [Dec] -> m () + qAddForeignFilePath :: ForeignSrcLang -> String -> m () + qAddModFinalizer :: Q () -> m () + qAddCorePlugin :: String -> m () + qGetQ :: base-4.16.4.0:Data.Typeable.Internal.Typeable a => + m (Maybe a) + qPutQ :: base-4.16.4.0:Data.Typeable.Internal.Typeable a => + a -> m () + qIsExtEnabled :: Extension -> m Bool + qExtsEnabled :: m [Extension] + qPutDoc :: DocLoc -> String -> m () + qGetDoc :: DocLoc -> m (Maybe String) + {-# MINIMAL qNewName, qReport, qRecover, qLookupName, qReify, + qReifyFixity, qReifyType, qReifyInstances, qReifyRoles, + qReifyAnnotations, qReifyModule, qReifyConStrictness, qLocation, + qAddDependentFile, qAddTempFile, qAddTopDecls, qAddForeignFilePath, + qAddModFinalizer, qAddCorePlugin, qGetQ, qPutQ, qIsExtEnabled, + qExtsEnabled, qPutDoc, qGetDoc #-} +type Quote :: (* -> *) -> Constraint +class Monad m => Quote m where + newName :: String -> m Name + {-# MINIMAL newName #-} +type Range :: * +data Range + = FromR Exp + | FromThenR Exp Exp + | FromToR Exp Exp + | FromThenToR Exp Exp Exp +type Role :: * +data Role = NominalR | RepresentationalR | PhantomR | InferR +type RuleBndr :: * +data RuleBndr = RuleVar Name | TypedRuleVar Name Type +type RuleMatch :: * +data RuleMatch = ConLike | FunLike +type Safety :: * +data Safety = Unsafe | Safe | Interruptible +type SourceStrictness :: * +data SourceStrictness + = NoSourceStrictness | SourceLazy | SourceStrict +type SourceUnpackedness :: * +data SourceUnpackedness + = NoSourceUnpackedness | SourceNoUnpack | SourceUnpack +type Specificity :: * +data Specificity = SpecifiedSpec | InferredSpec +type Stmt :: * +data Stmt + = BindS Pat Exp + | LetS [Dec] + | NoBindS Exp + | ParS [[Stmt]] + | RecS [Stmt] +type Strict :: * +type Strict = Bang +type StrictType :: * +type StrictType = BangType +type SumAlt :: * +type SumAlt = Int +type SumArity :: * +type SumArity = Int +type role TExp nominal +type TExp :: * -> * +newtype TExp a = TExp {unType :: Exp} +type TyLit :: * +data TyLit = NumTyLit Integer | StrTyLit String | CharTyLit Char +type TySynEqn :: * +data TySynEqn = TySynEqn (Maybe [TyVarBndr ()]) Type Type +type TyVarBndr :: * -> * +data TyVarBndr flag = PlainTV Name flag | KindedTV Name flag Kind +type Type :: * +data Type + = ForallT [TyVarBndr Specificity] Cxt Type + | ForallVisT [TyVarBndr ()] Type + | AppT Type Type + | AppKindT Type Kind + | SigT Type Kind + | VarT Name + | ConT Name + | PromotedT Name + | InfixT Type Name Type + | UInfixT Type Name Type + | ParensT Type + | TupleT Int + | UnboxedTupleT Int + | UnboxedSumT SumArity + | ArrowT + | MulArrowT + | EqualityT + | ListT + | PromotedTupleT Int + | PromotedNilT + | PromotedConsT + | StarT + | ConstraintT + | LitT TyLit + | WildCardT + | ImplicitParamT String Type +type TypeFamilyHead :: * +data TypeFamilyHead + = TypeFamilyHead Name + [TyVarBndr ()] + FamilyResultSig + (Maybe InjectivityAnn) +type Uniq :: * +type Uniq = Integer +type Unlifted :: * +type Unlifted = Bool +type VarBangType :: * +type VarBangType = (Name, Bang, Type) +type VarStrictType :: * +type VarStrictType = VarBangType +addCorePlugin :: String -> Q () +addDependentFile :: FilePath -> Q () +addForeignFile :: ForeignSrcLang -> String -> Q () +addForeignFilePath :: ForeignSrcLang -> FilePath -> Q () +addForeignSource :: ForeignSrcLang -> String -> Q () +addModFinalizer :: Q () -> Q () +addTempFile :: String -> Q FilePath +addTopDecls :: [Dec] -> Q () +badIO :: String -> IO a +bindCode :: Monad m => m a -> (a -> Code m b) -> Code m b +bindCode_ :: Monad m => m a -> Code m b -> Code m b +cmpEq :: Ordering -> Bool +compareBytes :: Bytes -> Bytes -> Ordering +counter :: GHC.IORef.IORef Uniq +dataToExpQ :: + (Quote m, Data.Data.Data a) => + (forall b. Data.Data.Data b => b -> Maybe (m Exp)) -> a -> m Exp +dataToPatQ :: + (Quote m, Data.Data.Data a) => + (forall b. Data.Data.Data b => b -> Maybe (m Pat)) -> a -> m Pat +dataToQa :: + (Quote m, Data.Data.Data a) => + (Name -> k) + -> (Lit -> m q) + -> (k -> [m q] -> m q) + -> (forall b. Data.Data.Data b => b -> Maybe (m q)) + -> a + -> m q +defaultFixity :: Fixity +eqBytes :: Bytes -> Bytes -> Bool +extsEnabled :: Q [Extension] +falseName :: Name +getDoc :: DocLoc -> Q (Maybe String) +getQ :: + base-4.16.4.0:Data.Typeable.Internal.Typeable a => Q (Maybe a) +hoistCode :: + Monad m => (forall x. m x -> n x) -> Code m a -> Code n a +isExtEnabled :: Extension -> Q Bool +isInstance :: Name -> [Type] -> Q Bool +joinCode :: Monad m => m (Code m a) -> Code m a +justName :: Name +leftName :: Name +liftCode :: m (TExp a) -> Code m a +liftData :: (Quote m, Data.Data.Data a) => a -> m Exp +liftString :: Quote m => String -> m Exp +location :: Q Loc +lookupName :: Bool -> String -> Q (Maybe Name) +lookupTypeName :: String -> Q (Maybe Name) +lookupValueName :: String -> Q (Maybe Name) +manyName :: Name +maxPrecedence :: Int +memcmp :: + GHC.Ptr.Ptr a + -> GHC.Ptr.Ptr b + -> Foreign.C.Types.CSize + -> IO Foreign.C.Types.CInt +mkModName :: String -> ModName +mkName :: String -> Name +mkNameG :: NameSpace -> String -> String -> String -> Name +mkNameG_d :: String -> String -> String -> Name +mkNameG_tc :: String -> String -> String -> Name +mkNameG_v :: String -> String -> String -> Name +mkNameL :: String -> Uniq -> Name +mkNameS :: String -> Name +mkNameU :: String -> Uniq -> Name +mkOccName :: String -> OccName +mkPkgName :: String -> PkgName +mk_tup_name :: Int -> NameSpace -> Bool -> Name +modString :: ModName -> String +nameBase :: Name -> String +nameModule :: Name -> Maybe String +namePackage :: Name -> Maybe String +nameSpace :: Name -> Maybe NameSpace +newNameIO :: String -> IO Name +nonemptyName :: Name +nothingName :: Name +occString :: OccName -> String +oneName :: Name +pkgString :: PkgName -> String +putDoc :: DocLoc -> String -> Q () +putQ :: + base-4.16.4.0:Data.Typeable.Internal.Typeable a => a -> Q () +recover :: Q a -> Q a -> Q a +reify :: Name -> Q Info +reifyAnnotations :: Data.Data.Data a => AnnLookup -> Q [a] +reifyConStrictness :: Name -> Q [DecidedStrictness] +reifyFixity :: Name -> Q (Maybe Fixity) +reifyInstances :: Name -> [Type] -> Q [InstanceDec] +reifyModule :: Module -> Q ModuleInfo +reifyRoles :: Name -> Q [Role] +reifyType :: Name -> Q Type +report :: Bool -> String -> Q () +reportError :: String -> Q () +reportWarning :: String -> Q () +rightName :: Name +runIO :: IO a -> Q a +runQ :: Quasi m => Q a -> m a +sequenceQ :: Monad m => [m a] -> m [a] +showName :: Name -> String +showName' :: NameIs -> Name -> String +thenCmp :: Ordering -> Ordering -> Ordering +trueName :: Name +tupleDataName :: Int -> Name +tupleTypeName :: Int -> Name +unTypeCode :: Quote m => Code m a -> m Exp +unTypeQ :: Quote m => m (TExp a) -> m Exp +unboxedSumDataName :: SumAlt -> SumArity -> Name +unboxedSumTypeName :: SumArity -> Name +unboxedTupleDataName :: Int -> Name +unboxedTupleTypeName :: Int -> Name +unsafeCodeCoerce :: Quote m => m Exp -> Code m a +unsafeTExpCoerce :: Quote m => m Exp -> m (TExp a) +type Extension :: * +data Extension + = Cpp + | OverlappingInstances + | UndecidableInstances + | IncoherentInstances + | UndecidableSuperClasses + | MonomorphismRestriction + | MonoLocalBinds + | DeepSubsumption + | RelaxedPolyRec + | ExtendedDefaultRules + | ForeignFunctionInterface + | UnliftedFFITypes + | InterruptibleFFI + | CApiFFI + | GHCForeignImportPrim + | JavaScriptFFI + | ParallelArrays + | Arrows + | TemplateHaskell + | TemplateHaskellQuotes + | QualifiedDo + | QuasiQuotes + | ImplicitParams + | ImplicitPrelude + | ScopedTypeVariables + | AllowAmbiguousTypes + | UnboxedTuples + | UnboxedSums + | UnliftedNewtypes + | UnliftedDatatypes + | BangPatterns + | TypeFamilies + | TypeFamilyDependencies + | TypeInType + | OverloadedStrings + | OverloadedLists + | NumDecimals + | DisambiguateRecordFields + | RecordWildCards + | RecordPuns + | ViewPatterns + | GADTs + | GADTSyntax + | NPlusKPatterns + | DoAndIfThenElse + | BlockArguments + | RebindableSyntax + | ConstraintKinds + | PolyKinds + | DataKinds + | InstanceSigs + | ApplicativeDo + | LinearTypes + | StandaloneDeriving + | DeriveDataTypeable + | AutoDeriveTypeable + | DeriveFunctor + | DeriveTraversable + | DeriveFoldable + | DeriveGeneric + | DefaultSignatures + | DeriveAnyClass + | DeriveLift + | DerivingStrategies + | DerivingVia + | TypeSynonymInstances + | FlexibleContexts + | FlexibleInstances + | ConstrainedClassMethods + | MultiParamTypeClasses + | NullaryTypeClasses + | FunctionalDependencies + | UnicodeSyntax + | ExistentialQuantification + | MagicHash + | EmptyDataDecls + | KindSignatures + | RoleAnnotations + | ParallelListComp + | TransformListComp + | MonadComprehensions + | GeneralizedNewtypeDeriving + | RecursiveDo + | PostfixOperators + | TupleSections + | PatternGuards + | LiberalTypeSynonyms + | RankNTypes + | ImpredicativeTypes + | TypeOperators + | ExplicitNamespaces + | PackageImports + | ExplicitForAll + | AlternativeLayoutRule + | AlternativeLayoutRuleTransitional + | DatatypeContexts + | NondecreasingIndentation + | RelaxedLayout + | TraditionalRecordSyntax + | LambdaCase + | MultiWayIf + | BinaryLiterals + | NegativeLiterals + | HexFloatLiterals + | DuplicateRecordFields + | OverloadedLabels + | EmptyCase + | PatternSynonyms + | PartialTypeSignatures + | NamedWildCards + | StaticPointers + | TypeApplications + | Strict + | StrictData + | EmptyDataDeriving + | NumericUnderscores + | QuantifiedConstraints + | StarIsType + | ImportQualifiedPost + | CUSKs + | StandaloneKindSignatures + | LexicalNegation + | FieldSelectors + | OverloadedRecordDot + | OverloadedRecordUpdate +type ForeignSrcLang :: * +data ForeignSrcLang + = LangC | LangCxx | LangObjc | LangObjcxx | LangAsm | RawObject +ghci> + + + + + + +:browse Language.Haskell.TH.Lib.Internal +type BangQ :: * +type BangQ = Q Bang +type BangTypeQ :: * +type BangTypeQ = Q BangType +type BodyQ :: * +type BodyQ = Q Body +type ClauseQ :: * +type ClauseQ = Q Clause +type CodeQ :: * -> * +type CodeQ = Code Q :: TYPE r -> * +type ConQ :: * +type ConQ = Q Con +type CxtQ :: * +type CxtQ = Q Cxt +type DecQ :: * +type DecQ = Q Dec +type Language.Haskell.TH.Lib.Internal.Decs :: * +type Language.Haskell.TH.Lib.Internal.Decs = [Dec] +type DecsQ :: * +type DecsQ = Q [Dec] +type DerivClauseQ :: * +type DerivClauseQ = Q DerivClause +type DerivStrategyQ :: * +type DerivStrategyQ = Q DerivStrategy +type ExpQ :: * +type ExpQ = Q Exp +type FamilyResultSigQ :: * +type FamilyResultSigQ = Q FamilyResultSig +type FieldExpQ :: * +type FieldExpQ = Q FieldExp +type FieldPatQ :: * +type FieldPatQ = Q FieldPat +type GuardQ :: * +type GuardQ = Q Guard +type InfoQ :: * +type InfoQ = Q Info +type Language.Haskell.TH.Lib.Internal.InjectivityAnn :: * +type Language.Haskell.TH.Lib.Internal.InjectivityAnn = + InjectivityAnn +type KindQ :: * +type KindQ = Q Kind +type MatchQ :: * +type MatchQ = Q Match +type PatQ :: * +type PatQ = Q Pat +type PatSynArgsQ :: * +type PatSynArgsQ = Q PatSynArgs +type PatSynDirQ :: * +type PatSynDirQ = Q PatSynDir +type PredQ :: * +type PredQ = Q Pred +type RangeQ :: * +type RangeQ = Q Range +type Language.Haskell.TH.Lib.Internal.Role :: * +type Language.Haskell.TH.Lib.Internal.Role = Role +type RuleBndrQ :: * +type RuleBndrQ = Q RuleBndr +type SourceStrictnessQ :: * +type SourceStrictnessQ = Q SourceStrictness +type SourceUnpackednessQ :: * +type SourceUnpackednessQ = Q SourceUnpackedness +type StmtQ :: * +type StmtQ = Q Stmt +type StrictTypeQ :: * +type StrictTypeQ = Q StrictType +type TExpQ :: * -> * +type TExpQ a = Q (TExp a) +type TyLitQ :: * +type TyLitQ = Q TyLit +type TySynEqnQ :: * +type TySynEqnQ = Q TySynEqn +type TyVarBndrSpec :: * +type TyVarBndrSpec = TyVarBndr Specificity +type TyVarBndrUnit :: * +type TyVarBndrUnit = TyVarBndr () +type TypeQ :: * +type TypeQ = Q Type +type VarBangTypeQ :: * +type VarBangTypeQ = Q VarBangType +type VarStrictTypeQ :: * +type VarStrictTypeQ = Q VarStrictType +anyclassStrategy :: Quote m => m DerivStrategy +appE :: Quote m => m Exp -> m Exp -> m Exp +appK :: Kind -> Kind -> Kind +appKindT :: Quote m => m Type -> m Kind -> m Type +appT :: Quote m => m Type -> m Type -> m Type +appTypeE :: Quote m => m Exp -> m Type -> m Exp +appsE :: Quote m => [m Exp] -> m Exp +arithSeqE :: Quote m => m Range -> m Exp +arrowK :: Kind +arrowT :: Quote m => m Type +asP :: Quote m => Name -> m Pat -> m Pat +bang :: + Quote m => m SourceUnpackedness -> m SourceStrictness -> m Bang +bangP :: Quote m => m Pat -> m Pat +bangType :: Quote m => m Bang -> m Type -> m BangType +bindS :: Quote m => m Pat -> m Exp -> m Stmt +bytesPrimL :: Bytes -> Lit +cApi :: Callconv +cCall :: Callconv +caseE :: Quote m => m Exp -> [m Match] -> m Exp +charL :: Char -> Lit +charPrimL :: Char -> Lit +charTyLit :: Quote m => Char -> m TyLit +Language.Haskell.TH.Lib.Internal.classD :: + Quote m => + m Cxt -> Name -> [m (TyVarBndr ())] -> [FunDep] -> [m Dec] -> m Dec +classP :: Quote m => Name -> [m Type] -> m Pred +clause :: Quote m => [m Pat] -> m Body -> [m Dec] -> m Clause +Language.Haskell.TH.Lib.Internal.closedTypeFamilyD :: + Quote m => + Name + -> [m (TyVarBndr ())] + -> m FamilyResultSig + -> Maybe Language.Haskell.TH.Lib.Internal.InjectivityAnn + -> [m TySynEqn] + -> m Dec +compE :: Quote m => [m Stmt] -> m Exp +conE :: Quote m => Name -> m Exp +conK :: Name -> Kind +Language.Haskell.TH.Lib.Internal.conP :: + Quote m => Name -> [m Type] -> [m Pat] -> m Pat +conT :: Quote m => Name -> m Type +condE :: Quote m => m Exp -> m Exp -> m Exp -> m Exp +Language.Haskell.TH.Lib.Internal.constraintK :: Quote m => m Kind +cxt :: Quote m => [m Pred] -> m Cxt +Language.Haskell.TH.Lib.Internal.dataD :: + Quote m => + m Cxt + -> Name + -> [m (TyVarBndr ())] + -> Maybe (m Kind) + -> [m Con] + -> [m DerivClause] + -> m Dec +dataD_doc :: + Q Cxt + -> Name + -> [Q (TyVarBndr ())] + -> Maybe (Q Kind) + -> [(Q Con, Maybe String, [Maybe String])] + -> [Q DerivClause] + -> Maybe String + -> Q Dec +Language.Haskell.TH.Lib.Internal.dataFamilyD :: + Quote m => Name -> [m (TyVarBndr ())] -> Maybe (m Kind) -> m Dec +Language.Haskell.TH.Lib.Internal.dataInstD :: + Quote m => + m Cxt + -> Maybe [m (TyVarBndr ())] + -> m Type + -> Maybe (m Kind) + -> [m Con] + -> [m DerivClause] + -> m Dec +dataInstD_doc :: + Q Cxt + -> Maybe [Q (TyVarBndr ())] + -> Q Type + -> Maybe (Q Kind) + -> [(Q Con, Maybe String, [Maybe String])] + -> [Q DerivClause] + -> Maybe String + -> Q Dec +defaultSigD :: Quote m => Name -> m Type -> m Dec +Language.Haskell.TH.Lib.Internal.derivClause :: + Quote m => Maybe (m DerivStrategy) -> [m Pred] -> m DerivClause +Language.Haskell.TH.Lib.Internal.doE :: + Quote m => Maybe ModName -> [m Stmt] -> m Exp +Language.Haskell.TH.Lib.Internal.docCons :: + (Q Con, Maybe String, [Maybe String]) -> Q () +doublePrimL :: Rational -> Lit +dyn :: Quote m => String -> m Exp +equalP :: Quote m => m Type -> m Type -> m Pred +equalityT :: Quote m => m Type +explBidir :: Quote m => [m Clause] -> m PatSynDir +fieldExp :: Quote m => Name -> m Exp -> m (Name, Exp) +fieldPat :: Quote m => Name -> m Pat -> m FieldPat +floatPrimL :: Rational -> Lit +forImpD :: + Quote m => Callconv -> Safety -> String -> Name -> m Type -> m Dec +Language.Haskell.TH.Lib.Internal.forallC :: + Quote m => [m (TyVarBndr Specificity)] -> m Cxt -> m Con -> m Con +Language.Haskell.TH.Lib.Internal.forallT :: + Quote m => [m (TyVarBndr Specificity)] -> m Cxt -> m Type -> m Type +forallVisT :: Quote m => [m (TyVarBndr ())] -> m Type -> m Type +fromE :: Quote m => m Exp -> m Exp +fromR :: Quote m => m Exp -> m Range +fromThenE :: Quote m => m Exp -> m Exp -> m Exp +fromThenR :: Quote m => m Exp -> m Exp -> m Range +fromThenToE :: Quote m => m Exp -> m Exp -> m Exp -> m Exp +fromThenToR :: Quote m => m Exp -> m Exp -> m Exp -> m Range +fromToE :: Quote m => m Exp -> m Exp -> m Exp +fromToR :: Quote m => m Exp -> m Exp -> m Range +funD :: Quote m => Name -> [m Clause] -> m Dec +funD_doc :: + Name -> [Q Clause] -> Maybe String -> [Maybe String] -> Q Dec +funDep :: [Name] -> [Name] -> FunDep +gadtC :: Quote m => [Name] -> [m StrictType] -> m Type -> m Con +getFieldE :: Quote m => m Exp -> String -> m Exp +guardedB :: Quote m => [m (Guard, Exp)] -> m Body +implBidir :: Quote m => m PatSynDir +implicitParamBindD :: Quote m => String -> m Exp -> m Dec +implicitParamT :: Quote m => String -> m Type -> m Type +implicitParamVarE :: Quote m => String -> m Exp +inferR :: Language.Haskell.TH.Lib.Internal.Role +inferredSpec :: Specificity +infixApp :: Quote m => m Exp -> m Exp -> m Exp -> m Exp +infixC :: + Quote m => m (Bang, Type) -> Name -> m (Bang, Type) -> m Con +infixE :: + Quote m => Maybe (m Exp) -> m Exp -> Maybe (m Exp) -> m Exp +infixLD :: Quote m => Int -> Name -> m Dec +infixND :: Quote m => Int -> Name -> m Dec +infixP :: Quote m => m Pat -> Name -> m Pat -> m Pat +infixPatSyn :: Quote m => Name -> Name -> m PatSynArgs +infixRD :: Quote m => Int -> Name -> m Dec +infixT :: Quote m => m Type -> Name -> m Type -> m Type +injectivityAnn :: + Name -> [Name] -> Language.Haskell.TH.Lib.Internal.InjectivityAnn +instanceD :: Quote m => m Cxt -> m Type -> [m Dec] -> m Dec +instanceWithOverlapD :: + Quote m => Maybe Overlap -> m Cxt -> m Type -> [m Dec] -> m Dec +intPrimL :: Integer -> Lit +integerL :: Integer -> Lit +interruptible :: Safety +isStrict :: Quote m => m Strict +javaScript :: Callconv +kiSigD :: Quote m => Name -> m Kind -> m Dec +Language.Haskell.TH.Lib.Internal.kindSig :: + Quote m => m Kind -> m FamilyResultSig +kindedInvisTV :: + Quote m => + Name -> Specificity -> m Kind -> m (TyVarBndr Specificity) +Language.Haskell.TH.Lib.Internal.kindedTV :: + Quote m => Name -> m Kind -> m (TyVarBndr ()) +labelE :: Quote m => String -> m Exp +lam1E :: Quote m => m Pat -> m Exp -> m Exp +lamCaseE :: Quote m => [m Match] -> m Exp +lamE :: Quote m => [m Pat] -> m Exp -> m Exp +letE :: Quote m => [m Dec] -> m Exp -> m Exp +letS :: Quote m => [m Dec] -> m Stmt +listE :: Quote m => [m Exp] -> m Exp +listK :: Kind +listP :: Quote m => [m Pat] -> m Pat +listT :: Quote m => m Type +litE :: Quote m => Lit -> m Exp +litP :: Quote m => Lit -> m Pat +litT :: Quote m => m TyLit -> m Type +match :: Quote m => m Pat -> m Body -> [m Dec] -> m Match +Language.Haskell.TH.Lib.Internal.mdoE :: + Quote m => Maybe ModName -> [m Stmt] -> m Exp +moduleAnnotation :: AnnTarget +mulArrowT :: Quote m => m Type +multiIfE :: Quote m => [m (Guard, Exp)] -> m Exp +Language.Haskell.TH.Lib.Internal.newtypeD :: + Quote m => + m Cxt + -> Name + -> [m (TyVarBndr ())] + -> Maybe (m Kind) + -> m Con + -> [m DerivClause] + -> m Dec +newtypeD_doc :: + Q Cxt + -> Name + -> [Q (TyVarBndr ())] + -> Maybe (Q Kind) + -> (Q Con, Maybe String, [Maybe String]) + -> [Q DerivClause] + -> Maybe String + -> Q Dec +Language.Haskell.TH.Lib.Internal.newtypeInstD :: + Quote m => + m Cxt + -> Maybe [m (TyVarBndr ())] + -> m Type + -> Maybe (m Kind) + -> m Con + -> [m DerivClause] + -> m Dec +newtypeInstD_doc :: + Q Cxt + -> Maybe [Q (TyVarBndr ())] + -> Q Type + -> Maybe (Q Kind) + -> (Q Con, Maybe String, [Maybe String]) + -> [Q DerivClause] + -> Maybe String + -> Q Dec +newtypeStrategy :: Quote m => m DerivStrategy +noBindS :: Quote m => m Exp -> m Stmt +Language.Haskell.TH.Lib.Internal.noSig :: + Quote m => m FamilyResultSig +noSourceStrictness :: Quote m => m SourceStrictness +noSourceUnpackedness :: Quote m => m SourceUnpackedness +nominalR :: Language.Haskell.TH.Lib.Internal.Role +normalB :: Quote m => m Exp -> m Body +normalC :: Quote m => Name -> [m BangType] -> m Con +normalG :: Quote m => m Exp -> m Guard +normalGE :: Quote m => m Exp -> m Exp -> m (Guard, Exp) +notStrict :: Quote m => m Strict +numTyLit :: Quote m => Integer -> m TyLit +Language.Haskell.TH.Lib.Internal.openTypeFamilyD :: + Quote m => + Name + -> [m (TyVarBndr ())] + -> m FamilyResultSig + -> Maybe Language.Haskell.TH.Lib.Internal.InjectivityAnn + -> m Dec +parS :: Quote m => [[m Stmt]] -> m Stmt +parensE :: Quote m => m Exp -> m Exp +parensP :: Quote m => m Pat -> m Pat +parensT :: Quote m => m Type -> m Type +patG :: Quote m => [m Stmt] -> m Guard +patGE :: Quote m => [m Stmt] -> m Exp -> m (Guard, Exp) +patSynD :: + Quote m => Name -> m PatSynArgs -> m PatSynDir -> m Pat -> m Dec +patSynD_doc :: + Name + -> Q PatSynArgs + -> Q PatSynDir + -> Q Pat + -> Maybe String + -> [Maybe String] + -> Q Dec +patSynSigD :: Quote m => Name -> m Type -> m Dec +phantomR :: Language.Haskell.TH.Lib.Internal.Role +plainInvisTV :: + Quote m => Name -> Specificity -> m (TyVarBndr Specificity) +Language.Haskell.TH.Lib.Internal.plainTV :: + Quote m => Name -> m (TyVarBndr ()) +pragAnnD :: Quote m => AnnTarget -> m Exp -> m Dec +pragCompleteD :: Quote m => [Name] -> Maybe Name -> m Dec +pragInlD :: + Quote m => Name -> Inline -> RuleMatch -> Phases -> m Dec +pragLineD :: Quote m => Int -> String -> m Dec +Language.Haskell.TH.Lib.Internal.pragRuleD :: + Quote m => + String + -> Maybe [m (TyVarBndr ())] + -> [m RuleBndr] + -> m Exp + -> m Exp + -> Phases + -> m Dec +pragSpecD :: Quote m => Name -> m Type -> Phases -> m Dec +pragSpecInlD :: + Quote m => Name -> m Type -> Inline -> Phases -> m Dec +pragSpecInstD :: Quote m => m Type -> m Dec +prefixPatSyn :: Quote m => [Name] -> m PatSynArgs +prim :: Callconv +projectionE :: Quote m => GHC.Base.NonEmpty String -> m Exp +promotedConsT :: Quote m => m Type +promotedNilT :: Quote m => m Type +promotedT :: Quote m => Name -> m Type +promotedTupleT :: Quote m => Int -> m Type +rationalL :: Rational -> Lit +recC :: Quote m => Name -> [m VarBangType] -> m Con +recConE :: Quote m => Name -> [m (Name, Exp)] -> m Exp +recGadtC :: + Quote m => [Name] -> [m VarStrictType] -> m Type -> m Con +recP :: Quote m => Name -> [m FieldPat] -> m Pat +recS :: Quote m => [m Stmt] -> m Stmt +recUpdE :: Quote m => m Exp -> [m (Name, Exp)] -> m Exp +recordPatSyn :: Quote m => [Name] -> m PatSynArgs +representationalR :: Language.Haskell.TH.Lib.Internal.Role +roleAnnotD :: + Quote m => Name -> [Language.Haskell.TH.Lib.Internal.Role] -> m Dec +ruleVar :: Quote m => Name -> m RuleBndr +safe :: Safety +sectionL :: Quote m => m Exp -> m Exp -> m Exp +sectionR :: Quote m => m Exp -> m Exp -> m Exp +sigD :: Quote m => Name -> m Type -> m Dec +sigE :: Quote m => m Exp -> m Type -> m Exp +sigP :: Quote m => m Pat -> m Type -> m Pat +Language.Haskell.TH.Lib.Internal.sigT :: + Quote m => m Type -> m Kind -> m Type +sourceLazy :: Quote m => m SourceStrictness +sourceNoUnpack :: Quote m => m SourceUnpackedness +sourceStrict :: Quote m => m SourceStrictness +sourceUnpack :: Quote m => m SourceUnpackedness +specifiedSpec :: Specificity +standaloneDerivD :: Quote m => m Cxt -> m Type -> m Dec +Language.Haskell.TH.Lib.Internal.standaloneDerivWithStrategyD :: + Quote m => Maybe (m DerivStrategy) -> m Cxt -> m Type -> m Dec +Language.Haskell.TH.Lib.Internal.starK :: Quote m => m Kind +staticE :: Quote m => m Exp -> m Exp +stdCall :: Callconv +stockStrategy :: Quote m => m DerivStrategy +strTyLit :: Quote m => String -> m TyLit +strictType :: Quote m => m Strict -> m Type -> m StrictType +stringE :: Quote m => String -> m Exp +stringL :: String -> Lit +stringPrimL :: [GHC.Word.Word8] -> Lit +thisModule :: Q Module +tildeP :: Quote m => m Pat -> m Pat +Language.Haskell.TH.Lib.Internal.tupE :: + Quote m => [Maybe (m Exp)] -> m Exp +tupP :: Quote m => [m Pat] -> m Pat +tupleK :: Int -> Kind +tupleT :: Quote m => Int -> m Type +Language.Haskell.TH.Lib.Internal.tySynD :: + Quote m => Name -> [m (TyVarBndr ())] -> m Type -> m Dec +Language.Haskell.TH.Lib.Internal.tySynEqn :: + Quote m => + Maybe [m (TyVarBndr ())] -> m Type -> m Type -> m TySynEqn +tySynInstD :: Quote m => m TySynEqn -> m Dec +Language.Haskell.TH.Lib.Internal.tyVarSig :: + Quote m => m (TyVarBndr ()) -> m FamilyResultSig +typeAnnotation :: Name -> AnnTarget +typedRuleVar :: Quote m => Name -> m Type -> m RuleBndr +uInfixE :: Quote m => m Exp -> m Exp -> m Exp -> m Exp +uInfixP :: Quote m => m Pat -> Name -> m Pat -> m Pat +uInfixT :: Quote m => m Type -> Name -> m Type -> m Type +unboundVarE :: Quote m => Name -> m Exp +unboxedSumE :: Quote m => m Exp -> SumAlt -> SumArity -> m Exp +unboxedSumP :: Quote m => m Pat -> SumAlt -> SumArity -> m Pat +unboxedSumT :: Quote m => SumArity -> m Type +Language.Haskell.TH.Lib.Internal.unboxedTupE :: + Quote m => [Maybe (m Exp)] -> m Exp +unboxedTupP :: Quote m => [m Pat] -> m Pat +unboxedTupleT :: Quote m => Int -> m Type +unidir :: Quote m => m PatSynDir +unpacked :: Quote m => m Strict +unsafe :: Safety +valD :: Quote m => m Pat -> m Body -> [m Dec] -> m Dec +valueAnnotation :: Name -> AnnTarget +varBangType :: Quote m => Name -> m BangType -> m VarBangType +varE :: Quote m => Name -> m Exp +varK :: Name -> Kind +varP :: Quote m => Name -> m Pat +varStrictType :: Quote m => Name -> m StrictType -> m VarStrictType +varT :: Quote m => Name -> m Type +viaStrategy :: Quote m => m Type -> m DerivStrategy +viewP :: Quote m => m Exp -> m Pat -> m Pat +wildCardT :: Quote m => m Type +wildP :: Quote m => m Pat +withDecDoc :: String -> Q Dec -> Q Dec +withDecsDoc :: String -> Q [Dec] -> Q [Dec] +wordPrimL :: Integer -> Lit +ghci> diff --git a/2023/06/28/test25 b/2023/06/28/test25 new file mode 100755 index 00000000..f65b84ac Binary files /dev/null and b/2023/06/28/test25 differ diff --git a/2023/06/28/test25.dyn_hi b/2023/06/28/test25.dyn_hi new file mode 100644 index 00000000..e4da2628 Binary files /dev/null and b/2023/06/28/test25.dyn_hi differ diff --git a/2023/06/28/test25.dyn_o b/2023/06/28/test25.dyn_o new file mode 100644 index 00000000..3be45a63 Binary files /dev/null and b/2023/06/28/test25.dyn_o differ diff --git a/2023/06/28/test25.hi b/2023/06/28/test25.hi new file mode 100644 index 00000000..eb9d799e Binary files /dev/null and b/2023/06/28/test25.hi differ diff --git a/2023/06/28/test25.hs b/2023/06/28/test25.hs new file mode 100644 index 00000000..3b2177cb --- /dev/null +++ b/2023/06/28/test25.hs @@ -0,0 +1,168 @@ +{-# LANGUAGE TemplateHaskell #-} + +import Language.Haskell.TH + +-- Foo data type +data Foo + = FooIdentifier String + | FooVariable String String + | FooComposed [Foo] + | FooList Foo [Foo ] + | FooFunction String [Foo] + deriving Show +-- Convert Q Exp to Foo + +--listToQ :: [Foo] -> uuQ Foo +--listToQ = foldr (\x acc -> [| $x >>= $acc |]) [| return |] + +--listToQ :: [Q Exp] -> Q Foo +--listToQ = foldr (\x acc -> x >>= acc) (return $ FooComposed []) +listToQ :: [Q Exp] -> Q Foo +--listToQ = foldr (\x acc -> x >>= \expr -> acc >>= \foo -> return (FooComposed [expr] : foo)) (return (FooComposed [])) + +--listToQ = foldr (\x acc -> x >>= \expr -> acc >>= \foo -> return (FooComposed (expr : foo))) (return (FooComposed [])) + +exprToFoo :: Exp -> Q Foou +exprToFoo expr = return (FooIdentifier (show expr)) + + + +listToQ = foldr (\x acc -> x >>= \expr -> acc >>= \foo -> return FooList expr foo) (return (FooComposed [])) + + + +listToQ2 = foldr (\x acc -> do + expr <- x + FooComposed foo <- acc + convertedExpr <- exprToFoo expr + return (FooComposed (convertedExpr : foo)) + ) (return (FooComposed [])) + + +convertDecsToFoo :: [Dec] -> Q Foo +convertDecsToFoo decs = do + fooDecs <- mapM convertDec decs >>= listToQ + return (FooComposed (FooIdentifier "LetE" : fooDecs)) + +convertDec :: Dec -> Q Foo +convertDec (ValD pat rhs decs) = do + fooPat <- return (FooIdentifier "TODOPats") + fooRhs <- qToFoo (return rhs) + fooDecs <- mapM convertDec decs + return (FooComposed [FooIdentifier "ValD", fooPat, fooRhs, FooComposed fooDecs]) + +-- Usage: +--fooDecs <- convertDecsToFoo decs +--fooBody <- qToFoo (return body) +--return (FooComposed (FooIdentifier (nameBase (mkName "LetE")) : fooDecs ++ [fooBody])) + +qToFoo :: Q Exp -> Q Foo +qToFoo qexp = qexp >>= convertExp + where + convertExp (VarE name) = return (FooVariable (nameBase name) "") + convertExp (ConE name) = return (FooIdentifier (nameBase name)) + --convertExp (LamE + convertExp (LamE pats body) = do + --fooPats <- mapM qToFoo (map return pats) + fooPats <- return [(FooIdentifier "TODOPats")] + fooBody <- qToFoo (return body) + return (FooComposed (fooPats ++ [fooBody])) + + convertExp (CaseE scrut matches) = do + fooScrut <- qToFoo (return scrut) + --fooMatches <- mapM convertMatch matches + fooMatches <- return [(FooIdentifier "TODOMatches")] + return (FooComposed (fooScrut : fooMatches)) + where + convertMatch (match) = do + return [(FooIdentifier "TODOMatch")] + convertMatch (pat, body) = do + fooPat <- qToFoo (return pat) + fooBody <- qToFoo (return body) + return [FooComposed [fooPat, fooBody]] + + convertExp (AppE e1 e2) = do + foo1 <- qToFoo (return e1) + foo2 <- qToFoo (return e2) + case foo1 of + FooIdentifier funcName -> return (FooFunction funcName [foo2]) + FooFunction funcName args -> return (FooFunction funcName (args ++ [foo2])) + + --convertExp _ = error ("Unsupported expression") + + + --convertExp (VarE name) = return (FooVariable name "") + convertExp (ConE name) = return (FooIdentifier (nameBase name)) + convertExp (LitE lit) = return (FooComposed [FooIdentifier (nameBase(mkName "LitE")), FooVariable (nameBase(mkName (show lit))) (show lit)]) + convertExp (AppE e1 e2) = do + foo1 <- qToFoo (return e1) + foo2 <- qToFoo (return e2) + return (FooComposed [foo1, foo2]) + convertExp (LamE pats body) = do + --fooPats <- mapM qToFoo (map return pats) + fooPats <- return [(FooIdentifier "TODOPats")] + fooBody <- qToFoo (return body) + return (FooComposed (fooPats ++ [fooBody])) + convertExp (TupE exprs) = do + --fooExprs <- mapM qToFoo (map return exprs) + fooExprs <- return [(FooIdentifier "TODOexpr")] +-- return (FooComposed (FooIdentifier (mkName "TupE") : fooExprs)) + return (FooIdentifier ("TODO")) + convertExp (CondE cond trueExpr falseExpr) = do + fooCond <- qToFoo (return cond) + fooTrue <- qToFoo (return trueExpr) + fooFalse <- qToFoo (return falseExpr) + return (FooComposed [FooIdentifier (nameBase(mkName "CondE")), fooCond, fooTrue, fooFalse]) + convertExp (LetE decs body) = do + fooDecs <- listToQ <$> mapM convertDec decs + fooBody <- qToFoo (return body) + return (FooComposed (FooIdentifier (nameBase(mkName "LetE")) : fooDecs ++ [fooBody])) + where + convertDec (ValD pat rhs decs) = do + --fooPat <- qToFoo (return pat) + fooPat <-[(FooIdentifier "TODOPats")] + fooRhs <- qToFoo (return rhs) + fooDecs <- mapM convertDec decs + return (FooComposed [FooIdentifier "ValD", fooPat, fooRhs, FooComposed fooDecs]) + convertDec (FunD name clauses) = do + fooClauses <- mapM convertClause clauses + return (FooComposed [FooIdentifier "FunD", FooIdentifier name, FooComposed fooClauses]) + convertDec dec = error ("Unsupported declaration: " ++ show dec) + convertClause (Clause pats body decs) = do + fooPats <- mapM qToFoo (map return pats) + fooBody <- qToFoo (return body) + fooDecs <- mapM convertDec decs + return (FooComposed (fooPats ++ [fooBody, FooComposed fooDecs])) +-- convertExp (CaseE scrut matches) = do +-- fooScrut <- qToFoo (return scrut) +-- fooMatches <- mapM convertMatch matches +-- return (FooComposed (fooScrut : fooMatches)) +-- where + -- convertMatch (pat, body) = do + -- fooPat <- qToFoo (return pat) + -- fooBody <- qToFoo (return body) + -- return (FooComposed [fooPat, fooBody]) + --convertExp (UnsupportedE expr) = error ("Unsupported expression: " ++ show expr) + + +-- Convert Foo to String +fooToString :: Foo -> String +fooToString (FooIdentifier name) = show name +fooToString (FooVariable name value) = show name ++ " (" ++ value ++ ")" +fooToString (FooComposed foos) = concatMap fooToString foos +fooToString (FooFunction name args) = show name ++ " " ++ show args +--fooooo = (fooToString) + +f1 = 1 +f2 = f1 + f1 + +-- Example usage +main :: IO () +main = do +-- let example1 = fooToString (FooIdentifier "id") + let example = [| fooToString (FooIdentifier "id") |] + foo <- runQ (qToFoo example) + putStrLn "Original Q expression:" +-- putStrLn (pprint example1) + putStrLn "\nFoo conversion:" + putStrLn (fooToString foo) diff --git a/2023/06/28/test25.o b/2023/06/28/test25.o new file mode 100644 index 00000000..2e0f106c Binary files /dev/null and b/2023/06/28/test25.o differ diff --git a/2023/06/28/test26.hs b/2023/06/28/test26.hs new file mode 100644 index 00000000..fd841853 --- /dev/null +++ b/2023/06/28/test26.hs @@ -0,0 +1,22 @@ +import Language.Haskell.TH + +-- Recursive reification function +reifyIdentifiers :: Q Exp -> Q Exp +reifyIdentifiers (VarE name) = do + -- Reify the identifier and replace it with the reified representation + info <- reify name + return $ LitE (StringL (show info)) +reifyIdentifiers (AppE e1 e2) = + -- Recursively reify identifiers in function and argument expressions + AppE (reifyIdentifiers e1) (reifyIdentifiers e2) +reifyIdentifiers (InfixE m1 op m2) = + -- Recursively reify identifiers in infix expressions + InfixE (Just $ reifyIdentifiers m1) (reifyIdentifiers op) (Just $ reifyIdentifiers m2) +reifyIdentifiers other = return other + +-- Example usage +main :: IO () +main = do + let expr = [| add (x + y) z |] -- Example expression with identifiers 'add', 'x', 'y', 'z' + reifiedExpr <- runQ (reifyIdentifiers expr) + putStrLn (pprint reifiedExpr) diff --git a/2023/06/29/th-desugar b/2023/06/29/th-desugar new file mode 160000 index 00000000..4fabbbee --- /dev/null +++ b/2023/06/29/th-desugar @@ -0,0 +1 @@ +Subproject commit 4fabbbeea71f5b2ee1c8e781a3c8bde770efcfcb diff --git a/2023/06/30/test21.hs b/2023/06/30/test21.hs new file mode 100644 index 00000000..0d8347ca --- /dev/null +++ b/2023/06/30/test21.hs @@ -0,0 +1,22 @@ +{-# LANGUAGE TemplateHaskell #-} +import Language.Haskell.TH + + + + +import Language.Haskell.TH +import Language.Haskell.TH.Syntax + +applyReification :: ExpQ -> Q () +applyReification exp = do + exp' <- unTypeExp exp + info <- reify exp' + runIO $ print info + case info of + VarI _ t _ -> applyReification (return t) + _ -> return () + +main :: IO () +main = do + putStrLn "Initial expression: x = 1 + 1" + applyReification [|x|] diff --git a/2023/06/30/test27.hs b/2023/06/30/test27.hs new file mode 100644 index 00000000..e9a93d65 --- /dev/null +++ b/2023/06/30/test27.hs @@ -0,0 +1,82 @@ + + +import Language.Haskell.TH +import Language.Haskell.TH.Syntax (Exp(..)) +import Control.Monad (sequence) + +data Foo + = FooIdentifier String + | FooVariable String String + | FooComposed [Foo] + | FooFunction String [Foo] + deriving Show + +stmtToFoo :: Stmt -> Q Foo +stmtToFoo (NoBindS expr) = exprToFoo expr +stmtToFoo _ = error "Unsupported guard statement" + +guardToFoo :: Q [Stmt] -> Q Foo +guardToFoo stmts = do + guardStmts <- stmts + fooStmts <- mapM stmtToFoo guardStmts + return $ FooComposed (FooIdentifier "GuardedB" : fooStmts) + + +bodyToFoo :: Body -> Q Foo +bodyToFoo (NormalB expr) = exprToFoo expr +bodyToFoo (GuardedB guards) = convertGuards guards + where + convertGuards [] = error "No guards provided" + convertGuards [(cond, expr)] = do + fooCond <- guardToFoo cond + fooExpr <- exprToFoo expr + return $ FooComposed [FooIdentifier "GuardedB", fooCond, fooExpr] + convertGuards _ = error "Multiple guards not supported" +bodyToFoo _ = error "Unsupported body type" + + + + +qToFoo :: Exp -> Q Foo +qToFoo (VarE name) = return (FooIdentifier (show name)) +qToFoo (AppE f x) = do + fooF <- qToFoo f + fooX <- qToFoo x + return (FooFunction "apply" [fooF, fooX]) +qToFoo (LamE args body) = do + fooArgs <- mapM (\(VarP name) -> return (FooVariable (show name) "")) args + fooBody <- qToFoo body + return (FooFunction "lambda" (fooArgs ++ [fooBody])) +qToFoo _ = error "Unsupported expression type" + + +exprToFoo :: Exp -> Q Foo +exprToFoo (VarE name) = return (FooVariable (show name) "") +exprToFoo (ConE name) = return (FooIdentifier (show name)) +exprToFoo (AppE f x) = do + fooF <- exprToFoo f + fooX <- exprToFoo x + return (FooComposed [fooF, fooX]) +exprToFoo (LamE args body) = do + let argNames = map showArg args + fooBody <- exprToFoo body + return (FooFunction "Lambda" (map FooIdentifier argNames ++ [fooBody])) + where + showArg (VarP name) = show name + showArg _ = "" + +listToFoo :: [Q Foo] -> Q Foo +listToFoo = fmap FooComposed . sequence + +convertDec :: Dec -> Q Foo +convertDec (ValD pat rhs decs) = do + fooPat <- return (FooIdentifier "TODOPats") + fooRhs <- return (qToFoo rhs) + fooDecs <- mapM convertDec decs + return (FooComposed [FooIdentifier "ValD", fooPat, fooRhs, FooComposed fooDecs]) + +-- Usage example +test :: Dec -> Q Foo +test decs = do + fooDecs <- mapM convertDec decs >>= listToFoo + return (FooComposed (FooIdentifier "LetE" : fooDecs)) diff --git a/2023/07/01/test16.hs b/2023/07/01/test16.hs new file mode 100644 index 00000000..8d6700d1 --- /dev/null +++ b/2023/07/01/test16.hs @@ -0,0 +1,86 @@ + -- To create a sum and calculate the eigenvector of relationships between types, you can utilize graph-based algorithms. Here's an outline of the steps involved: +-- u +-- 1. Define a directed graph where the types are represented as nodes, and the relationships between types are represented as edges. + +-- 2. Assign weights to the edges based on the relationships between the types. For example, you can use the number of shared constructors or other criteria to determine the weight. + +-- 3. Apply a graph algorithm such as the PageRank algorithm, which calculates the eigenvector centrality of each node in the graph. The eigenvector centrality represents the importance or influence of a node based on its connections to other nodes. + +-- 4. Retrieve the eigenvector values and identify the type with the highest value, indicating its prominence in the relationships. + +-- Here's an example of how you can incorporate these steps into the existing code: + +-- ` +import Data.List +import Control.Monad +import qualified Data.Map as Map +import qualified Data.Set as Set +import qualified Numeric.LinearAlgebra as LA +import qualified Language.Haskell.Interpreter as I +import Language.Haskell.Interpreter (Interpreter, GhcError(..), InterpreterError(..)) +import qualified Language.Haskell.Exts as H +import Language.Haskell.Exts.SrcLoc + +main :: IO () +main = do + r <- I.runInterpreter interpreterTest + case r of + Left err -> putStrLn $ errorString err + Right () -> return () + +-- ... (previous code) + +interpreterTest :: Interpreter () +interpreterTest = do + -- ... (previous code) + + -- Create a directed graph with weighted edges + let typeGraph = createTypeGraph finalTypeConstructors + + -- Apply PageRank algorithm to calculate eigenvector centrality + let eigenvector = pageRank typeGraph + + -- Find the type with the highest eigenvector value + let (maxType, _) = findMaxEigenvector eigenvector + + p $ "Type with the highest eigenvector value: " ++ maxType + + return () + +-- Create a directed graph with weighted edges based on type constructors +createTypeGraph :: [(String, [String])] -> Map.Map String (Map.Map String Double) +createTypeGraph typeConstructors = + let + edges = concatMap createEdges typeConstructors + edgeMap = foldl insertEdge Map.empty edges + in + normalizeWeights edgeMap + +-- Create weighted edges between types based on constructors +createEdges :: (String, [String]) -> [(String, String, Double)] +createEdges (typeName, constructors) = + [ (typeName, constr, weight) | constr <- constructors, let weight = 1.0 ] + +-- Insert an edge into the graph map +insertEdge :: Map.Map String (Map.Map String Double) -> (String, String, Double) -> Map.Map String (Map.Map String Double) +insertEdge graphMap (source, target, weight) = + let + sourceMap = Map.findWithDefault Map.empty source graphMap + updatedSourceMap = Map.insert target weight sourceMap + in + Map.insert source updatedSourceMap graphMap + +-- Normalize edge weights to sum up to 1.0 for each node +normalizeWeights :: Map.Map String (Map.Map String Double) -> Map.Map String (Map.Map String Double) +normalizeWeights graphMap = + let + normalizeNode (node, edgeMap) = + let + totalWeight = sum $ Map.elems edgeMap + normalizedEdgeMap = Map.map (/ totalWeight) edgeMap + in + (node, normalizedEdgeMap) + in + Map.map normalizeNode graphMap + +-- Apply the PageRank algorithm to calculate eigenvector centr diff --git a/2023/07/03/.ghc/aarch64-android-9.2.5/environments/default b/2023/07/03/.ghc/aarch64-android-9.2.5/environments/default new file mode 100644 index 00000000..e0bc4b86 --- /dev/null +++ b/2023/07/03/.ghc/aarch64-android-9.2.5/environments/default @@ -0,0 +1,28 @@ +clear-package-db +global-package-db +package-db /data/data/com.termux/files/home/.cabal/store/ghc-9.2.5/package.db +package-id ghc-9.2.5 +package-id bytestring-0.11.3.1 +package-id unix-2.7.2.2 +package-id base-4.16.4.0 +package-id time-1.11.1.1 +package-id hpc-0.6.1.0 +package-id filepath-1.4.2.2 +package-id process-1.6.16.0 +package-id array-0.5.4.0 +package-id integer-gmp-1.1 +package-id containers-0.6.5.1 +package-id ghc-boot-9.2.5 +package-id binary-0.8.9.0 +package-id ghc-prim-0.8.0 +package-id ghci-9.2.5 +package-id rts +package-id terminfo-0.4.1.5 +package-id transformers-0.5.6.2 +package-id deepseq-1.4.6.1 +package-id ghc-boot-th-9.2.5 +package-id pretty-1.1.3.6 +package-id template-haskell-2.18.0.0 +package-id directory-1.3.6.2 +package-id text-1.2.5.0 +package-id safe-0.3.19-f8c175a4e90e3ed2388f579154686556ee891ecd30940c67066bfddb03c50dab diff --git a/2023/07/03/.ghc/ghci_history b/2023/07/03/.ghc/ghci_history new file mode 100644 index 00000000..05e61268 --- /dev/null +++ b/2023/07/03/.ghc/ghci_history @@ -0,0 +1,100 @@ +:quit +:exit +:exit + return (map (\ns -> (head ns, length ns)) (group (sort names))) |] + names = getNames decType + getNamesFromPat _ = [] + getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2 + getNamesFromPat (ConP name _ pats) = name : concatMap getNamesFromPat pats + getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats + getNamesFromPat (VarP name) = [name] + getNames _ = [] + getNames (ValD pat _ _) = getNamesFromPat pat + let getNames (FunD name _) = [name] +ghci> putStrLn . show =<< runQ [d| decType <- reify (mkName "Dec") +main = putStrLn . show =<< runQ (do decType <- reify (mkName "Dec"); let getNames (FunD name _) = [name]; getNames (ValD pat _ _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP name _ pats) = name : concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = []; let names = getNames decType in return (map (\ns -> (head ns, length ns)) (group (sort names)))) +import Language.Haskell.TH.Syntax (Q, runQ, reify, mkName, Dec) +import Data.List (group, sort) +main = putStrLn . show =<< runQ (do decType <- reify (mkName "Dec"); let getNames (FunD name _) = [name]; getNames (ValD pat _ _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP name _ pats) = name : concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = []; let names = getNames decType in return (map (\ns -> (head ns, length ns)) $ group $ sort names)) +import Language.Haskell.TH.Syntax (Q, runQ, reify, mkName, Dec) +import Data.List (group, sort) +main = putStrLn . show =<< runQ (do decType <- reify (mkName "Dec"); let getNames (FunD name _) = [name]; getNames (ValD pat _ _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP name _ pats) = name : concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = []; let names = getNames decType in return (map (\ns -> (head ns, length ns)) $ group $ sort names)) +import Language.Haskell.TH.Syntax (Q, runQ, reify, mkName, Dec) +import Data.List (group, sort) +main = putStrLn . show =<< runQ (do decType <- reify (mkName "Dec"); let getNames (FunD name _) = [name]; getNames (ValD pat _ _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP name _ pats) = name : concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = []; let names = getNames decType in return $ map (\ns -> (head ns, length ns)) $ group $ sort names) +import Language.Haskell.TH.Syntax (Q, runQ, reify, mkName, Dec) +import Data.List (group, sort) +main = putStrLn . show =<< runQ (do decType <- reify (mkName "Dec"); let getNames (FunD name _) = [name]; getNames (ValD pat _ _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP name _ pats) = name : concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = []; let names = getNames decType in return $ map (\ns -> (head ns, length ns)) $ group $ sort names +main = putStrLn . show =<< runQ (do decType <- reify (mkName "Dec"); let getNames (FunD name _) = [name]; getNames (ValD pat _ _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP name _ pats) = name : concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = []; let names = getNames decType in return $ map (\ns -> (head ns, length ns)) $ group $ sort names)) +main = putStrLn . show =<< runQ (do decType <- reify (mkName "Dec"); let getNames (FunD name _) = [name]; getNames (ValD pat _ _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP name _ pats) = name : concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = []; let names = getNames decType in return $ map (\ns -> (head ns, length ns)) $ group $ sort names) +main = putStrLn . show =<< runQ (do decType <- reify (mkName "Dec"); let getNames (FunD name _) = [name]; getNames (ValD pat _ _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP name _ pats) = name : concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = []; let names = getNames decType in return $ map (\ns -> (head ns, length ns)) $ group $ sort names +main = putStrLn . show =<< runQ (do decType <- reify (mkName "Dec"); let getNames (FunD name _) = [name]; getNames (ValD pat _ _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP name _ pats) = name : concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = []; let names = getNames decType in return $ map (\ns -> (head ns, length ns)) $ group $ sort names) +main = putStrLn . show =<< runQ (do decType <- reify (mkName "Dec"); let getNames (FunD name _) = [name]; getNames (ValD pat _ _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP name _ pats) = name : concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = []; let names = getNames decType in return $ map (\ns -> (head ns, length ns)) $ group $ sort names) +import Language.Haskell.TH.Syntax (Q, runQ, reify, mkName, Dec) +import Data.List (group, sort) + return $ map (\ns -> (head ns, length ns)) $ group $ sort names + names = getNames decType + getNamesFromPat _ = [] + getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2 + getNamesFromPat (ConP name _ pats) = name : concatMap getNamesFromPat pats + getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats + getNamesFromPat (VarP name) = [name] + getNames _ = [] + getNames (ValD pat _ _) = getNamesFromPat pat + let getNames (FunD name _) = [name] + decType <- reify (mkName "Dec") +show $ runQ $ do +import Language.Haskell.TH.Syntax (Q, runQ, reify, mkName, Dec) +import Data.List (group, sort) +show $ runQ $ mapM putStrLn $ map (\(name, count) -> show name ++ ": " ++ show count) $ (\decType -> let getNames (FunD name _) = [name]; getNames (ValD pat _ _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP name _ pats) = name : concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = [] in let names = getNames decType in map (\ns -> (head ns, length ns)) $ group $ sort names) =<< (runQ (reify (mkName "Dec"))) +import Language.Haskell.TH.Syntax (Q, runQ, reify, mkName) +import Data.List (group, sort) +show $ mapM putStrLn $ map (\(name, count) -> show name ++ ": " ++ show count) $ (\decType -> let getNames (FunD name _) = [name]; getNames (ValD pat _ _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP name _ pats) = name : concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = [] in let names = getNames decType in map (\ns -> (head ns, length ns)) $ group $ sort names) =<< (reify (mkName "Dec")) +show $ void $ mapM putStrLn $ map (\(name, count) -> show name ++ ": " ++ show count) $ (\decType -> let getNames (FunD name _) = [name]; getNames (ValD pat _ _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP name _ pats) = name : concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = [] in let names = getNames decType in map (\ns -> (head ns, length ns)) $ group $ sort names) =<< (reify (mkName "Dec")) +import Data.List (group, sort) +show $ mapM putStrLn $ map (\(name, count) -> show name ++ ": " ++ show count) $ (\decType -> let getNames (FunD name _) = [name]; getNames (ValD pat _ _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP _ _ pats) = concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = [] in let names = getNames decType in map (\ns -> (head ns, length ns)) $ group $ sort names) =<< (reify (mkName "Dec")) +show $ void $ mapM putStrLn $ map (\(name, count) -> show name ++ ": " ++ show count) $ (\decType -> let getNames (FunD name _) = [name]; getNames (ValD pat _ _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP _ _ pats) = concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = [] in let names = getNames decType in map (\ns -> (head ns, length ns)) $ group $ sort names) =<< (reify (mkName "Dec")) +show $ void $ mapM putStrLn $ map (\(name, count) -> show name ++ ": " ++ show count) $ (\decType -> let getNames (FunD name _) = [name]; getNames (ValD pat _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP _ _ pats) = concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = [] in let names = getNames decType in map (\ns -> (head ns, length ns)) $ group $ sort names) =<< (reify (mkName "Dec")) +show $ void $ mapM putStrLn $ map (\(name, count) -> show name ++ ": " ++ show count) $ (\decType -> let getNames (FunD name _) = [name]; getNames (ValD pat _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP _ pats) = concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = [] in let names = getNames decType in map (\ns -> (head ns, length ns)) $ group $ sort names) =<< (reify (mkName "Dec")) +import Data.List (group, sort) +show $ void $ mapM putStrLn $ map (\(name, count) -> show name ++ ": " ++ show count) $ (\decType -> let getNames (FunD name _) = [name]; getNames (ValD pat _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP _ pats) = concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = [] in let names = getNames decType in map (\ns -> (head ns, length ns)) $ group $ sort names) =<< (reify (mkName "Dec")) +show $ void $ mapM putStrLn $ map (\(name, count) -> show name ++ ": " ++ show count) $ (\decType -> let getNames (FunD name _) = [name]; getNames (ValD pat _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP _ pats) = concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = [] in let names = getNames decType in map (\ns -> (head ns, length ns)) $ group $ sort names) =<< (reify (mkName "Dec")) +show $ void $ mapM putStrLn $ map (\(name, count) -> show name ++ ": " ++ show count) $ (\decType -> let getNames (FunD name _) = [name]; getNames (ValD pat _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP _ pats) = concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = [] in let names = getNames decType in map (\ns -> (head ns, length ns)) $ group $ sort names) =<< reify (mkName "Dec") +show $ void $ mapM putStrLn $ map (\(name, count) -> show name ++ ": " ++ show count) $ (\decType -> let names = getNames decType in map (\ns -> (head ns, length ns)) $ group $ sort names) =<< reify (mkName "Dec") where { getNames (FunD name _) = [name]; getNames (ValD pat _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP _ pats) = concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = [] } +show $ void $ mapM putStrLn $ map (\(name, count) -> show name ++ ": " ++ show count) $ (\decType -> let names = getNames decType in map (\ns -> (head ns, length ns)) $ group $ sort names) =<< reify (mkName "Dec") where { getNames (FunD name _) = [name]; getNames (ValD pat _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP _ pats) = concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = [] } +show $ void $ mapM putStrLn $ map (\(name, count) -> show name ++ ": " ++ show count) $ (\decType -> let names = getNames decType in map (\ns -> (head ns, length ns)) $ group $ sort names) =<< reify (mkName "Dec"); where { getNames (FunD name _) = [name]; getNames (ValD pat _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP _ pats) = concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = [] } +show $ void $ mapM putStrLn $ map (\(name, count) -> show name ++ ": " ++ show count) $ (\decType -> let names = getNames decType in map (\ns -> (head ns, length ns)) $ group $ sort names) =<< reify (mkName "Dec"); where { getNames (FunD name _) = [name]; getNames (ValD pat _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP _ pats) = concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = [] } +show $ void $ mapM putStrLn $ map (\(name, count) -> show name ++ ": " ++ show count) $ (\decType -> let names = getNames decType in map (\ns -> (head ns, length ns)) $ group $ sort names) =<< reify (mkName "Dec"); where { getNames (FunD name _) = [name]; getNames (ValD pat _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP _ pats) = concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = [] } +show $ void $ mapM putStrLn $ map (\(name, count) -> show name ++ ": " ++ show count) $ (\str -> let decType = read str :: Dec in map (\ns -> (head ns, length ns)) $ group $ sort $ getNames decType) "data Language.Haskell.TH.Syntax.Dec\n = Language.Haskell.TH.Syntax.FunD Language.Haskell.TH.Syntax.Name\n ([Language.Haskell.TH.Syntax.Clause])\n | Language.Haskell.TH.Syntax.ValD Language.Haskell.TH.Syntax.Pat Language.Haskell.TH.Syntax.Body"; where { getNames (FunD name _) = [name]; getNames (ValD pat _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP _ pats) = concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = [] } +show $ void $ mapM putStrLn $ map (\(name, count) -> show name ++ ": " ++ show count) $ (\str -> let decType = read str :: Dec in map (\ns -> (head ns, length ns)) $ group $ sort $ getNames decType) "data Language.Haskell.TH.Syntax.Dec\n = Language.Haskell.TH.Syntax.FunD Language.Haskell.TH.Syntax.Name\n ([Language.Haskell.TH.Syntax.Clause])\n | Language.Haskell.TH.Syntax.ValD Language.Haskell.TH.Syntax.Pat Language.Haskell.TH.Syntax.Body"; where { getNames (FunD name _) = [name]; getNames (ValD pat _) = getNamesFromPat pat; getNames _ = []; getNamesFromPat (VarP name) = [name]; getNamesFromPat (TupP pats) = concatMap getNamesFromPat pats; getNamesFromPat (ConP _ pats) = concatMap getNamesFromPat pats; getNamesFromPat (InfixP pat1 _ pat2) = getNamesFromPat pat1 ++ getNamesFromPat pat2; getNamesFromPat _ = [] } +putStrLn $ $(stringE . pprint =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> putStrLn LitE (stringE (nameBase nm))) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> putStrLn LitE (stringE (nameBase nm))) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn LitE (stringE (nameBase nm)) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn LitE (stringE (nameBase nm)) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $(litE (stringE (nameBase nm))) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $(litE (stringE (nameBase nm)))) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $(litE (StringL (stringE (nameBase nm)))) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $(litE (StringL $(stringE (nameBase nm)))) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $(litE (StringL $(stringE (nameBase nm)))) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $(litE (StringL $(stringE (nameBase nm)))) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $(litE (StringL $(stringE (nameBase nm)))) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $(litE (StringL $(stringE (nameBase nm)))) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $(litE (StringL $(stringE (nameBase nm)))) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $ $(parseExp =<< LitE (StringL "$(nameBase nm)")) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $ $(parseExp =<< LitE (StringL "$(nameBase nm)")) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $ $(parseExp =<< LitE (StringL "$(nameBase nm)")) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $ $(parseExp =<< stringE (LitE (StringL "$(nameBase nm)"))) |]) =<< reify (mkName "Dec")) +parseExp=LitE +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $ $(parseExp =<< stringE (LitE (StringL "$(nameBase nm)"))) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $ $(parseExp =<< stringE (LitE (StringL "$(nameBase nm)"))) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $ $(parseExp =<< stringE (LitE (StringL "$(nameBase nm)"))) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $ $(stringE (LitE (StringL "$(nameBase nm)")))|]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $ $(stringE (LitE (StringL "$(nameBase nm)")))|]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $(stringE (LitE (StringL (nameBase nm)))) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $(stringE (LitE (StringL (nameBase nm)))) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| putStrLn $(stringE (LitE (StringL (nameBase nm)))) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| pprint $(stringE (LitE (StringL (nameBase nm)))) |]) =<< reify (mkName "Dec")) +putStrLn $ $(stringE . pprint =<< (\(VarI nm _ _) -> [| pprint $(stringE (LitE (StringL (nameBase nm)))) |]) =<< reify (mkName "Dec")) diff --git a/2023/07/03/Foo.dyn_hi b/2023/07/03/Foo.dyn_hi new file mode 100644 index 00000000..7a1d7465 Binary files /dev/null and b/2023/07/03/Foo.dyn_hi differ diff --git a/2023/07/03/Foo.dyn_o b/2023/07/03/Foo.dyn_o new file mode 100644 index 00000000..33c5a78e Binary files /dev/null and b/2023/07/03/Foo.dyn_o differ diff --git a/2023/07/03/Foo.hi b/2023/07/03/Foo.hi new file mode 100644 index 00000000..099c3222 Binary files /dev/null and b/2023/07/03/Foo.hi differ diff --git a/2023/07/03/Foo.hs b/2023/07/03/Foo.hs new file mode 100644 index 00000000..7361e766 --- /dev/null +++ b/2023/07/03/Foo.hs @@ -0,0 +1,37 @@ +module Foo where + +{-# LANGUAGE TemplateHaskell #-} + +import Language.Haskell.TH +{-# LANGUAGE TemplateHaskell #-} + +import Language.Haskell.TH +import Language.Haskell.TH.Syntax + +getObjectNames :: Q Info -> Q Exp +getObjectNames q = do + names <- q >>= getNames + listE $ map (litE . stringL) names + +getNames :: Info -> Q [String] +getNames (VarI name _ _) = return [nameBase name] +getNames (ClassOpI name _ _) = return [nameBase name] +getNames (DataConI name _ _ ) = return [nameBase name] +getNames (TyConI (DataD _ _ _ _ constructors _)) = do + constructorNames <- mapM extractConstructorNames constructors + return $ concat constructorNames +getNames (TyConI (NewtypeD _ _ _ _ constructor _)) = do + constructorNames <- extractConstructorNames constructor + return constructorNames +getNames _ = throwError "Invalid declaration" + +extractConstructorNames :: Con -> Q [String] +extractConstructorNames (NormalC name _) = return [nameBase name] +extractConstructorNames (RecC name _) = return [nameBase name] +extractConstructorNames (InfixC _ name _) = return [nameBase name] +extractConstructorNames _ = throwError "Invalid constructor" + +throwError :: String -> Q a +throwError err = fail $ "Error: " ++ err + +foo = getObjectNames diff --git a/2023/07/03/Foo.o b/2023/07/03/Foo.o new file mode 100644 index 00000000..ecb5328a Binary files /dev/null and b/2023/07/03/Foo.o differ diff --git a/2023/07/03/foo.hs b/2023/07/03/foo.hs new file mode 100644 index 00000000..2d16d13f --- /dev/null +++ b/2023/07/03/foo.hs @@ -0,0 +1,2 @@ +module Foo where +foo = 1 diff --git a/2023/07/03/test1 b/2023/07/03/test1 new file mode 100755 index 00000000..68728aea Binary files /dev/null and b/2023/07/03/test1 differ diff --git a/2023/07/03/test1.dyn_hi b/2023/07/03/test1.dyn_hi new file mode 100644 index 00000000..c410abd2 Binary files /dev/null and b/2023/07/03/test1.dyn_hi differ diff --git a/2023/07/03/test1.dyn_o b/2023/07/03/test1.dyn_o new file mode 100644 index 00000000..11df6aef Binary files /dev/null and b/2023/07/03/test1.dyn_o differ diff --git a/2023/07/03/test1.hi b/2023/07/03/test1.hi new file mode 100644 index 00000000..3a4a180c Binary files /dev/null and b/2023/07/03/test1.hi differ diff --git a/2023/07/03/test1.hs b/2023/07/03/test1.hs new file mode 100644 index 00000000..c1016cef --- /dev/null +++ b/2023/07/03/test1.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE TemplateHaskell #-} + +import Language.Haskell.TH + +-- extractFunctionNames :: [Dec] -> [Name] +-- extractFunctionNames decs = [name | FunD name _ <- decs] +import Foo + +main :: IO () + + + + +main = do + putStrLn $(stringE . show =<< (Foo.foo (reify ''Dec)) ) diff --git a/2023/07/03/test1.o b/2023/07/03/test1.o new file mode 100644 index 00000000..11f8940d Binary files /dev/null and b/2023/07/03/test1.o differ diff --git a/2023/07/17/experiments/transformers b/2023/07/17/experiments/transformers index 40d5e056..b71f20a7 160000 --- a/2023/07/17/experiments/transformers +++ b/2023/07/17/experiments/transformers @@ -1 +1 @@ -Subproject commit 40d5e056712f175ee72ecc57d1c96d6b87d0b9fc +Subproject commit b71f20a7c9f3716d30f6738501559acf863e2c5c diff --git a/2023/09/22/petals b/2023/09/22/petals index 1d9401dd..6499c0d0 160000 --- a/2023/09/22/petals +++ b/2023/09/22/petals @@ -1 +1 @@ -Subproject commit 1d9401ddceca53fd2a3d21e48c656242c65c6692 +Subproject commit 6499c0d0a7ccc148f436913a66bf6808cab8b78c diff --git a/2024/03/18/notes.org b/2024/03/18/notes.org new file mode 100644 index 00000000..bb4f939e --- /dev/null +++ b/2024/03/18/notes.org @@ -0,0 +1,148 @@ +select * from builddependencies; + source | target +--------+-------- + 4986 | 30033 + 4986 | 30034 + + public | buildproducts | table | cuirass + C-c C-ccuirass=# select *from buildproducts; + id | build | type | file_size | checksum | path +----+-------+------+-----------+----------+------ +(0 rows) + + +cuirass=# select *from builds; +WARNING: terminal is not fully functional +Press RETURN to continue + + id + derivation + evaluation + job_name + system + +cuirass=# select system,count(*) from builds group by system order by count(*) desc; + system | count +--------------+------- + x86_64-linux | 30350 + i686-linux | 13 +(2 rows) + + worker + nix_name + log + status + last_status + weather + priority + max_silent + timeout + timestamp + starttime + stoptime + + + +cuirass=# cuirass=# select worker,count(*)from builds group by worker order by count(*) desc; +WARNING: terminal is not fully functional +Press RETURN to continue + +cuirass=# cuirass=# select worker,status,count(*)from builds group by status,worker order by count(*) desc; +WARNING: terminal is not fully functional +Press RETURN to continue + + worker | status | count +----------+--------+------- + | 2 | 20163 + wpQJLU1t | 1 | 1252 + kHgPTQjm | 1 | 1216 + pXEdbaHC | 1 | 906 + IQYI1JPH | 1 | 779 + ncIse0c9 | 1 | 690 + Z9lEdWCs | 1 | 650 + | 0 | 595 + kHgPTQjm | 0 | 535 + wpQJLU1t | 0 | 532 +: + IQYI1JPH | 0 | 471 + sicNfQYL | 0 | 437 + rWznRr2G | 1 | 415 + pXEdbaHC | 0 | 391 + rWznRr2G | 0 | 333 + Z9lEdWCs | 0 | 317 + sicNfQYL | 1 | 312 + ncIse0c9 | 0 | 242 + | -2 | 13 + HGb3NqJW | 0 | 10 + QlGh6La9 | 1 | 10 + LX6DbQlW | 1 | 10 + w08ubS6n | 0 | 9 +: + uGMkDPSk | 0 | 9 + DphbiBAq | 0 | 8 + cokfGwsE | 1 | 7 + HGb3NqJW | 1 | 7 + QlGh6La9 | 0 | 6 + xPt9T60y | 1 | 6 + xPt9T60y | 0 | 6 + LX6DbQlW | 0 | 6 + | 1 | 5 + cokfGwsE | 0 | 4 + uGMkDPSk | 1 | 4 + DphbiBAq | 1 | 4 + w08ubS6n | 1 | 3 +: +(36 rows) + +cuirass=# select status,count(*) from builds group by status order by count(*) desc; + status | count +--------+------- + 2 | 20163 + 1 | 6276 + 0 | 3911 + -2 | 13 +(4 rows) + + worker | count +----------+------- + | 20776 + wpQJLU1t | 1784 + kHgPTQjm | 1751 + pXEdbaHC | 1297 + IQYI1JPH | 1250 + Z9lEdWCs | 967 + ncIse0c9 | 932 + sicNfQYL | 749 + rWznRr2G | 748 + HGb3NqJW | 17 +: + QlGh6La9 | 16 +: + LX6DbQlW | 16 +: + uGMkDPSk | 13 +: + w08ubS6n | 12 +: + DphbiBAq | 12 +: + xPt9T60y | 12 +: + cokfGwsE | 11 +: +(17 rows) +: + +public | builds | table | cuirass + public | checkouts | table | cuirass + public | dashboards | table | cuirass + public | evaluations | table | cuirass + public | jobs | table | cuirass + public | metrics | table | cuirass + public | notifications | table | cuirass +: + public | outputs | table | cuirass + public | schemaversion | table | cuirass + public | specifications | table | cuirass + public | workers | table | cuirass +(13 rows) diff --git a/2024/03/26/notes.org b/2024/03/26/notes.org index 4d1c47bc..47e7f080 100644 --- a/2024/03/26/notes.org +++ b/2024/03/26/notes.org @@ -56,43 +56,7 @@ efficient, cost-effective, and environmentally friendly solution to synthesizing new materials while opening up endless possibilities for scientific exploration and innovation. -* spectral decomposition as a metaphor for feature selection and sorting - -Let's explore the captivating analogy between spectral decomposition -and the process of feature selection and sorting. In this imaginative -interpretation, consider spectral decomposition as a librarian in a -vast library, sorting and organizing books based on their essential -themes and characteristics. - -The "library" represents the data matrix X, filled with an extensive -collection of observations or features. The "books" symbolize -individual data points or variables within this matrix. Our goal is to -identify the most relevant and informative features that contribute -significantly to the underlying patterns in our data, much like a -skilled librarian categorizes books by genre, author, or subject. - -Spectral decomposition serves as an efficient and powerful tool for -this task. By decomposing the data matrix X into its singular value -decomposition (SVD), we can identify the principal components that -capture most of the variance in our data. These principal components -correspond to the "essential themes" or dominant features in our data. - -Furthermore, we can interpret each singular value as a measure of the -importance or contribution of a given feature to the overall structure -of our data. By sorting these values in descending order, we can -prioritize and select the most significant features for further -analysis – those with the highest singular values. This process is -akin to arranging books in a library by their popularity or relevance. - -In summary, spectral decomposition offers an elegant metaphor for -understanding and approaching feature selection and sorting as the -librarian's task of categorizing and prioritizing "books" within the -vast "library" of data. This creative interpretation not only -highlights the significance of this important technique but also -encourages further exploration of its potential applications in data -analysis and machine learning. - -* analyisis +* analysis Those last three are generated by mistral. @@ -144,8 +108,9 @@ Donc, T1(S1,L1) = Zxp lxq zxbj zwxjx L1 ex npzrqx T1 kzbj pvwj rzlph S1 x T1(S1, Of course! Here's a new language L1 along with a translation key T1 to convert an English statement S1 to L1: +#+begin_src example **L1** - +* another attempt * inventi - invent * savu - your * lingvo - language @@ -159,6 +124,7 @@ Of course! Here's a new language L1 along with a translation key T1 to convert a * chi - this * deklaro - statement * S1 - S1 +#+end_src **T1(S1,L1)** diff --git a/2024/03/26/pick-up-nix b/2024/03/26/pick-up-nix index 610385ad..5d079a53 160000 --- a/2024/03/26/pick-up-nix +++ b/2024/03/26/pick-up-nix @@ -1 +1 @@ -Subproject commit 610385ad47ca4fedc735773be01e1aa7860f3873 +Subproject commit 5d079a53d6db2121f451819a1e63b2b9b7018b4c diff --git a/2024/03/27/hivemind b/2024/03/27/hivemind new file mode 160000 index 00000000..c295cfb7 --- /dev/null +++ b/2024/03/27/hivemind @@ -0,0 +1 @@ +Subproject commit c295cfb7f5b29721c7ed198dcf2b5861950a54b7 diff --git a/2024/03/27/notes.org b/2024/03/27/notes.org new file mode 100644 index 00000000..07839960 --- /dev/null +++ b/2024/03/27/notes.org @@ -0,0 +1,34 @@ + + 1728 cd guix-cuirass/ + 1733 sudo chown -R cuirass: /etc/guix/* + 1736 guix pull + 1772 cd guix-cuirass + 1831 guix search nrpe + 1876 guix install python-pytorch + 1888 guix shell -D + 1988 guix install grpc_tools + 1989 guix install grpc + 1990 guix shell + guix shell -D protobuf grpc python-pytorch + +imagine converting bash command into scm file + +I ran: +~/2024/03/27/hivemind/hivemind/proto/generate.sh + +python -m grpc_tools.protoc --proto_path=. --python_out=. auth.proto averaging.proto crypto.proto dht.proto p2pd.proto runtime.proto test.proto + + +Installing collected packages: speedtest-cli, sentencepiece, mpmath, cpufeature, bitsandbytes, urllib3, typing-extensions, tqdm, sympy, six, safetensors, regex, pyyaml, psutil, packaging, nvidia-nvtx-cu12, nvidia-nvjitlink-cu12, nvidia-nccl-cu12, nvidia-curand-cu12, nvidia-cufft-cu12, nvidia-cuda-runtime-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-cupti-cu12, nvidia-cublas-cu12, numpy, networkx, MarkupSafe, idna, humanfriendly, fsspec, filelock, charset-normalizer, certifi, async-timeout, triton, requests, pydantic, nvidia-cusparse-cu12, nvidia-cudnn-cu12, jinja2, Dijkstar, nvidia-cusolver-cu12, huggingface-hub, torch, tokenizers, transformers, accelerate, tensor-parallel, peft, petals + +python -m petals.cli.run_server --port 31330 petals-team/StableBeluga2 + + + + +pip install torch~=2.2.0 torch_xla[tpu]~=2.2.0 -f https://storage.googleapis.com/libtpu-releases/index.html + + +python -m petals.cli.run_server --port 31330 petals-team/StableBeluga2 --device xla --num_blocks=10 + +PJRT_DEVICE=TPU python -m petals.cli.run_server --port 31330 petals-team/StableBeluga2 --device xla --num_blocks=10 diff --git a/2024/03/27/peft b/2024/03/27/peft new file mode 160000 index 00000000..2665f80a --- /dev/null +++ b/2024/03/27/peft @@ -0,0 +1 @@ +Subproject commit 2665f80a1738b315dce42da8f1a9c7fe793aa9ca diff --git a/2024/03/27/petals b/2024/03/27/petals new file mode 120000 index 00000000..534e7d08 --- /dev/null +++ b/2024/03/27/petals @@ -0,0 +1 @@ +/mnt/data1/nix/time/experiments/petals \ No newline at end of file diff --git a/2024/03/27/petals-api b/2024/03/27/petals-api new file mode 160000 index 00000000..fed32379 --- /dev/null +++ b/2024/03/27/petals-api @@ -0,0 +1 @@ +Subproject commit fed323798f005c81892242c982485587c32cd8ce diff --git a/2024/03/27/swarm b/2024/03/27/swarm new file mode 160000 index 00000000..f66855f7 --- /dev/null +++ b/2024/03/27/swarm @@ -0,0 +1 @@ +Subproject commit f66855f7266338b0cbad345e12e84c1229c03047 diff --git a/experiments/--help b/experiments/--help deleted file mode 120000 index e58134c2..00000000 --- a/experiments/--help +++ /dev/null @@ -1 +0,0 @@ -../2024/02/09/--help \ No newline at end of file diff --git a/experiments/BinFPE b/experiments/BinFPE deleted file mode 120000 index f51fe048..00000000 --- a/experiments/BinFPE +++ /dev/null @@ -1 +0,0 @@ -../2023/11/03/BinFPE \ No newline at end of file diff --git a/experiments/CUDA-Data-Race-Detector b/experiments/CUDA-Data-Race-Detector deleted file mode 120000 index c9d34d73..00000000 --- a/experiments/CUDA-Data-Race-Detector +++ /dev/null @@ -1 +0,0 @@ -../2023/11/03/CUDA-Data-Race-Detector \ No newline at end of file diff --git a/experiments/Catch2 b/experiments/Catch2 deleted file mode 120000 index 5cb805a9..00000000 --- a/experiments/Catch2 +++ /dev/null @@ -1 +0,0 @@ -../2023/11/03/DCGM/vendor/Catch2 \ No newline at end of file diff --git a/experiments/CuAssembler b/experiments/CuAssembler deleted file mode 120000 index 04e33230..00000000 --- a/experiments/CuAssembler +++ /dev/null @@ -1 +0,0 @@ -../2023/11/03/CuAssembler \ No newline at end of file diff --git a/experiments/DCGM b/experiments/DCGM deleted file mode 120000 index ef494f91..00000000 --- a/experiments/DCGM +++ /dev/null @@ -1 +0,0 @@ -../2023/11/03/DCGM \ No newline at end of file diff --git a/experiments/KDDockWidgets b/experiments/KDDockWidgets deleted file mode 120000 index f41ef2d0..00000000 --- a/experiments/KDDockWidgets +++ /dev/null @@ -1 +0,0 @@ -../2023/07/17/experiments/perf/hotspot/dep/KDDockWidgets \ No newline at end of file diff --git a/experiments/MasonBoomPersonalAssistant b/experiments/MasonBoomPersonalAssistant deleted file mode 120000 index 6b21235c..00000000 --- a/experiments/MasonBoomPersonalAssistant +++ /dev/null @@ -1 +0,0 @@ -../2023/09/24/ai-ticket/vendor/MasonBoomPersonalAssistant \ No newline at end of file diff --git a/experiments/NVBit b/experiments/NVBit deleted file mode 120000 index 2c79817f..00000000 --- a/experiments/NVBit +++ /dev/null @@ -1 +0,0 @@ -../2023/11/03/NVBit \ No newline at end of file diff --git a/experiments/NVBitFI-by-Time b/experiments/NVBitFI-by-Time deleted file mode 120000 index f60f4124..00000000 --- a/experiments/NVBitFI-by-Time +++ /dev/null @@ -1 +0,0 @@ -../2023/11/03/NVBitFI-by-Time \ No newline at end of file diff --git a/experiments/PPT b/experiments/PPT deleted file mode 120000 index 9672349e..00000000 --- a/experiments/PPT +++ /dev/null @@ -1 +0,0 @@ -../2023/11/03/TensorRT/PPT \ No newline at end of file diff --git a/experiments/PolyGPT b/experiments/PolyGPT deleted file mode 120000 index 590c5097..00000000 --- a/experiments/PolyGPT +++ /dev/null @@ -1 +0,0 @@ -../2023/09/24/ai-ticket/vendor/PolyGPT \ No newline at end of file diff --git a/experiments/TensorRT b/experiments/TensorRT deleted file mode 120000 index 60e86e97..00000000 --- a/experiments/TensorRT +++ /dev/null @@ -1 +0,0 @@ -../2023/11/03/TensorRT \ No newline at end of file diff --git a/experiments/accel-sim-framework b/experiments/accel-sim-framework deleted file mode 120000 index 75a8ff68..00000000 --- a/experiments/accel-sim-framework +++ /dev/null @@ -1 +0,0 @@ -../2023/11/03/accel-sim-framework \ No newline at end of file diff --git a/experiments/af_assets-src b/experiments/af_assets-src deleted file mode 120000 index 49301655..00000000 --- a/experiments/af_assets-src +++ /dev/null @@ -1 +0,0 @@ -../2023/12/04/arrayfire/build/extern/af_assets-src \ No newline at end of file diff --git a/experiments/af_forge-src b/experiments/af_forge-src deleted file mode 120000 index a7cd1bb7..00000000 --- a/experiments/af_forge-src +++ /dev/null @@ -1 +0,0 @@ -../2023/12/04/arrayfire/build/extern/af_forge-src \ No newline at end of file diff --git a/experiments/af_glad-src b/experiments/af_glad-src deleted file mode 120000 index f70674cc..00000000 --- a/experiments/af_glad-src +++ /dev/null @@ -1 +0,0 @@ -../2023/12/04/arrayfire/build/extern/af_glad-src \ No newline at end of file diff --git a/experiments/af_test_data-src b/experiments/af_test_data-src deleted file mode 120000 index 218f45ad..00000000 --- a/experiments/af_test_data-src +++ /dev/null @@ -1 +0,0 @@ -../2023/12/04/arrayfire/build/extern/af_test_data-src \ No newline at end of file diff --git a/experiments/af_threads-src b/experiments/af_threads-src deleted file mode 120000 index a7f04a5e..00000000 --- a/experiments/af_threads-src +++ /dev/null @@ -1 +0,0 @@ -../2023/12/04/arrayfire/build/extern/af_threads-src \ No newline at end of file diff --git a/experiments/alec-is-not-coq-lsp b/experiments/alec-is-not-coq-lsp deleted file mode 120000 index a3f74632..00000000 --- a/experiments/alec-is-not-coq-lsp +++ /dev/null @@ -1 +0,0 @@ -../2023/12/11/alec-is-not-coq-lsp/temp/alec-is-not-coq-lsp \ No newline at end of file diff --git a/experiments/ast2json b/experiments/ast2json deleted file mode 120000 index eaf2696f..00000000 --- a/experiments/ast2json +++ /dev/null @@ -1 +0,0 @@ -../2023/07/17/introspector/input/ast2json \ No newline at end of file diff --git a/experiments/aws-cli b/experiments/aws-cli deleted file mode 120000 index 16862c0f..00000000 --- a/experiments/aws-cli +++ /dev/null @@ -1 +0,0 @@ -../2023/04/29/local-llm/alpaca.cpp/inputs/aws-cli \ No newline at end of file diff --git a/experiments/babyagi b/experiments/babyagi deleted file mode 120000 index 059619e0..00000000 --- a/experiments/babyagi +++ /dev/null @@ -1 +0,0 @@ -../2023/09/24/ai-ticket/vendor/babyagi \ No newline at end of file diff --git a/experiments/backwardcpp-src b/experiments/backwardcpp-src deleted file mode 120000 index f374ea43..00000000 --- a/experiments/backwardcpp-src +++ /dev/null @@ -1 +0,0 @@ -../2023/12/07/meta-call-core/build/_deps/backwardcpp-src \ No newline at end of file diff --git a/experiments/bindings_zoo b/experiments/bindings_zoo deleted file mode 120000 index 9992dbb0..00000000 --- a/experiments/bindings_zoo +++ /dev/null @@ -1 +0,0 @@ -../2023/09/24/ai-ticket/vendor/lollms/zoos/bindings_zoo \ No newline at end of file diff --git a/experiments/bloomz b/experiments/bloomz deleted file mode 120000 index 2301cb65..00000000 --- a/experiments/bloomz +++ /dev/null @@ -1 +0,0 @@ -../2023/09/16/LocalAI/bloomz \ No newline at end of file diff --git a/experiments/boto3 b/experiments/boto3 deleted file mode 120000 index e2e31feb..00000000 --- a/experiments/boto3 +++ /dev/null @@ -1 +0,0 @@ -../2023/04/29/local-llm/alpaca.cpp/inputs/boto3 \ No newline at end of file diff --git a/experiments/botocore b/experiments/botocore deleted file mode 120000 index 821d2404..00000000 --- a/experiments/botocore +++ /dev/null @@ -1 +0,0 @@ -../2023/04/29/local-llm/alpaca.cpp/inputs/botocore \ No newline at end of file diff --git a/experiments/botostubs b/experiments/botostubs deleted file mode 120000 index aaffd82e..00000000 --- a/experiments/botostubs +++ /dev/null @@ -1 +0,0 @@ -../2023/04/29/local-llm/alpaca.cpp/inputs/botostubs \ No newline at end of file diff --git a/experiments/cccl b/experiments/cccl deleted file mode 120000 index 58905354..00000000 --- a/experiments/cccl +++ /dev/null @@ -1 +0,0 @@ -../2023/11/03/cccl \ No newline at end of file diff --git a/experiments/database b/experiments/database deleted file mode 120000 index ef0b9ad2..00000000 --- a/experiments/database +++ /dev/null @@ -1 +0,0 @@ -../2023/07/17/experiments/blazegraph-database/database \ No newline at end of file diff --git a/experiments/dcgm-exporter b/experiments/dcgm-exporter deleted file mode 120000 index 358ae1cd..00000000 --- a/experiments/dcgm-exporter +++ /dev/null @@ -1 +0,0 @@ -../2023/11/03/dcgm-exporter \ No newline at end of file diff --git a/experiments/ekg-json-22461580dac5d569 b/experiments/ekg-json-22461580dac5d569 deleted file mode 120000 index df7f9b2c..00000000 --- a/experiments/ekg-json-22461580dac5d569 +++ /dev/null @@ -1 +0,0 @@ -../2023/07/15/haskell-language-server/dist-newstyle/src/ekg-json-22461580dac5d569 \ No newline at end of file diff --git a/experiments/envparse-c6092a80e101d449 b/experiments/envparse-c6092a80e101d449 deleted file mode 120000 index 7a2c0697..00000000 --- a/experiments/envparse-c6092a80e101d449 +++ /dev/null @@ -1 +0,0 @@ -../2023/07/16/flora-server/dist-newstyle/src/envparse-c6092a80e101d449 \ No newline at end of file diff --git a/experiments/extensions_zoo_path b/experiments/extensions_zoo_path deleted file mode 120000 index 4fa3ee74..00000000 --- a/experiments/extensions_zoo_path +++ /dev/null @@ -1 +0,0 @@ -../2023/08/02/ggml-data/extensions_zoo_path \ No newline at end of file diff --git a/experiments/fmt b/experiments/fmt deleted file mode 120000 index d0b7e776..00000000 --- a/experiments/fmt +++ /dev/null @@ -1 +0,0 @@ -../2023/11/03/DCGM/vendor/fmt \ No newline at end of file diff --git a/experiments/foundation-7095e3dda3594362 b/experiments/foundation-7095e3dda3594362 deleted file mode 120000 index 2176f584..00000000 --- a/experiments/foundation-7095e3dda3594362 +++ /dev/null @@ -1 +0,0 @@ -../2023/07/16/wai/dist-newstyle/src/foundation-7095e3dda3594362 \ No newline at end of file diff --git a/experiments/funchook b/experiments/funchook deleted file mode 120000 index 8176b930..00000000 --- a/experiments/funchook +++ /dev/null @@ -1 +0,0 @@ -../2023/12/07/meta-call-core/build/source/detours/funchook_detour/funchook/src/funchook \ No newline at end of file diff --git a/experiments/go-ggllm b/experiments/go-ggllm deleted file mode 120000 index c39ab0c3..00000000 --- a/experiments/go-ggllm +++ /dev/null @@ -1 +0,0 @@ -../2023/09/16/LocalAI/go-ggllm \ No newline at end of file diff --git a/experiments/go-ggml-transformers b/experiments/go-ggml-transformers deleted file mode 120000 index 31e55833..00000000 --- a/experiments/go-ggml-transformers +++ /dev/null @@ -1 +0,0 @@ -../2023/09/16/LocalAI/go-ggml-transformers \ No newline at end of file diff --git a/experiments/go-rwkv b/experiments/go-rwkv deleted file mode 120000 index 69ce328c..00000000 --- a/experiments/go-rwkv +++ /dev/null @@ -1 +0,0 @@ -../2023/09/16/LocalAI/go-rwkv \ No newline at end of file diff --git a/experiments/go-stable-diffusion b/experiments/go-stable-diffusion deleted file mode 120000 index b6f3603a..00000000 --- a/experiments/go-stable-diffusion +++ /dev/null @@ -1 +0,0 @@ -../2023/09/16/LocalAI/go-stable-diffusion \ No newline at end of file diff --git a/experiments/gptneox-chat b/experiments/gptneox-chat deleted file mode 120000 index 1741d2b5..00000000 --- a/experiments/gptneox-chat +++ /dev/null @@ -1 +0,0 @@ -../2024/02/14/gptneox-chat \ No newline at end of file diff --git a/experiments/gpu-monitoring-tools b/experiments/gpu-monitoring-tools deleted file mode 120000 index 4218a8e4..00000000 --- a/experiments/gpu-monitoring-tools +++ /dev/null @@ -1 +0,0 @@ -../2023/11/03/gpu-monitoring-tools \ No newline at end of file diff --git a/experiments/gpu-operator b/experiments/gpu-operator deleted file mode 120000 index 1154e13b..00000000 --- a/experiments/gpu-operator +++ /dev/null @@ -1 +0,0 @@ -../2023/11/03/gpu-operator \ No newline at end of file