Strongly-typed AST types for Haskell, auto-generated from
tree-sitter-haskell's node-types.json.
This crate is generated by treesitter-types and is
automatically kept up to date when a new version of the grammar crate is released.
These types have been tested by parsing the Cabal source code.
See the Tree-sitter project for more information about the underlying parser framework.
Example
use *;
// A minimal Haskell hello-world program.
let src = b"\
module Main where
main :: IO ()
main = putStrLn \"Hello, World!\"
";
// Parse the source with tree-sitter and convert into typed AST.
let mut parser = new;
parser.set_language.unwrap;
let tree = parser.parse.unwrap;
let haskell = from_node.unwrap;
// The module has a header (`module Main where`), no imports, and declarations.
assert!; // the module header
assert!; // no import statements
assert!;
// The declarations section contains the type signature and the binding.
let decls = haskell.declarations.as_ref.unwrap;
assert!;