The fay-jquery package

[Tags: bsd3, library]

jQuery bindings for Fay.


[Skip to ReadMe]

Properties

Versions0.2.0.0, 0.2.1.0, 0.3.0.0, 0.4.0.0, 0.4.0.1, 0.5, 0.6, 0.6.0.1, 0.6.0.2, 0.6.0.3
Change logCHANGELOG.md
Dependenciesfay-base (>=0.18), fay-text (>=0.2) [details]
LicenseBSD3
CopyrightAdam Bergmark, Brian Victor, Chris Done
AuthorAdam Bergmark, Brian Victor, Chris Done
Maintaineradam@bergmark.nl
CategoryWeb, Fay
Home pagehttps://github.com/faylang/fay-jquery
Bug trackerhttps://github.com/faylang/fay-jquery/issues
Source repositoryhead: git clone https://github.com/faylang/fay-jquery.git
UploadedMon Jan 6 16:27:49 UTC 2014 by AdamBergmark
DistributionsLTSHaskell:0.6.0.3, NixOS:0.6.0.3, Stackage:0.6.0.3
Downloads2506 total (142 in last 30 days)
Votes
0 []
StatusDocs uploaded by user [build log]
All reported builds failed [all 1 reports]

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for fay-jquery-0.6.0.2

Fay jQuery

Changelog

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 means that names and types may change in rapid and annoying ways until conventions settle down.

The one consistent convention in the library is that the jQuery object on which methods operate is the last parameter to every function. This allows simple monadic composition:

{-# LANGUAGE RebindableSyntax, OverloadedStrings #-}

import Fay.Text (fromString)
import JQuery
import Prelude

(>=>) :: (a -> Fay b) -> (b -> Fay c) -> a -> Fay c
f >=> g = \x -> f x >>= g

makeSquare :: JQuery -> Fay JQuery
makeSquare = addClass "square" >=>
             setWidth 400 >=>
             setHeight 400

-- `ready` is the same as jQuery(document).ready(%1);
-- You generally need to wait for this event to fire before modifying the DOM.
main :: Fay ()
main = ready $ do
    select "#elementToMakeSquare" >>= makeSquare
    return ()

Usage

Install:

cabal install fay-text fay-jquery

Compile your file:

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

Supported API calls

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.

Still to do

Not Applicable