See full history at: https://github.com/faylang/fay/commits
- Drop GHC 8.0 support.
- Cabal upgraded to 2.0 spec-version.
- Travis CI refactored to allow cabal-install 3.2.0.0 builds.
- Relax boundaries for aeson, tasty, base-compat. Allow builds for Gentoo (#469).
- GHC 8.10.1 support.
- GHC 8.8 support.
- Fixes stack nix integration broken.
- Dependency updates including GHC-8.6 support.
- Added stack compatibility.
- Fix dependent compilation fail when building project with stack (#457).
- Dependency updates incl GHC 8.4 support
- Add the option to generate typescript output, thanks to Junji Hashimoto.
- GHC 8.2 support
- Use traverse-with-class 1.0.*, and as a result drop support for GHC < 8.
- Fix build on GHC 7.4
- Allow optparse-applicative 0.13.*.
- Fix a compilation error introduced in 0.23.1.13.
- Add support for haskell-src-exts 1.18.1.
- Fix compilation on GHC < 7.8.
- Tighten some impossible lower bounds we can't support.
- Don't compile with
-fprof-auto
by default.
- Allow and require
haskell-src-exts 1.17.*
- Allow
vector 0.11.*
- Fix panic when compiling irrefutable pattern matches on lists (thanks Christopher Parks)
- Allow
syb 0.5.*
- Allow
aeson 0.9.*
- Fix compilation on at least GHC 7.6 (maybe older versions as well...)
- Inline parts of
haskell-names 0.4.1
andhaskell-packages
to drop transitive dependencies on Cabal and other packages.
- Allow filepath 1.4.*
- Allow do let bindings of newtypes.
- Add
--show-ghc-calls
andconfigShowGhcCalls
to print invocations to GHC.
- Allow
mtl-compat 0.2.*
andtransformers-compat 0.4.*"
.
New features:
- GHC 7.10 support
- Add a
--pretty-operators
flag to replace the escaped operator names with their actual names - By Michal Seweryn - Add a
--pretty-all
flag that enables--pretty
,--pretty-operators
, and--pretty-thunks
- By Michal Seweryn - De/serialize type variables as 'automatic'. You no longer have to annotate FFI functions with Automatic, this is now the default. If you need the old behavior, use Ptr. For most existing cases this change shouldn't change anything. - By Zachary Mason
Example output with --pretty-all
:
Main.main = new $(function(){
return _(_(Prelude["$"])(Prelude.print))(_(_(Prelude["++"])(Main.g))(Fay$$list("b")));
});
API changes - By Michal Seweryn:
- Export CompileResult from Fay.Types
- Export PrintReader and PrintWriter, and reducing number of PrintState fields (these are moved to PrinterReader and PrintWriter)
- In the meanwhile PrintWriter field type changed - output is now stored as ShowS - tests run faster now
- Replace monadic functions (askP, getP, ...) with higher level ones: indented, askIf, newline, write, mapping. askIf is pretty much like previous askP, but works like if-then-else.
- Internally we are now using
ExceptT
instead ofErrorT
. This fixes deprecation warnings when usingtransformers 0.4.*
.
Bug fixes:
- Defer automatic_function fayToJs call until after argument application - by Zachary Mason
Dependency bumps:
- Allow
utf8-string 1.0.*
- Allow
time == 1.5.*
- Add a
--pretty-thunks
flag and compiler option that replacesFay$$_
andFay$$$
with_
and$
respectively. Consider this a development flag since it may clash with JS libraries (notably jQuery and underscore) - Allow
language-ecmascript 0.17.*
- Hide all packages by default when typechecking. This avoids conflicting with packages that haven't been specified on the command-line with
--package
, e.g. thetext
package when you importData.Text
.
- Previously all package imports were ignored, now we only ignore
"base"
package imports.
- Lots of additions to in
fay-base
adding the following modules:- Data.Var - Mutable variables, Reactive variables, and reactive signals
- Unsafe.Coerce
- Data.Text (fay-text will be updated to reuse this module)
- Data.Time
- Data.Ord, Data.Function, Data.Maybe, Data.List, Data.Either
- Data.Defined and Data.Nullable
- Data.Mutex - Simple mutexes
- Control.Exception
- Data.LocalStorage
- Data.MutMap - Mutable maps
The introduction of Data.Var
required some additions to fay's runtime.
- Fallback to ghc and ghc-pkg in PATH if not available from GHC.Paths
- Update to
optparse-applicative == 0.11.*
- Errors are now properly thrown from
encodeFay
. Changes the type signature toencodeFay :: (GenericQ Value -> GenericQ Value) -> GenericQ Value
- Update to
haskell-src-exts == 1.16.*
, This changes the type signature ofreaderCompileLit
to:: S.Sign -> S.Literal -> Compile JsExp
- Fixes
ghc-pkg describe
stdout errors not always being printed
- Config option to disable optimizations of newtypes, treating them as
normal data types. This can be triggered by setting
configOptimizeNewtypes = False
or passing--no-optimized-newtypes
.
- Update to
optparse-applicative == 0.10.*
- Test suite is no longer built by default, cabal install with
-ftest
to enable.
- Updated homepage URLs, fay-lang.org was 301'd
- Don't cache the
main
thunk in the generatedmain
call.
-
Add default case for UTCTime in Fay.Convert using the aeson instances. Note that this serializes to a json string so you won't be able to deserialize it as a separate type (such as Date) when using
Automatic
in Fay. -
Added
Fay.Config.defaultConfigWithSandbox
that reads theHASKELL_PACKAGE_SANDBOX
environment variable. Client libraries can use this instead of manually reading fromgetEnvironment
.
- Allow
optparse-applicative 0.9.*
- Allow
mtl 2.2.*
- Allow
haskell-names 0.4.*
- Allow
transformers >= 0.4.1 && < 0.5
-
Adds support for LambdaCase and MultiWayIf
-
Modules have moved around a lot and several modules have been un-exposed. From now on you will probably only need to deal with at most
Fay
(which re-exports a lot of things),Fay.Config
,Fay.Types.CompileError
,Fay.Convert
, andFay.Types.CompileResult
. Please let us know if you would like us to expose more things -
Config:
CompileConfig
has been renamed toConfig
and is now located inFay.Config
.CompileConfig
has become a temporary type alias forConfig
.Fay.Compiler.Config
is deprecated, importFay
orFay.Config
instead.- The
data-default
instance forConfig
is deprecated, usedefaultConfig
instead.
-
compiling
compileFileWithState
is deprecated, usecompileFileWithResult
which returns aFay.Types.CompileResult
instead. As a consequenceCompileState
is also deprecated from public consumption.compileFile
,compileFromToAndGenerateHtml
no longer return a triple with the sourcemap, usecompileFileWithResult
if you want access to this.
-
Importing
Fay.Types
has been deprecated, importFay
instead. -
readFromFay
has been rewritten usingsyb
instead ofpretty-show
(Thanks to Michael Sloan and Chris Done)- This introduces the following breaking changes:
readFromFay
has aData
constraint instead ofShow
.- Drops support for Rational and Integer (see below for migration steps). The reason is that neither was serialized in a way that would roundtrip for all values. Also, for similar reasons, fromRational is potentially divergent for aeson's new use of the Scientific type.
- And adds the following features:
- You can now write custom
Show
instances targeting GHC for types shared with Fay. - Better performance.
- Allows the serialization and deserialization to be customized on a per-type basis, via encodeFay and decodeFay.
- You can now write custom
- To migrate code using Rational or Integer, use encodeFay and pass an argument e.g.
(\f x -> maybe (f x) myIntegerToValueConversion (cast x))
and likewise to decodeFay.
- This introduces the following breaking changes:
Bugfixes:
- Mltiple guards on a pattern in a case expression skipped everything but the first guard. To fix this an optimization we had on pattern conditions was disabled.
Dependency bumps:
- Allow Cabal 1.20 and 1.21
Internal:
- Test cases are now using
tasty
instead oftest-framework
. To run cases in parallel usefay-tests --num-threads=N
(seefay-tests --help
for more info). - Added a test group for desugaring.
- Allow
haskell-src-exts 1.15.*
- Fixes a bug where arrays used with empty data decls would be deserialized into a Fay list instead of kept as is.
- Fix optimizations that were not applied and add codegen test cases.
- Allow
optparse-applicative 0.8.*
- Added Data.Char to fay-base
Dependency bumps:
- Allow
Cabal 1.19.*
- Allow
process 1.2.*
Bugfixes:
- Don't export transcoding information for fay-base packages when compiling with --no-stdlib
- Better error messages when forgetting the type signature in an FFI declaration
Dependency bumps:
- Allow
aeson 0.7.*
- Made import Prelude is implicit, but note that RebindableSyntax implies NoImplicitPrelude.
- Allow FFI declarations in let and where statements:
let f :: X; f = ffi "..."
andwhere f :: X; f = ffi "..."
Bugfixes:
- Removed extra </script> tag that was generated by --html-wrapper
- FFI expressions in top level declarations now produce identical code to a normal top level FFI declaration
- Don't export Data.Ratio and Debug.Trace when using --no-stdlib
Dependency bumps:
- Allow text 1.1
- Allow attoparsec 0.11
Note: 0.18.0.1 added source mappings returned by Fay:compileFile
and friends meaning it should have been a major bump. Sorry about this!
- Add parsing of Integer to Fay.Convert (note that the runtime doesn't have arbitrary precision Integers)
- Allow text 1.0.*
- Add support for indirect application of newtypes (such as
p = NewType; foo = p x
andbar = NewType $ y
)
- Fix a bug where records with the same name as top level modules wouldn't be initialized correctly.
- Fail when using enum syntax on unsupported literal types (for instance ['a'..'z'])
- Add support for TupleSections
Bugfixes:
- Disallow unsupported patterns in where/let declarations instead of
<<loop>>
ing on them
Minor:
- Put upper bounds on all dependencies
Bugfixes:
- Allow
//
as an operator name (added flag tohse-cpp
) - Don't transcode function values when using an EmptyDataDecl
Minor:
- Allow
optparse-applicative == 0.7.*
- Fix
examples/Cont.hs
Bug fixes:
- Regression: Work around a bug in optparse-applicative 0.6 that prevents
--strict
from being used.
- Source maps for top level definitions, use
--sourcemap
Bug fixes:
- Regression: Equality checks for (G)ADTs (
deriving Eq
) - Fix
--strict
for top level ADT values (such asmodule M where g = R
) - Regression: Serialization in the presence of compression/renaming
- Pass NoImplicitPrelude (and other enabled extensions) to haskell-names to resolve ambiguities when Prelude isn't imported.
Minor:
- Bump optparse-applicative to 0.6.*
- Bump haskell-names to 0.3.1 to allow compilation with Cabal 1.14
- Ignore more declarations (useful when code sharing with GHC)
New features:
- Support for qualified imports. Note: You still can't have multiple constructors with the same name in the FFI since the
instance
field in the serialization is still unqualified. Automatic
transcoding now works for functions. See Calling Fay From JavaScript--strict modulename[, ..]
generates strict and transcoding wrappers for a module's exports. See Calling Fay From JavaScript--typecheck-only
just runs the GHC type checker with the appropriate Fay flags.--runtime-path FILEPATH
allows you to supply a custom runtime. Probably only useful for debugging.
Bug fixes:
- Don't crash when trying to get the fayToJsFun of an object without constructor.name
- Fixed bug that accidentally flattened list arguments in
jsToFay
- Fix construction with RecordWildCards not taking already listed fields into account
Breaking Changes:
- Fay.Compiler.Debug has been removed (for now)
- The interactive compilation mode has been removed (for now)
Internal changes:
- Migrated to haskell-src-ext's annotated AST.
- Name resolution is now done using haskell-names, Fay's name resolution code is now pure and a lot simpler.
-
With the
RebindableSyntax
andOverloadedStrings
extensions Fay will treat Haskell string literals as JavaScript Strings. Add this in all modules and import Fay.Text (from thefay-text
package). This is not a breaking change, without these extensions in a moduleString
will be used, as before. All modules can still interoperate normally even if only some of them use this feature. Note that you may have to definefromInteger
when using this with Num literals. -
The type signature of
Fay.FFI.ffi
(in fay) andFFI.ffi
(in fay-base) has been generalized toIsString s => s -> a
to supportRebindableSyntax
. -
Much faster compile time (of the compiler itself) by having the executables depend on the library.
Bugfixes:
- The empty list and unit is now serialized to
null
when using Automatic (it used to throw an error).
Minor:
- Restrict upper bound on
language-ecmascript
to< 1.0
- Support for tuple constructors (
(,,) 1,2,3
)
Minor:
- Bump
pretty-show
to>= 1.6
- Remove the
-fdevel
flag (when compiling fay itself)
Minor:
- Bump
haskell-src-exts
to>= 1.14
Bugfixes:
- Allow combining multiline strings with CPP
- New module generation, modules generate code separately in the format
My.Module.foo
instead ofMy$Module$foo
- Transcoding information is also produced separately for each module
- Removed
--naked
,--dispatcher
, and--no-dispatcher
. They are probably not needed anymore - Removed
Fay$$fayToJsUserDefined
andFay$$jsToFayUserDefined
, instead callFay$$fayToJs
andFay$$jsToFay
respectively - Escape semi reserved words from
Object
when printing (constructor
->$constructor
). This only matters if you call Fay from JS Automatic
now handles lists and tuples (#251)Language.Fay.FFI
renamed toFay.FFI
(as before, Fay code can importFFI
fromfay-base
)
Minor:
- Print location of parse errors
- Compile with -XNoImplicitPrelude
- Support for testing nested modules (module A, module A.B)
- Bump
language-ecmascript to >= 0.15
(new API) - Rename/remove some CompileErrors
- All tests are now included in dist
Bug fixes:
- Force cars in string serialization (#306)
- Expression level FFI calls,
ffi "alert('hello!')" :: Fay ()
- Support let pattern matches
- Smaller output for serialization code
- --base-path flag to use a custom base (mainly for fay-prim)
- Allow ExistentialQuantification, FlexibleContexts, FlexibleInstances, KindSignatures
- Verify that GADTs using non-record syntax works
- JS->Fay function serialization
- Serialization support for
()
, tuples andChar
- Add more reserved words for Google Closure
Bugfixes:
- Fix a bug when an imported module contains types
- Fix a bug with EModuleContents exports
- Fix where clause inside pattern guards in function definitions
- Fix type variables in serialization for multiple constructors
- Fix EThingAll exports for types with constructors with a different name
- Don't export types in EThingAll and EThingWith
- Support for newtypes (with no runtime cost!)
- --base-path flag to specify custom locations for fay-base
- Fix a bug where imports shadowing local bindings would prevent the local binding from being exported
- Fix record updates on IE <= 8
- Import tweaks, will make compilation a lot faster (4x reported) when there are a lot of imports
- Parse hs sources with base fixities