Skip to content

Commit

Permalink
Update usage instructions in README and fix some warnings (closes #17)
Browse files Browse the repository at this point in the history
  • Loading branch information
bergmark committed Oct 4, 2013
1 parent bd97a20 commit f4389dd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Fay jQuery
==========

jQuery bindings for Fay. This project is experimental and not suitable for
production purposes.
jQuery bindings for Fay. This project is experimental, but seems to work pretty well!

The short-term goals of this project are to help discover the real world
requirements of Fay and to invite bikeshedding over the fay-jquery API. That
Expand All @@ -28,24 +27,23 @@ main = do
Usage
-----

To use this with fay, cabal install the package which will put the
source files in fay ~/.cabal/share/fay-jquery-0.1.0.0/src. You can then
compile with fay using

in fay >= 0.12:
Install:
```bash
fay --package fay-jquery MyFile.hs
cabal install fay-text fay-jquery
```

in fay < 0.12:
```
fay --include=~/.cabal/share/fay-jquery-0.1.0.0/src MyFile.hs
Compile your file:

```bash
fay --package fay-jquery,fay-text MyFile.hs
```


Supported API calls
-------------------

This binding is a work in progress. I'm adding calls by section of the jQuery
This binding is a work in progress. We're adding calls by section of the jQuery
docs. There is some overlap in the sections, but the following sections are
(mostly) complete.

Expand All @@ -56,14 +54,14 @@ docs. There is some overlap in the sections, but the following sections are
- Effects (Basic, Fading)
- Manipulation
- Traversing
- Events

Still to do
-----------

- Data
- Deferred Object
- Effects (Custom, Sliding)
- Events
- Forms
- Internals
- Miscellaneous
Expand Down
1 change: 1 addition & 0 deletions fay-jquery.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ source-repository head

library
hs-source-dirs: src
ghc-options: -Wall
exposed-modules: JQuery
build-depends: fay-base >= 0.18
, fay-text >= 0.2
5 changes: 3 additions & 2 deletions src/JQuery.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data types all subject to drastic change.

import Fay.Text
import FFI
import Prelude
import Prelude hiding (succ)

data JQuery

Expand Down Expand Up @@ -399,14 +399,15 @@ anim :: AnimationType -> JQuery -> Animation
anim ty el = Animation ty Fast Nothing el

speed :: Speed -> Animation -> Animation
speed spd anim = anim { _speed = spd }
speed spd ani = ani { _speed = spd }

chainAnim :: Animation -> Animation -> Animation
chainAnim a1 a2 = a1 { _nextAnimation = Just a2 }

chainAnims :: [Animation] -> Animation
chainAnims [a] = a
chainAnims (a:as) = a `chainAnim` chainAnims as
chainAnims [] = error (unpack "chainAnims: empty list")

runAnimation :: Animation -> Fay ()
runAnimation a = do
Expand Down

0 comments on commit f4389dd

Please sign in to comment.