Type Checking

To inspect the type of a file or an expression, just use the -t option during invocation:

$ ltext --type "foo" foo :: Text -> Text

You can read this as "foo takes in Text and returns Text", or "foo is a function from Text to Text". This is useful if you are getting type matching errors, or want to get a description of a file. We can also check the type signature of expressions directly:

$ ltext --type "\x -> x" a0 -> a0

This is a little technical, but we are creating a polymorphic function \x -> x , which has a type from for all a0 to a0 (you may see these cryptic type variables instead of Text from time to time). This would happen if, for instance, you made an "apply"-like template:

%% f x %% asdf %% f x %%

If you check the type of apply , you can see it's...

$ ltext --type "apply" (a1 -> Text) -> a1 -> Text