Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Persistent FFI bindings for using jsUri in Fay
Haskell Shell
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
.gitignore
LICENSE
README.md
compile-test
fay-uri.cabal
test.hs

README.md

fay-uri

This is a thin persistent FFI layer for using jsUri with Fay.

See the source code for comments on the implementation, names are kept similar to what jsUri uses. Hopefully it's easy to understand even if you haven't used jsUri before. The argument order is changed to be more haskelly, such as always putting the Uri as the last argument and not combining setting and removal functions. Any other changes are documented in the source.

Since jsUri is a small library fay-uri also serves as a good example on how to write FFI bindings in Fay.

Usage

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

in fay >= 0.12:

fay --package fay-uri MyFile.hs

in fay < 0.12:

fay --include ~/.cabal/share/fay-uri-0.1.0.0/src MyFile.hs

Example

import Language.Fay.Prelude
import Language.Fay.Uri

main :: Fay ()
main = putStrLn . toString . removePath . withProtocol "https" . newUri =<< currentUri
Something went wrong with that request. Please try again.