Skip to content

What is not supported?

Adam Bergmark edited this page Jan 17, 2014 · 2 revisions

This list is probably incomplete, if there is no test case and no open issue, please create one!

Basic GHC types

We don't feel it's necessary to support things like Int64 or unboxed tuples. Fay's number types are represented as JS numbers for simplicity. This is a pragmatic choice. Changing it would also dramatically change the scope of Fay.

Threads

JavaScript is single threaded, we keep Fay that way to stay close to the actual runtime.

Type classes

Declarations of type class methods are ignored. You can still use type classes to enforce constraints such as:

data JQuery
class Selectable
instance Selectable Element
instance Selectable Text
select :: Selectable a => Automatic a -> Fay JQuery

We plan to support type classes at least partially in the short term.

Package imports

Package imports are ignored. These are used internally by fay-base.

No plans to support this, but let us know if you have a use case for it!

Type aliases in the FFI

type String' = String
f :: String' -> Fay ()
f = ffi "console.log(%1)"

The type alias isn't resolved here so this will generate the same code as f :: a -> Fay () would. Probably not what you expect.

There is nothing blocking this, it just needs to be implemented.

Fixities

haskell-src-exts doesn't support custom fixity declarations. To do this it would have to preparse a file to get the fixities, and then re parse the rest with these applied. Fay passes base fixities to haskell-src-exts so any operator with a declared fixity in GHC base will parse correctly.

Fixity declarations are just ignored at the moment. We should give a warning for this, it shouldn't be hard.