egison-pattern-src: Manipulating Egison patterns: abstract syntax, parser, and pretty-printer

[ bsd3, language, library, parser, pretty-printer ] [ Propose Tags ]

egison-pattern-src provides a standalone syntax definition for patterns in the Egison programming language. This package enables you to embed Egison's patterns in your parser (pretty-printer) by supplying expression and name parsers (printers) externally.


[Skip to Readme]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.1.0, 0.2.0.0, 0.2.1.0, 0.2.1.1, 0.2.1.2
Change log CHANGELOG.md
Dependencies base (>=4.8 && <5), containers (>=0.5.4 && <0.8), free (>=5.0.1 && <5.3), megaparsec (>=7.0.0 && <10.0), mtl (>=2.2.1 && <2.4), parser-combinators (>=1.0.0 && <1.4), prettyprinter (>=1.0.0 && <2.0), recursion-schemes (>=5.0.2 && <5.3), text (>=0.1.0 && <1.3 || >=2.0 && <2.2) [details]
License BSD-3-Clause
Copyright Copyright 2020 coord_e
Author coord_e
Maintainer coord_e <me@coord-e.com>, Satoshi Egi <egi@egison.org>
Revised Revision 1 made by Bodigrim at 2023-10-01T08:45:11Z
Category Language, Parser, Pretty Printer
Home page https://github.com/egison/egison-pattern-src#readme
Bug tracker https://github.com/egison/egison-pattern-src/issues
Source repo head: git clone https://github.com/egison/egison-pattern-src
Uploaded by coord_e at 2020-11-03T05:53:23Z
Distributions LTSHaskell:0.2.1.2, Stackage:0.2.1.2
Reverse Dependencies 4 direct, 3 indirect [details]
Downloads 1895 total (20 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2020-11-03 [all 1 reports]

Readme for egison-pattern-src-0.2.1.2

[back to package description]

Egison Pattern Source

Actions Status Actions Status Hackage Hackage Deps

The egison-pattern-src provides a standalone syntax definition for patterns in the Egison programming language. This package enables you to embed Egison's patterns in your parser (pretty-printer) by supplying expression and name parsers (printers) externally.

Syntax

The following is a simplified syntax of pattern expressions where v, c, op and e are meta-variables for variable names, constructor names, user-defined infix operators, and expressions in host language, respectively.

p ::= _                     (wildcard pattern)
    | $v                    (pattern variable)
    | #e                    (value pattern)
    | ?e                    (predicate pattern)
    | (p_1, p_2, ..., p_n)  (tuple pattern)
    | [p_1, p_2, ..., p_n]  (collection pattern)
    | p & p                 (and-pattern)
    | p | p                 (or-pattern)
    | !p                    (not-pattern)
    | p op p                (user-defined infix pattern)
    | c p_1 p_2 ... p_n     (constructor pattern)

License

egison-pattern-src is distributed as open source software under the terms of the 3 clause BSD License. See LICENSE for details.