The yesod-routes-flow package

[ Tags: library, mit, web ] [ Propose Tags ]

Parse the Yesod routes data structure and generate routes that can be used with Flow.

[Skip to Readme]


Versions 1.0, 1.0.1, 1.0.2, 1.1, 1.1.1, 2.0
Dependencies attoparsec, base (<5), classy-prelude (>=0.7), containers, system-fileio, system-filepath (>=0.4), text, yesod-core (>=1.4 && <2.0) [details]
License MIT
Author Max Cantor, Felipe Lessa
Maintainer Greg Weber <>
Category Web
Home page
Uploaded Thu Sep 10 14:54:55 UTC 2015 by FelipeLessa
Distributions NixOS:2.0
Downloads 546 total (11 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-09-10 [all 1 reports]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees

Readme for yesod-routes-flow-2.0

[back to package description]


Parse the Yesod routes data structure and generate routes that can be used in Flow.

The routing structure is generated by:

mkYesodDispatch "App" resourcesApp

You can generate routes at startup inside the makeApplication function

when development $
    genFlowRoutes resourcesApp "assets/ts/paths-gen.ts"

This generates Flow code:

class PATHS_TYPE_paths {
  contacts: PATHS_TYPE_paths_contacts;
  admin: PATHS_TYPE_paths_admin;

    this.contacts = new PATHS_TYPE_paths_contacts();
    this.admin = new PATHS_TYPE_paths_admin();

class PATHS_TYPE_paths_contacts {
  get(): string { return '/api/v1/contacts/get'; }

class PATHS_TYPE_paths_admin {
  adminDocs: PATHS_TYPE_paths_admin_adminDocs;

    this.adminDocs = new PATHS_TYPE_paths_admin_adminDocs();

class PATHS_TYPE_paths_admin_adminDocs {
  get(): string { return '/api/v1/admin/docs/get'; }

var PATHS:PATHS_TYPE_paths = new PATHS_TYPE_paths();

In your Flow code you can now do:


Please note that the Haskell code was hastily translated from Javascript code, then translated from TypeScript to Flow, and is pretty horrible. There are bugs and edge cases to be addressed, but this works ok for us.