GithubHelp home page GithubHelp logo

hjmtql / purescript-trout Goto Github PK

View Code? Open in Web Editor NEW

This project forked from purescript-hyper/purescript-trout

0.0 0.0 0.0 171 KB

Type-Level Routing for PureScript

License: Mozilla Public License 2.0

JavaScript 2.55% PureScript 94.02% Dhall 3.43%

purescript-trout's Introduction

Trout
Trout

Type-Level Routing for PureScript


Trout is a Servant-style routing type API. By using routing types you get static guarantees about having handled all cases. You also get a lot of stuff for free, such as type-safe parameters for handlers, and automatically generated type-safe URIs to endpoints.

The primary use of Trout right now is for Hyper and the purescript-hypertrout server package. There is, however, nothing Hyper-specific about this package.

Usage

bower install --save purescript-trout

This package should get its own proper documentation soon. In the meantime, see purescript-hypertrout.

API Documentation

This library's API documentation is published on Pursuit.

Changelog

  • 0.12.3
    • Update for argonaut API changes.
  • 0.12.2
    • Add Header.
  • 0.12.1
    • Add ReqBody.
  • 0.12.0
    • PureScript 0.13 compiler support
    • Various dependency upgrades
  • 0.11.0
    • PureScript 0.12 compiler support
    • Various dependency upgrades
  • 0.10.0
    • Routes are now named. The following routes are written in the old format, compatible with 0.9.x:

      type TestSite =
             Resource (Get (HTML :<|> JSON) Home)
        :<|> "users" :/ Resource (Get (HTML :<|> JSON) Home)

      When ported to 0.10.0, they become named:

      type TestSite =
             "home"  := Resource (Get (HTML :<|> JSON) Home)
        :<|> "users" := "users" :/ Resource (Get (HTML :<|> JSON) Home)

      The route name and the literal route segments are orthogonal; there is no relation between the name "users" and the segment "users" in the above routes, as far as Trout is concerned. The name is only used to identify the route when deriving functionality from the routes, e.g. to obtain a URI to a specific resource.

  • 0.9.1
    • Change AltE infix operator to right-associative
  • 0.9.0
    • Add support for query params
    • Move content types to Method, instead of in Resource, e.g. Resource (Get MyThing) JSON becomes Resource (Get MyThing JSON).
  • 0.8.1
    • Better documentation on the Trout API
  • 0.8.0
    • Rename top-module to Type.Trout
  • 0.7.0
    • Rename to Trout
    • Bump deps for 0.11.x compatibility
  • 0.6.0
    • Restructure API to include notion of a Resource
  • 0.5.0
    • Remove server part, keep only API
  • 0.4.1
    • Use Hyper 0.4.1
  • 0.4.0
    • Use upcoming Hyper 0.4.0
    • Initial version, extracted from main Hyper repo

License

Mozilla Public License Version 2.0

Logo credit: https://commons.wikimedia.org/wiki/File:Lake_Trout_GLERL.jpg

purescript-trout's People

Contributors

owickstrom avatar nsaunders avatar nwolverson avatar rightfold avatar th-awake avatar drewolson avatar

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.