holeyexp 0.3.0.1 → 0.3.0.2
raw patch · 5 files changed
+17/−8 lines, 5 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.HoleyExp.Text: instance GHC.Internal.Show.Show Data.HoleyExp.Text.TParseError
+ Data.HoleyExp.HExp: pattern EmptyHole :: Natural -> HoleProps f -> Hole f
+ Data.HoleyExp.HExp: pattern FilledHole :: Natural -> f -> HoleProps f -> Hole f
+ Data.HoleyExp.HExp: pattern UndefHole :: Natural -> HoleProps f -> Hole f
+ Data.HoleyExp.Text: instance GHC.Show.Show Data.HoleyExp.Text.TParseError
Files
- CHANGELOG.md +7/−1
- holeyexp.cabal +1/−1
- src/Data/HoleyExp/HExp.hs +5/−2
- src/Data/HoleyExp/HExpInternal.hs +2/−2
- src/Data/HoleyExp/Text.hs +2/−2
CHANGELOG.md view
@@ -6,7 +6,13 @@ and this project adheres to the [Haskell Package Versioning Policy](https://pvp.haskell.org/). -## Unreleased+## Unreleased ++## [0.3.0.2] - 2026-09-10+### Changed+ - Exposed the hole pattern synonyms.+ - Fixed the show instance for `HExp` to parens for holes instead of brackets.+ ## [0.3.0.1] - 2026-09-04 ### Changed - We migrated to the hole syntax `$i(f)` from `$i{f}`, but we forgot to
holeyexp.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: holeyexp-version: 0.3.0.1+version: 0.3.0.2 license: BSD-3-Clause license-file: LICENSE.md maintainer: Harley Eades III <harley.eades@gmail.com>
src/Data/HoleyExp/HExp.hs view
@@ -35,8 +35,8 @@ 1. \( t_1 * $(1,\mathsf{?}) * t_2 * $(2,\mathsf{?}) \), has chunks \(\{t_1,t_2\}\) and two empty holes indexed by \(1\) and \(2\). 2. \( t_1 * $(5,f_5) * $(3,\mathsf{?}) * t_2 * $(7,f_7) \), has chunks- \(\{t_1,t_2\}\) and one empty holes indexed by \(3\) and a filled hole index- by \(7\) whose filling is \(f_2\).+ \(\{t_1,t_2\}\) and one empty holes indexed by \(3\) and two filled holes index+ by \(5\) whose filling is \(f_5\) and \(7\) whose filling is \(f_7\). Now if we choose some concrete sets for \(\mathsf{Txt}\) and \(\mathsf{Fill}\) then we can create more interesting expressions:@@ -123,6 +123,9 @@ -- properties, if not then it's considered -- undefined. This prevents a lot of boilerplate -- pattern matching.+ ,pattern EmptyHole+ ,pattern FilledHole+ ,pattern UndefHole ,pattern Empty ,pattern Chunk ,pattern Compose
src/Data/HoleyExp/HExpInternal.hs view
@@ -131,9 +131,9 @@ show (HExp (IChunk t) _) = DT.unpack . toText $ t show (HExp (ICompose prefix i rest) (emptyHoles, filledHoles)) = (DT.unpack . toText $ prefix) - <> "$" <> show i <> "{"+ <> "$" <> show i <> "(" <> (if i `elem` emptyHoles then "" else (DT.unpack . toText . fToT $ filledHoles ! i))- <> "}" + <> ")" <> show (HExp rest (emptyHoles, filledHoles)) where fToT :: filling -> text
src/Data/HoleyExp/Text.hs view
@@ -21,7 +21,7 @@ >>> let t = (chunk "Today's Temperature: ") +> (hole 1) +> (chunk " high/") +> (hole 2) +> (chunk " low") :: HExp Text Double >>> t-Today's Temperature: $1{} high/$2{} low+Today's Temperature: $1() high/$2() low >>> plugAll t $ \_ -> \i -> if i == 1 then Just 91.2 else if i == 2 then Just 87.0 else Nothing Just "Today's Temperature: 91.2 high/87.0 low"@@ -40,7 +40,7 @@ We can also add a filling to holes in an expression: >>> "Today's Temperature: " <> (filled 1 92.2) <> " high/" <> (filled 2 91.2) <> " low" :: HExp Text Double-Today's Temperature: $1{92.2} high/$2{91.2} low+Today's Temperature: $1(92.2) high/$2(91.2) low -} module Data.HoleyExp.Text