All Projects → ltext → Ltext

ltext / Ltext

Licence: other
λtext - higher-order file applicator

Programming Languages

haskell
3896 projects

Projects that are alternatives of or similar to Ltext

salt
The compilation target that functional programmers always wanted.
Stars: ✭ 62 (+67.57%)
Mutual labels:  lambda-calculus
Write You A Haskell
Building a modern functional compiler from first principles. (http://dev.stephendiehl.com/fun/)
Stars: ✭ 3,064 (+8181.08%)
Mutual labels:  lambda-calculus
Hol
Canonical sources for HOL4 theorem-proving system. Branch `develop` is where “mainline development” occurs; when `develop` passes our regression tests, `master` is merged forward to catch up.
Stars: ✭ 414 (+1018.92%)
Mutual labels:  lambda-calculus
lambda-fibonacci
Implementation of the Fibonacci sequence in JS using pure Lambda Calculus
Stars: ✭ 18 (-51.35%)
Mutual labels:  lambda-calculus
types-and-programming-languages
Exercises from Benjamin Pierce's "Types and Programming Languages" textbook + extras!
Stars: ✭ 92 (+148.65%)
Mutual labels:  lambda-calculus
Lambda
🔮 Estudos obscuros de programação funcional
Stars: ✭ 297 (+702.7%)
Mutual labels:  lambda-calculus
LambdaCalculusPlayground
An Android app that provides a visual interface for creating and evaluating lambda calculus expressions
Stars: ✭ 16 (-56.76%)
Mutual labels:  lambda-calculus
Dblib Linear
Formalisation of the linear lambda calculus in Coq
Stars: ✭ 10 (-72.97%)
Mutual labels:  lambda-calculus
lplzoo
Fine-grain implementations of common lambda calculi in Haskell, tested with QuickCheck
Stars: ✭ 32 (-13.51%)
Mutual labels:  lambda-calculus
Plam
An interpreter for learning and exploring pure λ-calculus
Stars: ✭ 385 (+940.54%)
Mutual labels:  lambda-calculus
lunarflow
Lambda calculus go brrrr
Stars: ✭ 27 (-27.03%)
Mutual labels:  lambda-calculus
ATS-blockchain
⛓️ Blockchain + Smart contracts from scratch
Stars: ✭ 18 (-51.35%)
Mutual labels:  lambda-calculus
Lambda Talk
A Flock of Functions: Combinators, Lambda Calculus, & Church Encodings in JS
Stars: ✭ 315 (+751.35%)
Mutual labels:  lambda-calculus
Krivine-Machine
Abstract krivine machine implementing call-by-name semantics. In OCaml.
Stars: ✭ 34 (-8.11%)
Mutual labels:  lambda-calculus
Fp Core.rs
A library for functional programming in Rust
Stars: ✭ 772 (+1986.49%)
Mutual labels:  lambda-calculus
lambda
lambda calculus interpreter
Stars: ✭ 23 (-37.84%)
Mutual labels:  lambda-calculus
Cedille
Cedille, a dependently typed programming languages based on the Calculus of Dependent Lambda Eliminations
Stars: ✭ 289 (+681.08%)
Mutual labels:  lambda-calculus
Zion
A statically-typed strictly-evaluated garbage-collected readable programming language.
Stars: ✭ 33 (-10.81%)
Mutual labels:  lambda-calculus
Aws Lambda Workshop
Some incremental examples suitable to host an AWS Lambda Functions workshop
Stars: ✭ 18 (-51.35%)
Mutual labels:  lambda-calculus
Magic In Ten Mins
十分钟魔法练习
Stars: ✭ 327 (+783.78%)
Mutual labels:  lambda-calculus

ltext

λtext

General-Purpose Templating Utility

Overview

λtext turns text files into higher-order functions, featuring a Hindley-Milner / prenex polymorphic type system. See the github.io page.

Building

$> git clone [email protected]/ltext/ltext
$> cd ltext
$> stack install ltext

This should install in one pass; all the non-stackage dependencies are included in stack.yaml.

Usage

$> ltext --help

λtext - parameterized file evaluator

Usage: ltext EXPRESSION [--version] [-t|--type] [-v|--verbose] [-r|--raw FILE]
             [--left LEFT] [--right RIGHT]
  Evaluate EXPRESSION and send the substitution to stdout. See
  http://ltext.github.io/ for more details.

Available options:
  -h,--help                Show this help text
  --version                Print the version number
  -t,--type                Perform type inference on an expression
  -v,--verbose             Be verbose, sending info through stderr
  -r,--raw FILE            Treat these files as plaintext without an arity
                           header
  --left LEFT              The left delimiter to use for rendering partially
                           applied files
  --right RIGHT            The right delimiter to use for rendering partially
                           applied files

$> ltext --type "\a -> a"

a0 -> a0

How It Works

From λtext's point of view, any text file can be a template (given that it's utf-8 encoded). Just declare parameters in the first line of your files (usually in a different syntax than the file's native tongue, via comments or obscure delimiters), then use those variables somewhere in the content. With the ltext command you can then apply the function-y files to each other.

The CLI

There will be two primary uses of the ltext command - evaluating template expressions, and querying for the type signature of a template/expression.

Type Queries

Just like the :t command in GHCi, you can find out the type of a template or expression with -t.

Expression Evaluation

All files have closed scope, meaning they only have access to the variables declared in the file. For instance:

{{ foo }}

...

Will only have access to the variable foo, while using the delimiters {{ and }} to escape your expression.

Variable Recognition

When we use a parameter in a file, we need it to be easily recognized by a parser; a different syntax than to the language you're working with.

The first line in a file will be parsed to see if it qualifies as a lambda header. If you don't want a file have recognized arity, just invoke ltext with the --raw argument listing the file:

$> ltext "foo bar" --raw "bar"

Credits

All credits go to Martin Grabmueller's AlgorithmW package for the type inference algorithm used in λtext.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].