smirk-penelope: Penelope effect system interface for the Smirk PCRE engine

[ apache, effects, library, regex, text ] [ Propose Tags ] [ Report a vulnerability ]

Exposes Smirk's pure, step-bounded PCRE engine as an algebraic effect for the penelope effect system (Smirk.Effect.Penelope), with pure and fuel-bounded interpreters over flat Polytropos row representations.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Change log CHANGELOG.md
Dependencies base (>=4.16 && <5), penelope-core (>=0.1 && <0.2), penelope-effects (>=0.1 && <0.2), polytropos-core (>=0.1 && <0.2), polytropos-plugin (>=0.1 && <0.2), smirk (>=0.1 && <0.2), text (>=2.0 && <3) [details]
Tested with ghc ==9.12.4, ghc ==9.14.1
License Apache-2.0
Author Nadia Yvette Chambers
Maintainer Nadia Chambers <nadia.yvette.chambers@ik.me>
Uploaded by nyc at 2026-11-03T19:27:52Z
Category Text, Regex, Effects
Home page https://github.com/NadiaYvette/smirk
Bug tracker https://github.com/NadiaYvette/smirk/issues
Source repo head: git clone https://github.com/NadiaYvette/smirk.git(packages/smirk-penelope)
Distributions
Downloads 3 total (3 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for smirk-penelope-0.1.0.0

[back to package description]

smirk-penelope

smirk-penelope exposes Smirk's pure, step-bounded PCRE engine as an algebraic effect for the penelope effect system.

Features

  • Zero-Cost Polycategorical Dispatch: Dispatches regex matching over flat Polytropos row vectors (SmallArray#).
  • ReDoS Protection: Bound execution via matchRegexFuel or runRegexEngineWithFuel.
  • First-Class Effect: Embeds into Penelope's Eff eh ef a unary monad via sendEff @"regex".

Quick Start

import Data.Text (Text)
import Penelope.Effects (Eff)
import Smirk (re)
import Smirk.Effect.Penelope

searchUser :: (ConstructorIndex "regex" ef) => Text -> Eff eh ef (Maybe Text)
searchUser input = do
  mMatch <- matchRegex [re|user:(\w+)|] input
  pure (fmap matchedSlice mMatch)