Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- debug :: Bool
- debugTrace :: String -> a -> a
- type VarList = [String]
- i2t :: LocTag -> Int -> Cofree (ParserTermF l v) LocTag
- ints2t :: LocTag -> [Int] -> Cofree (ParserTermF l v) LocTag
- s2t :: LocTag -> String -> Cofree (ParserTermF l v) LocTag
- findInts :: LocTag -> Pattern -> [AnnotatedUPT -> AnnotatedUPT]
- findStrings :: LocTag -> Pattern -> [AnnotatedUPT -> AnnotatedUPT]
- fitPatternVarsToCasedUPT :: Pattern -> AnnotatedUPT -> AnnotatedUPT
- varsUPT :: UnprocessedParsedTerm -> Set String
- mkLambda4FreeVarUPs :: AnnotatedUPT -> AnnotatedUPT
- findPatternVars :: LocTag -> Pattern -> Map String (AnnotatedUPT -> AnnotatedUPT)
- pairStructureCheck :: Pattern -> UnprocessedParsedTerm -> UnprocessedParsedTerm
- pairRoute2Dirs :: Pattern -> [UnprocessedParsedTerm -> UnprocessedParsedTerm]
- pattern2UPT :: LocTag -> Pattern -> AnnotatedUPT
- mkCaseAlternative :: AnnotatedUPT -> AnnotatedUPT -> Pattern -> AnnotatedUPT
- case2annidatedIfs :: AnnotatedUPT -> [Pattern] -> [AnnotatedUPT] -> [AnnotatedUPT] -> [AnnotatedUPT] -> [AnnotatedUPT] -> [AnnotatedUPT] -> AnnotatedUPT
- removeCaseUPs :: AnnotatedUPT -> AnnotatedUPT
- debruijinize :: MonadFail m => VarList -> Term1 -> m Term2
- rewriteOuterTag :: anno -> Cofree a anno -> Cofree a anno
- splitExpr' :: Term2 -> BreakState' RecursionPieceFrag UnsizedRecursionToken
- newtype FragExprUR' = FragExprUR' {}
- newtype Term3' = Term3' (Map FragIndex FragExprUR')
- splitExpr :: Term2 -> Term3
- makeLambda :: [(String, AnnotatedUPT)] -> String -> Term1 -> Term1
- validateVariables :: [(String, AnnotatedUPT)] -> AnnotatedUPT -> Either String Term1
- varsTerm1 :: Term1 -> Set String
- optimizeBuiltinFunctions :: AnnotatedUPT -> AnnotatedUPT
- generateAllHashes :: Term2 -> Term2
- addBuiltins :: AnnotatedUPT -> AnnotatedUPT
- process :: [(String, AnnotatedUPT)] -> AnnotatedUPT -> Either String Term3
- process2Term2 :: [(String, AnnotatedUPT)] -> AnnotatedUPT -> Either String Term2
- runTelomareParser2Term2 :: TelomareParser AnnotatedUPT -> [(String, AnnotatedUPT)] -> String -> Either String Term2
- parseMain :: [(String, AnnotatedUPT)] -> String -> Either String Term3
Documentation
debugTrace :: String -> a -> a Source #
findInts :: LocTag -> Pattern -> [AnnotatedUPT -> AnnotatedUPT] Source #
Finds all PatternInt leaves returning "directions" to these leaves through pairs in the form of a combination of RightUP and LeftUP from the root e.g. PatternPair (PatternVar "x") (PatternPair (PatternInt 0) (PatternVar "y")) will return [LeftUP . RightUP]
findStrings :: LocTag -> Pattern -> [AnnotatedUPT -> AnnotatedUPT] Source #
Finds all PatternString leaves returning "directions" to these leaves through pairs in the form of a combination of RightUP and LeftUP from the root e.g. PatternPair (PatternVar "x") (PatternPair (PatternString "Hello, world!") (PatternVar "y")) will return [LeftUP . RightUP]
varsUPT :: UnprocessedParsedTerm -> Set String Source #
Collect all free variable names in a AnnotatedUPT
expresion
findPatternVars :: LocTag -> Pattern -> Map String (AnnotatedUPT -> AnnotatedUPT) Source #
pattern2UPT :: LocTag -> Pattern -> AnnotatedUPT Source #
:: AnnotatedUPT | UPT to be cased |
-> AnnotatedUPT | Case result to be made lambda and applied |
-> Pattern | Pattern |
-> AnnotatedUPT | case result as a lambda applied to the appropirate part of the UPT to be cased |
:: AnnotatedUPT | Term to be pattern matched |
-> [Pattern] | All patterns in a case expression |
-> [AnnotatedUPT] | Int leaves as ListUPs on UPT |
-> [AnnotatedUPT] | Int leaves as ListUPs on pattern |
-> [AnnotatedUPT] | String leaves as ListUPs on UPT |
-> [AnnotatedUPT] | String leaves as ListUPs on pattern |
-> [AnnotatedUPT] | Case's alternatives |
-> AnnotatedUPT |
rewriteOuterTag :: anno -> Cofree a anno -> Cofree a anno Source #
newtype FragExprUR' Source #
Instances
Show FragExprUR' Source # | |
Defined in Telomare.Resolver | |
Eq FragExprUR' Source # | |
Defined in Telomare.Resolver (==) :: FragExprUR' -> FragExprUR' -> Bool Source # (/=) :: FragExprUR' -> FragExprUR' -> Bool Source # |
Instances
:: [(String, AnnotatedUPT)] | Bindings |
-> String | Variable name |
-> Term1 | Lambda body |
-> Term1 |
:: [(String, AnnotatedUPT)] | Prelude |
-> AnnotatedUPT | |
-> Either String Term1 |
Transformation from AnnotatedUPT
to Term1
validating and inlining VarUP
s
generateAllHashes :: Term2 -> Term2 Source #
:: [(String, AnnotatedUPT)] | Prelude |
-> AnnotatedUPT | |
-> Either String Term3 |
Process an AnnotatedUPT
to a Term3
with failing capability.
:: [(String, AnnotatedUPT)] | Prelude |
-> AnnotatedUPT | |
-> Either String Term2 |
runTelomareParser2Term2 Source #
:: TelomareParser AnnotatedUPT | Parser to run |
-> [(String, AnnotatedUPT)] | Prelude |
-> String | Raw string to be parsed |
-> Either String Term2 | Error on Left |
Helper function to compile to Term2