{"_id":"tree-sitter-haskell","_rev":"9-3341d21bf666d90625265506aa97ba02","name":"tree-sitter-haskell","dist-tags":{"latest":"0.23.1"},"versions":{"0.11.0":{"name":"tree-sitter-haskell","version":"0.11.0","keywords":["parser","haskell"],"author":{"name":"Rick Winfrey"},"license":"MIT","_id":"tree-sitter-haskell@0.11.0","maintainers":[{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"}],"dist":{"shasum":"6b69c3677adc4ba7907b45b1e5457fe33c785d19","tarball":"https://registry.npmjs.org/tree-sitter-haskell/-/tree-sitter-haskell-0.11.0.tgz","fileCount":11,"integrity":"sha512-tKmUcOZE0Nm5lkzCdkVS8rgH9931+vqD9yS+owlbpnTq7/+SfteF1vLlDo74oHq8ee2BOf/u7fEixJAJRPxWMQ==","signatures":[{"sig":"MEUCIG60O3mqGWMaQDWorgG33IYgD7TdtBBF4YQPzQ//baEDAiEA9rTgS2m62ZkkQ7AXhd0fQKWMUygCHA2QcwxnkzQUIjM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8269314},"main":"index.js","watch":{"test":{"quiet":true,"patterns":["corpus"],"extensions":"txt"},"build-grammar":{"quiet":true,"patterns":["./"],"extensions":"js"},"build-scanner":{"quiet":true,"patterns":["src"],"extensions":"cc"}},"gitHead":"b006431052964165a3bd0cafbba48a6998ef0ed5","gypfile":true,"scripts":{"test":"tree-sitter test","build":"tree-sitter generate && node-gyp build","install":"node-gyp rebuild","watch-test":"npm-watch test","build-grammar":"tree-sitter generate && node-gyp build --debug && tree-sitter test","build-scanner":"node-gyp build --debug && tree-sitter test","watch-grammar":"npm-watch build-grammar","watch-scanner":"npm-watch build-scanner"},"_npmUser":{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},"_npmVersion":"5.6.0","description":"Haskell grammar for tree-sitter","directories":{},"_nodeVersion":"9.8.0","dependencies":{"nan":"^2.4.0"},"_hasShrinkwrap":false,"devDependencies":{"tree-sitter-cli":"^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/tree-sitter-haskell_0.11.0_1522269344641_0.904861669022363","host":"s3://npm-registry-packages"}},"0.13.0":{"name":"tree-sitter-haskell","version":"0.13.0","keywords":["parser","haskell"],"author":{"name":"Rick Winfrey"},"license":"MIT","_id":"tree-sitter-haskell@0.13.0","maintainers":[{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},{"name":"rewinfrey","email":"rick.winfrey@gmail.com"}],"dist":{"shasum":"22dbc61a92e674a7df9700decbb941e4cdfe6419","tarball":"https://registry.npmjs.org/tree-sitter-haskell/-/tree-sitter-haskell-0.13.0.tgz","fileCount":11,"integrity":"sha512-aJFmPSjsrcpunGy38hswwBgNHVNf+d8iK0NwiEM9fmhajI3cHxd15Q9FmSrHwhpdcZI5rb8WqTNo9FstmCA15w==","signatures":[{"sig":"MEUCIDREZ0SEVEZVmE6QEAlECJ7TSB4sWewCVPsCdiOx+culAiEA3bYsL6PrFuy2qzQQUTl9MwGvIVGDh4wIBx7vWx6fJm4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":20073798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbT5LbCRA9TVsSAnZWagAADhQP/0q2Uf3QlmxNiluyPiD9\nP2IgNbsKlyC17JaHHC0H+a+yhdZajg7BcKp7sGWT3XqEE/XS+nEnPAWlShx5\nqvdjMLtyjubJMGCiw9hJ6TkdQyYBDv6yKlXQEQ9Nz5En9ekpUCuWqC+aIMpq\n8pjeyeZ1IXxvrzucCUeEAfQguWp4gVG+7c+YGc7FphXHlzWoiVCToqxK0x2E\nzyHVvGEiA8kac6+mfLWVR8DYLycSsnl4iQdrrM3ZoQAY2yF6qMtZOoOESriF\nXMI9/VAGPSFonYOVbhqbPCXUEY6VFlw9pASCsoADib6cMJCxgjX7Kn65o8SM\nSUTfO9y8Ql+SHNDyyDXiXjoAbdLJjDLpP4En//z/VKYt2NM+DfgLoUZB3YoC\nV/Od+ZM3AUcVKd71aN+L6PFgketNkdhFXM1yiBieTZd5jXaIB+KIf94jOmo7\njlKl8kvv7tzsDye5Q9BV9/wcFj+CMdJhrBM2gzn09XyVQVa31EKazBbWOGuE\ndWV7l3vJbQRzWLBWx30dq86Qawzh1wK26ponm244bmn1bX3lFUJ40Wi4t+PJ\nuVMxtI7eeNpgHQ61kheTjg7NnANtOg9AtGqOLP5W1hxHWYJqqGLFh78oTLQM\nQPVT5PGhny1uCiD+GQm+BRtobxJKErpTIkgqc5bfIVfKSffKJ2LZ8GEIhDHH\nOT2l\r\n=CcC9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","watch":{"test":{"quiet":true,"patterns":["corpus"],"extensions":"txt"},"build-grammar":{"quiet":true,"patterns":["./"],"extensions":"js"},"build-scanner":{"quiet":true,"patterns":["src"],"extensions":"cc"}},"gitHead":"7e9144492e5233195155ded67b7e63c6c3122ae6","gypfile":true,"scripts":{"test":"tree-sitter test && script/parse-examples","build":"tree-sitter generate && node-gyp build","install":"node-gyp rebuild","watch-test":"npm-watch test","build-grammar":"tree-sitter generate && node-gyp build --debug && tree-sitter test","build-scanner":"node-gyp build --debug && tree-sitter test","watch-grammar":"npm-watch build-grammar","watch-scanner":"npm-watch build-scanner"},"_npmUser":{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},"_npmVersion":"6.2.0","description":"Haskell grammar for tree-sitter","directories":{},"_nodeVersion":"8.4.0","dependencies":{"nan":"^2.4.0"},"_hasShrinkwrap":false,"devDependencies":{"tree-sitter-cli":"^0.13.1"},"_npmOperationalInternal":{"tmp":"tmp/tree-sitter-haskell_0.13.0_1531941595176_0.5821691214374225","host":"s3://npm-registry-packages"}},"0.15.0":{"name":"tree-sitter-haskell","version":"0.15.0","keywords":["parser","haskell"],"author":{"name":"Torsten Schmits"},"license":"MIT","_id":"tree-sitter-haskell@0.15.0","maintainers":[{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},{"name":"queerviolet","email":"npm@ashi.io"},{"name":"rewinfrey","email":"rick.winfrey@gmail.com"}],"contributors":[{"name":"Rick Winfrey"},{"name":"Max Brunsfeld"},{"name":"Torsten Schmits"},{"name":"Owen Shepherd"}],"homepage":"https://github.com/tree-sitter/tree-sitter-haskell#readme","bugs":{"url":"https://github.com/tree-sitter/tree-sitter-haskell/issues"},"dist":{"shasum":"f57e067c617f4d632f70b53bf5630dc80191828d","tarball":"https://registry.npmjs.org/tree-sitter-haskell/-/tree-sitter-haskell-0.15.0.tgz","fileCount":47,"integrity":"sha512-qaFtv5cCmbpN4c+nFyKFnm4r0EQo2IAhvo+TMPyR4yXn4JQxu/HOjKx6KeV/pZCl9nCHiMCYu63yM8chSinlyg==","signatures":[{"sig":"MEYCIQCVF9Kt5FIuD9iF/zbcKEpnnVTz35wV43sosTK+x9FQ6AIhALr8esNld17szbkFWyGx9iuk5ttNA4+CVqVi1z+fuNbY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":29109595},"main":"bindings/node","gitHead":"c6b51ca9eeff099557a88d8c1ef19147968c1b48","gypfile":true,"scripts":{"test":"tree-sitter test","install":"node-gyp rebuild","examples":"script/parse-examples","examples-wasm":"script/parse-examples wasm"},"_npmUser":{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},"repository":{"url":"git+https://github.com/tree-sitter/tree-sitter-haskell.git","type":"git"},"_npmVersion":"10.2.4","description":"Haskell grammar for tree-sitter","directories":{},"tree-sitter":[{"scope":"source.haskell","file-types":["hs"],"highlights":["queries/highlights.scm"],"injection-regex":"^(hs|haskell)$"}],"_nodeVersion":"18.19.1","dependencies":{"nan":"^2.12.1","node-gyp":">=7 <11"},"_hasShrinkwrap":false,"devDependencies":{"tree-sitter-cli":"^0.20.6","web-tree-sitter":"^0.20.6"},"_npmOperationalInternal":{"tmp":"tmp/tree-sitter-haskell_0.15.0_1708951612188_0.2139259170856982","host":"s3://npm-registry-packages"}},"0.21.0":{"name":"tree-sitter-haskell","version":"0.21.0","keywords":["incremental","parsing","tree-sitter","haskell"],"author":{"name":"Rick Winfrey"},"license":"MIT","_id":"tree-sitter-haskell@0.21.0","maintainers":[{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},{"name":"queerviolet","email":"npm@ashi.io"},{"name":"rewinfrey","email":"rick.winfrey@gmail.com"}],"contributors":[{"name":"Max Brunsfeld"},{"name":"Owen Shepherd"}],"homepage":"https://github.com/tree-sitter/tree-sitter-haskell#readme","bugs":{"url":"https://github.com/tree-sitter/tree-sitter-haskell/issues"},"dist":{"shasum":"5cafca9d5cef8133ee668313c7c9a0226948e4f6","tarball":"https://registry.npmjs.org/tree-sitter-haskell/-/tree-sitter-haskell-0.21.0.tgz","fileCount":43,"integrity":"sha512-b2RLegPHuYPh7nJ3YKWgkWnFYxmYlQDE8TDJuNH+iuNuBcCMYyaA9JlJlMHfCvf7DmJNPtqqbO9Kh9NXEmbatQ==","signatures":[{"sig":"MEUCIAiQmJGrk0wKNJgiP7e/RiQpCQDHWmOAw6e/zB/EsN40AiEAgnm94+XhYozyprDZawxc4XU5UJ8ta1FgmzU5i/OugYw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":36230513},"main":"bindings/node","types":"bindings/node","gitHead":"4bbd8e6246f8ec4cdc05fb45f486edba2713b94d","scripts":{"test":"tree-sitter test","build":"tree-sitter generate --no-bindings","parse":"tree-sitter parse","install":"node-gyp-build","build-wasm":"tree-sitter build --wasm","prebuildify":"prebuildify --napi --strip"},"_npmUser":{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},"repository":{"url":"git+https://github.com/tree-sitter/tree-sitter-haskell.git","type":"git"},"_npmVersion":"10.5.0","description":"Haskell grammar for tree-sitter","directories":{},"tree-sitter":[{"scope":"source.haskell","file-types":["hs","hs-boot"],"highlights":"queries/highlights.scm","injection-regex":"^(hs|haskell)$"}],"_nodeVersion":"20.12.2","dependencies":{"node-addon-api":"8.0.0","node-gyp-build":"^4.8.1"},"_hasShrinkwrap":false,"devDependencies":{"prebuildify":"^6.0.1","tree-sitter-cli":"^0.22.5"},"peerDependencies":{"tree-sitter":"^0.21.0"},"peerDependenciesMeta":{"tree_sitter":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/tree-sitter-haskell_0.21.0_1714893789025_0.30398803353289194","host":"s3://npm-registry-packages"}},"0.23.0":{"name":"tree-sitter-haskell","version":"0.23.0","keywords":["incremental","parsing","tree-sitter","haskell"],"author":{"name":"Rick Winfrey"},"license":"MIT","_id":"tree-sitter-haskell@0.23.0","maintainers":[{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},{"name":"queerviolet","email":"npm@ashi.io"},{"name":"rewinfrey","email":"rick.winfrey@gmail.com"}],"contributors":[{"name":"Max Brunsfeld"},{"name":"Owen Shepherd"},{"name":"Torsten Schmits"}],"homepage":"https://github.com/tree-sitter/tree-sitter-haskell#readme","bugs":{"url":"https://github.com/tree-sitter/tree-sitter-haskell/issues"},"dist":{"shasum":"0bddb78a2345722796535e6cde9fed76fb539271","tarball":"https://registry.npmjs.org/tree-sitter-haskell/-/tree-sitter-haskell-0.23.0.tgz","fileCount":44,"integrity":"sha512-KccJaK4wIjB1r12i9yKwYiRVoc7WDzskq0JEkvfD+2n6YzgdbiJO52pHK9nZMGrX0ah5Xr2o7aynzuP7f9etnw==","signatures":[{"sig":"MEUCIQD3TI+daPcKTETi4IuKqKW9ra0C8vs1Qg8BsffOVuCAaAIgWM7n3O1HvOMC3nPIphItCPx9E/3rmklk1Xy62RKC4Es=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":36208743},"main":"bindings/node","types":"bindings/node","gitHead":"558b997049fddcb07fc513528189c57d6129a260","scripts":{"test":"node --test bindings/node/*_test.js","start":"tree-sitter playground","install":"node-gyp-build","prestart":"tree-sitter build --wasm"},"_npmUser":{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},"repository":{"url":"git+https://github.com/tree-sitter/tree-sitter-haskell.git","type":"git"},"_npmVersion":"10.8.2","description":"Haskell grammar for tree-sitter","directories":{},"tree-sitter":[{"scope":"source.haskell","file-types":["hs","hs-boot"],"highlights":"queries/highlights.scm","injection-regex":"^(hs|haskell)$"}],"_nodeVersion":"20.17.0","dependencies":{"node-addon-api":"8.1.0","node-gyp-build":"^4.8.2"},"_hasShrinkwrap":false,"devDependencies":{"prebuildify":"^6.0.1","tree-sitter-cli":"^0.23.0"},"peerDependencies":{"tree-sitter":"^0.21.0"},"peerDependenciesMeta":{"tree-sitter":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/tree-sitter-haskell_0.23.0_1725271310552_0.6085421682599925","host":"s3://npm-registry-packages"}},"0.23.1":{"name":"tree-sitter-haskell","version":"0.23.1","description":"Haskell grammar for tree-sitter","repository":{"type":"git","url":"git+https://github.com/tree-sitter/tree-sitter-haskell.git"},"license":"MIT","author":{"name":"Rick Winfrey"},"contributors":[{"name":"Max Brunsfeld","email":"maxbrunsfeld@gmail.com"},{"name":"Owen Shepherd"},{"name":"Torsten Schmits"}],"main":"bindings/node","types":"bindings/node","keywords":["incremental","parsing","tree-sitter","haskell"],"dependencies":{"node-addon-api":"^8.2.2","node-gyp-build":"^4.8.2"},"devDependencies":{"prebuildify":"^6.0.1","tree-sitter-cli":"^0.24.4"},"peerDependencies":{"tree-sitter":"^0.21.1"},"peerDependenciesMeta":{"tree-sitter":{"optional":true}},"scripts":{"install":"node-gyp-build","prestart":"tree-sitter build --wasm","start":"tree-sitter playground","test":"node --test bindings/node/*_test.js"},"_id":"tree-sitter-haskell@0.23.1","gitHead":"c30d812bc90827f1a54106a25bc9a6307f5cdcec","bugs":{"url":"https://github.com/tree-sitter/tree-sitter-haskell/issues"},"homepage":"https://github.com/tree-sitter/tree-sitter-haskell#readme","_nodeVersion":"20.18.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-qG4CYhejveu9DLMLEGBz/n9/TTeGSFLC6wniwOgG6m8/v7Dng8qR0ob0EVG7+XH+9WiOxohpGA23EhceWuxY4w==","shasum":"ccf0fc6f2f55c193745947fe429a9681d1d618bb","tarball":"https://registry.npmjs.org/tree-sitter-haskell/-/tree-sitter-haskell-0.23.1.tgz","fileCount":48,"unpackedSize":47870862,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2QoVL//QBX5y67mekQN9hz8mQjRB+6u71Ny5eAsgrPAIhALDXoqApThFxTyRrJG/09eMGMNvMREtKIXLxqIwlcgtG"}]},"_npmUser":{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},"directories":{},"maintainers":[{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},{"name":"queerviolet","email":"npm@ashi.io"},{"name":"rewinfrey","email":"rick.winfrey@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tree-sitter-haskell_0.23.1_1731262392673_0.20242424617322285"},"_hasShrinkwrap":false}},"time":{"created":"2018-03-28T20:35:44.640Z","modified":"2024-11-10T18:13:13.183Z","0.11.0":"2018-03-28T20:35:44.863Z","0.13.0":"2018-07-18T19:19:55.284Z","0.15.0":"2024-02-26T12:46:52.422Z","0.21.0":"2024-05-05T07:23:09.264Z","0.23.0":"2024-09-02T10:01:50.744Z","0.23.1":"2024-11-10T18:13:12.999Z"},"bugs":{"url":"https://github.com/tree-sitter/tree-sitter-haskell/issues"},"author":{"name":"Rick Winfrey"},"license":"MIT","homepage":"https://github.com/tree-sitter/tree-sitter-haskell#readme","keywords":["incremental","parsing","tree-sitter","haskell"],"repository":{"type":"git","url":"git+https://github.com/tree-sitter/tree-sitter-haskell.git"},"description":"Haskell grammar for tree-sitter","contributors":[{"name":"Max Brunsfeld","email":"maxbrunsfeld@gmail.com"},{"name":"Owen Shepherd"},{"name":"Torsten Schmits"}],"maintainers":[{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},{"name":"queerviolet","email":"npm@ashi.io"},{"name":"rewinfrey","email":"rick.winfrey@gmail.com"}],"readme":"# tree-sitter-haskell\n\n[![CI][ci]](https://github.com/tree-sitter/tree-sitter-haskell/actions/workflows/ci.yml)\n[![discord][discord]](https://discord.gg/w7nTvsVJhm)\n[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)\n[![crates][crates]](https://crates.io/crates/tree-sitter-haskell)\n[![npm][npm]](https://www.npmjs.com/package/tree-sitter-haskell)\n[![pypi][pypi]](https://pypi.org/project/tree-sitter-haskell)\n\nHaskell grammar for [tree-sitter].\n\n# References\n\n- [Haskell 2010 Language Report – Syntax References][ref]\n- [GHC Language Extensions][ext]\n\n# Supported Language Extensions\n\nThese extensions are supported ✅, unsupported ❌ or not applicable because they don't involve parsing ➖️:\n\n- AllowAmbiguousTypes ➖️\n- ApplicativeDo ➖️\n- Arrows ❌\n- BangPatterns ✅\n- BinaryLiterals ✅\n- BlockArguments ✅\n- CApiFFI ✅\n- ConstrainedClassMethods ✅\n- ConstraintKinds ✅\n- CPP ✅\n- CUSKs ✅\n- DataKinds ✅\n- DatatypeContexts ✅\n- DefaultSignatures ✅\n- DeriveAnyClass ➖️\n- DeriveDataTypeable ➖️\n- DeriveFoldable ➖️\n- DeriveFunctor ➖️\n- DeriveGeneric ➖️\n- DeriveLift ➖️\n- DeriveTraversable ➖️\n- DerivingStrategies ✅\n- DerivingVia ✅\n- DisambiguateRecordFields ➖️\n- DuplicateRecordFields ➖️\n- EmptyCase ✅\n- EmptyDataDecls ✅\n- EmptyDataDeriving ✅\n- ExistentialQuantification ✅\n- ExplicitForAll ✅\n- ExplicitNamespaces ✅\n- ExtendedDefaultRules ➖️\n- FlexibleContexts ✅\n- FlexibleInstances ✅\n- ForeignFunctionInterface ✅\n- FunctionalDependencies ✅\n- GADTs ✅\n- GADTSyntax ✅\n- GeneralisedNewtypeDeriving ➖️\n- GHCForeignImportPrim ✅\n- Haskell2010 ➖️\n- Haskell98 ➖️\n- HexFloatLiterals ✅\n- ImplicitParams ✅\n- ImplicitPrelude ➖️\n- ImportQualifiedPost ✅\n- ImpredicativeTypes ➖️\n- IncoherentInstances ➖️\n- InstanceSigs ✅\n- InterruptibleFFI ✅\n- KindSignatures ✅\n- LambdaCase ✅\n- LexicalNegation ❌\n- LiberalTypeSynonyms ✅\n- LinearTypes ✅\n- ListTuplePuns ✅\n- MagicHash ✅\n- Modifiers ❌\n- MonadComprehensions ➖️\n- MonadFailDesugaring ➖️\n- MonoLocalBinds ➖️\n- MonomorphismRestriction ➖️\n- MultiParamTypeClasses ✅\n- MultiWayIf ✅\n- NamedFieldPuns ✅\n- NamedWildCards ✅\n- NegativeLiterals ➖️\n- NondecreasingIndentation ✅\n- NPlusKPatterns ➖️\n- NullaryTypeClasses ✅\n- NumDecimals ➖️\n- NumericUnderscores ✅\n- OverlappingInstances ➖️\n- OverloadedLabels ✅\n- OverloadedLists ➖️\n- OverloadedRecordDot ✅\n- OverloadedRecordUpdate ✅\n- OverloadedStrings ➖️\n- PackageImports ✅\n- ParallelListComp ✅\n- PartialTypeSignatures ✅\n- PatternGuards ✅\n- PatternSynonyms ✅\n- PolyKinds ➖️\n- PostfixOperators ➖️\n- QualifiedDo ✅\n- QuantifiedConstraints ✅\n- QuasiQuotes ✅\n- Rank2Types ✅\n- RankNTypes ✅\n- RebindableSyntax ➖️\n- RecordWildCards ➖️\n- RecursiveDo ✅\n- RequiredTypeArguments ✅\n- RoleAnnotations ✅\n- Safe ➖️\n- ScopedTypeVariables ✅\n- StandaloneDeriving ✅\n- StandaloneKindSignatures ✅\n- StarIsType ✅\n- StaticPointers ❌\n- Strict ➖️\n- StrictData ✅\n- TemplateHaskell ✅\n- TemplateHaskellQuotes ✅\n- TraditionalRecordSyntax ➖️\n- TransformListComp ✅\n- Trustworthy ➖️\n- TupleSections ✅\n- TypeAbstractions ✅\n- TypeApplications ✅\n- TypeData ✅\n- TypeFamilies ✅\n- TypeFamilyDependencies ✅\n- TypeInType ✅\n- TypeOperators ✅\n- TypeSynonymInstances ➖️\n- UnboxedSums ✅\n- UnboxedTuples ✅\n- UndecidableInstances ➖️\n- UndecidableSuperClasses ➖️\n- UnicodeSyntax ✅\n- UnliftedFFITypes ➖️\n- UnliftedNewtypes ✅\n- Unsafe ➖️\n- ViewPatterns ✅\n\n# Bugs\n\n## CPP\n\nPreprocessor `#elif` and `#else` directives cannot be handled correctly, since the parser state would have to be\nmanually reset to what it was at the `#if`.\nAs a workaround, the code blocks in the alternative branches are parsed as part of the directives.\n\n# Querying\n\nThe grammar contains several [supertypes](https://tree-sitter.github.io/tree-sitter/using-parsers#static-node-types),\nwhich group multiple other node types under a single name.\n\nSupertype names do not occur as extra nodes in parse trees, but they can be used in queries in special ways:\n\n- As an alias, matching any of their subtypes\n- As prefix for one of their subtypes, matching its symbol only when it occurs as a production of the supertype\n\nFor example, the query `(expression)` matches the nodes `infix`, `record`, `projection`, `constructor`, and the second\nand third `variable` in this tree for `cats <> Cat {mood = moods.sleepy}`:\n\n```\n(infix\n  (variable)\n  (operator)\n  (record\n    (constructor)\n    (field_update\n      (field_name (variable))\n      (projection (variable) (field_name (variable)))))))))\n```\n\nThe two occurrences of `variable` in `field_name` (`mood` and `sleepy`) are not expressions, but record field names part\nof a composite `record` expression.\n\nMatching `variable` nodes specifically that are expressions is possible with the second special form.\nA query for `(expression/variable)` will match only the other two, `cats` and `moods`.\n\nThe grammar's supertypes consist of the following sets:\n\n- [`expression`](./grammar/exp.js)\n\n  Rules that are valid in any expression position, excluding type applications, explicit types and expression\n  signatures.\n\n- [`pattern`](./grammar/pat.js)\n\n  Rules that are valid in any pattern position, excluding type binders, explicit types and pattern signatures.\n\n- [`type`](./grammar/type.js)\n\n  Types that are either atomic (have no ambiguous associativity, like bracketed constructs, variables and type\n  constructors), applied types or infix types.\n\n- [`quantified_type`](./grammar/type.js)\n\n  Types prefixed with a `forall`, context or function parameter.\n\n- [`constraint`](./grammar/constraint.js)\n\n  Almost the same rules as `type`, but mirrored for use in contexts.\n\n- [`constraints`](./grammar/constraints.js)\n\n  Analog of `quantified_type`, for constraints with `forall` or context.\n\n- [`type_param`](./grammar/type.js)\n\n  Atomic nodes in type and class heads, like the three nodes following `A` in `data A @k a (b :: k)`.\n\n- [`declaration`](./grammar/module.js)\n\n  All top-level declarations, like functions and data types.\n\n- [`decl`](./grammar/decl.js)\n\n  Shorthand for declarations that are also valid in local bindings (`let` and `where`) and in class and instance bodies,\n  except for fixity declarations.\n  Consists of `signature`, `function` and `bind`.\n\n- [`class_decl` and `instance_decl`](./grammar/class.js)\n\n  All declarations that are valid in classes and instances, which includes associated type and data families.\n\n- [`statement`](./grammar/exp.js)\n\n  Different forms of `do`-notation statements.\n\n- [`qualifier`](./grammar/exp.js)\n\n  Different forms of list comprehension qualifiers.\n\n- [`guard`](./grammar/exp.js)\n\n  Different forms of guards in function equations and case alternatives.\n\n# Development\n\nThe main driver for generating and testing the parser for this grammar is the [tree-sitter CLI][cli].\nOther components of the project require additional tools, described below.\n\nSome are made available through `npm` – for example, `npx tree-sitter` runs the CLI.\nIf you don't have `tree-sitter` available otherwise, prefix all the commands in the following sections with `npx`.\n\n## Output path\n\nThe CLI writes the shared library containing the parser to the directory denoted by `$TREE_SITTER_LIBDIR`.\nIf that variable is unset, it defaults to `$HOME/.cache/tree-sitter/lib`.\n\nIn order to avoid clobbering this global directory with development versions, you can set the env var to a local path:\n\n```\nexport TREE_SITTER_LIBDIR=$PWD/.lib\n```\n\n## The grammar\n\nThe javascript file `grammar.js` contains the entry point into the grammar's production rules.\nPlease consult the [tree-sitter documentation][grammar-docs] for a comprehensive introduction to the syntax and\nsemantics.\n\nParsing starts with the first item in the `rules` field:\n\n```javascript\n{\n  rules: {\n    haskell: $ => seq(\n      optional($.header),\n      optional($._body),\n    ),\n  }\n}\n```\n\n## Generating the parser\n\nThe first step in the development workflow converts the javascript rule definitions to C code in `src/parser.c`:\n\n```\n$ tree-sitter generate\n```\n\nTwo byproducts of this process are written to `src/grammar.json` and `src/node-types.json`.\n\n## Compiling the parser\n\nThe C code is automatically compiled by most of the test tools mentioned below, but you can instruct tree-sitter to do\nit in one go:\n\n```\n$ tree-sitter generate --build\n```\n\nIf you've set `$TREE_SITTER_LIBDIR` as mentioned above, the shared object will be written to `$PWD/.lib/haskell.so`.\n\nAside from the generated `src/parser.c`, tree-sitter will also compile and link `src/scanner.c` into this object.\nThis file contains the _external scanner_, which is a custom extension of the built-in lexer whose purpose is to handle\nlanguage constructs that cannot be expressed (efficiently) in the javascript grammar, like Haskell layouts.\n\n### WebAssembly\n\nThe parser can be compiled to WebAssembly as well, which requires `emscripten`:\n\n```\n$ tree-sitter build --wasm\n```\n\nThe resulting binary is written to `$PWD/tree-sitter-haskell.wasm`.\n\n## Testing the parser\n\nThe most fundamental test infrastructure for tree-sitter grammars consists of a set of code snippets with associated\nreference ASTs stored in `./test/corpus/*.txt`.\n\n```\n$ tree-sitter test\n```\n\nIndividual tests can be run by specifying (a substring of) their description with `-f`:\n\n```\n$ tree-sitter test -f 'module: exports empty'\n```\n\nThe project contains several other types of tests:\n\n- `test/parse/run.bash [update] [test names ...]` parses the files in `test/parse/*.hs` and compares the output with\n  `test/parse/*.target`.\n  If `update` is specified as the first argument, it will update the `.target` file for the first failing test.\n\n- `test/query/run.bash [update] [test names ...]` parses the files in `test/query/*.hs`, applies the queries in\n  `test/query/*.query` and compares the output with `test/query/*.target`, similar to `test/parse`.\n\n- `test/rust/parse-test.rs` contains a few tests that use tree-sitter's Rust API to extract the test ranges for\n  terminals in a slightly more convenient way.\n  This requires `cargo` to be installed, and can be executed with `cargo test` (which also runs the tests in\n  `bindings/rust`).\n\n- `test/parse-libs [wasm]` clones a set of Haskell libraries to `test/libs` and parses the entire codebase.\n  When invoked as `test/parse-libs wasm`, it will use the WebAssembly parser.\n  This requires `bc` to be installed.\n\n- `test/parse-lib name [wasm]` parses only the library `name` in that directory (without cloning the repository).\n\n### Debugging\n\nThe shared library built by `tree-sitter test` includes debug symbols, so if the scanner segfaults you can just run\n`coredumpctl debug` to inspect the backtrace and memory:\n\n```\nnewline_lookahead () at src/scanner.c:2583\n2583                ((Newline *) 0)->indent = 5;\n(gdb) bt\n#0  newline_lookahead () at src/scanner.c:2583\n#1  0x00007ffff7a0740e in newline_start () at src/scanner.c:2604\n#2  scan () at src/scanner.c:2646\n#3  eval () at src/scanner.c:2684\n#4  tree_sitter_haskell_external_scanner_scan (payload=<optimized out>, lexer=<optimized out>,\n    valid_symbols=<optimized out>) at src/scanner.c:2724\n#5  0x0000555555772488 in ts_parser.lex ()\n```\n\nFor more control, launch `gdb tree-sitter` and start the process with `run test -f 'some test'`, and set a breakpoint\nwith `break tree_sitter_haskell_external_scanner_scan`.\n\nTo disable optimizations, run `tree-sitter test --debug-build`.\n\n#### Tracing\n\nThe `test` and `parse` commands offer two modes for obtaining detailed information about the parsing process.\n\nWith `tree-sitter test --debug`, every lexer step and shift/reduce action is printed to stderr.\n\nWith `tree-sitter test --debug-graph`, the CLI will generate an HTML file showing a graph representation of every step.\nThis requires `graphviz` to be installed.\n\n[tree-sitter]: https://github.com/tree-sitter/tree-sitter\n[ref]: https://www.haskell.org/onlinereport/haskell2010/haskellch10.html\n[ext]: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/exts/table.html\n[cli]: https://github.com/tree-sitter/tree-sitter/tree/master/cli\n[grammar-docs]: https://tree-sitter.github.io/tree-sitter/creating-parsers#writing-the-grammar\n[ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter/tree-sitter-haskell/ci.yml?logo=github&label=CI\n[discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord\n[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix\n[npm]: https://img.shields.io/npm/v/tree-sitter-haskell?logo=npm\n[crates]: https://img.shields.io/crates/v/tree-sitter-haskell?logo=rust\n[pypi]: https://img.shields.io/pypi/v/tree-sitter-haskell?logo=pypi&logoColor=ffd242\n","readmeFilename":"README.md"}