Giter Club home page Giter Club logo

fay-uri's Introduction

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

fay-uri's People

Contributors

bergmark avatar chrisdone avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

bergmark

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.