- Support for GHC 9.10.
- Final version for GHC 9.8
- Fix for the neovim treesitter syntax highlighter for
fmt
andfmtTrim
quasiquotes - Initial support for GHC 9.8
- Version bump for new MTL
- Support for GHC 9.6. Thank you @Kleidukos for initiating the port.
- Support for OverloadedRecordsDot syntax in Meta. Thank you @Profpatsch for the report.
- In some context, the error reporting for variable not found in the quasi quote expression was incorrectly reporting existing variables as not found. See #115 for details. This is now fixed by not abusing GHC api. Thank you @michaelpj for reporting this really weird problem.
- Support for GHC 9.4. (Written with a pre-release of GHC 9.4, hopefully it won't change too much before the release).
- Error reporting now uses the native GHC API. In summary, it means that haskell-language-server will point to the correct location of the error, not the beginning of the quasi quotes.
- PyF will now correctly locate the error for variable not found in expression, even if the expression is complicated. The support for complex expression is limited, and PyF may return a false positive if you try to format a complex lambda / case expression. Please open a ticket if you need that.
- Add support for literal
[]
and()
in haskell expression. - Add support for overloaded labels, thank you Shimuuar.
- Support for
::
in haskell expression. Such as[fmt| 10 :: Int:d}|]
, as a suggestion from julm (close #87). Integral
padding width and precision also for formatter without type specifier.- Extra care was used to catch all
type-defaults
warning message. PyF should not generate code with this kind of warning, unless the embedded Haskell expression are ambiguous (e.g.[fmt|{10}|]
). You can use::
to disambiguate, e.g.[fmt|{10 :: Int}|]
.
- Padding width can now be any arbitrary Haskell expression, such as
[fmt|hello pi = {pi:<{5 * 10}}|]
. - Precision (and now padding width) arbitrary expression can now be any
Integral
and it is not limited toInt
anymore. - (Meta): type expression are now parsed and hence allowed inside arbitrary Haskell expression for padding width and precision. For example,
[fmt|Hello {pi:.{3 :: Int}}|]
.
-
Due to the dependencies refactor,
PyF
no have no dependencies other than the one packaged with GHC. The direct result is thatPyF
build time is reduced to 6s versus 4 minutes and 20s before. -
Remove the dependency to
megaparsec
and replaces it byparsec
. This should have minor impact on the error messages. -
Huge Change. The parsing of embeded expression does not depend anymore on
haskell-src-ext
andhaskell-src-meta
and instead depends on the built-inghc
lib. -
Added instances for
(Lazy)ByteString
toPyFClassify
andPyFToString
.ByteString
can now be integrated into format string, and will be decoded as ascii. -
Relax the constraint for floating point formatting from
RealFrac
toReal
. As a result, a few new type can be formatted as floating point number. One drawback is that someIntegral
areReal
too and hence it is not an error anymore to format an integral as floating point, but you still need to explicitly select a floating point formatter. -
Added instance for
(Nominal)DiffTime
toPyFClassify
, so you can now format them without conversion. -
Introducing of the new typeclass
PyfFormatIntegral
andPyfFormatFractional
in order to customize the formatting for numbers. An instance is derived for respectively anyIntegral
andReal
types. -
Support for
Char
formatting, as string (showing theChar
value) or as integral, showing theord
. -
Data.Ratio
. -
Introducing
fmtTrim
module. It offers the same behavior asfmt
, but trims common indentation. SePyF.trimIndent
for documentation. -
Introducing
raw
for convenience. It is a multiline string without any escaping, formatting neither leading whitespace handling. -
Introducing
str
andstrTrim
. They are similar tofmt
andfmtTrim
but without formatting. You can see them as multiline haskell string, with special character escaping, but without formatting. For convenience, thestrTrim
version also removes indentation. -
fmtWithDelimiters
is gone and replaced bymkFormatter
inPyF
which is "more" generic.
- Test phase do not depend anymore on python (unless cabal flag
python_test
is set). This ease the deployment / packaging process.
- Version bump for megaparsec 9.0
- Fixs for GHC 8.10
- Any type with
Show
instance can be formatted using:s
formatter. For example,[fmt|hello {(True, 10):s}|]
. This breaks compatibility because previous version of PyF was generating an error when try to format to string anything which was not a string, now it accepts roughly anything (with aShow
instance).
- Bump megaparsec bounds
- Compatibility with GHC 8.8
- Precision can now be any arbitrary haskell expression, such as
[fmt|hello pi = {pi:.{1 + 3}}|]
.
- (minor bugfix in tests): Use python3 instead of "python" to help build on environment with both python2 and python3
- Stack support
f
(andfWithDelimiters
) were renamedfmt
(fmtWithDelimiters
).f
was causing too much shadowing in any codebase.- PyF now exposes the typeclass
PyFToString
andPyFClassify
which can be extended to support any type as input for the formatters. - PyF now uses
Data.String.IsString t
as its output type ifOverloadedString
is enabled. It means that it behaves as a real haskell string literal. - A caveat of the previous change is that PyF does not have instances for
IO
anymore.
- An important amount of bugfixs
- Error reporting for generic formatting (i.e. formatting without a specified type) is now more robust
- Template haskell splices are simpler. This leads to more efficient / small generated code and in the event of this code appears in a GHC error message, it is more readable.
- PyF now longer emit unnecessary default typing.
- Tests: fix non reproducible tests
- Fixed: PyF now uses the same haskell extensions as the one used by the current haskell file to parse sub expressions.
- Fixed: PyF was wrongly ignoring everything located after a non-doubled closing delimiter.
- New Feature: line break can be escaped with , thus allowing string to start on a new line ignoring the initial backspace
- Bump dependencies to megaparsec 7
- Error message are now tested
- Name in template haskell splices are stable. This increases readability of error messages
- Better error message for badly formated expression
- All monomorphic quasiquoters (
f
,fString
,fText
,fIO
,fLazyText
) are removed - Polymophic quasiquoter
f'
is renamedf
and is the only entry point. Monomorphic users are encouraged to use the polymorphic quasiquoter with type annotation. Formatting
dependency is removed.- Previously named
f
quasiquoters which was exporting toFormatting.Format
is removed. User of this behavior should useFormatting.now
instead.
- Custom delimiters, you can use whatever delimiters you want in place of
{
and}
.
- Fix the espace parsing of
{{
and}}
as{
and}
- Support for negative zero
- Support for 0 modifier
- Exponential formatter now behaves as python
- Support for alternate floatting point represenation
- Lot of documentation
- Test are auto verified with the python reference implementation
- Support for grouping option
- Support for inner allignment
- Correct display of NaN and Infinity
- Fix a few cosmetic with python implementation
- Introduce
PyF.Formatters
, type safe generic number formatter solution - Remove dependency to
scientific
- Support for haskell subexpression
- Add support for the
sign
field.
- First version. Released on an unsuspecting world.