Git Product home page Git Product logo

wasp-lang_strong-path's Introduction

StrongPath

CI Documentation Hackage Stackage LTS Stackage Nightly

Strongly typed file paths in Haskell.

This library provides a strongly typed representation of file paths, providing more safety during compile time while also making code more readable, compared to the standard solution (FilePath, which is really just String).

Without StrongPath:

getBashProfile :: IO FilePath

With StrongPath:

getBashProfile :: IO (Path System (Rel HomeDir) (File BashProfile))

Simple but complete example:

import StrongPath (Path, System, Abs, Dir, parseAbsDir)

data HomeDir

getHomeDirPath :: IO (Path System Abs (Dir HomeDir))
getHomeDirPath = getLine >>= fromJust . parseAbsDir

Check documentation for more details!

Documentation

Detailed documentation, including rich examples and API is written via Haddock.

Check out the latest documentation on Hackage: Documentation.

You can also build and view the Haddock documentation yourself if you wish, by running stack haddock --open.

Contributing / development

We are using ormolu for code formatting. In order for the PR to pass, it needs to be formatted by ormolu.

strong-path is Stack project, so make sure you have stack installed on your machine.

stack build to build the project, stack test to run the tests.

stack build --file-watch --haddock to rebuild documentation as you change it.

Publishing to Hackage

First, make sure to update the version of package in package.yaml, if needed.

Then, stack sdist to build publishable .tar.gz., and then we need to upload it manually to Hackage.

Check if Hackage correctly built the Haddock docs -> if not, you need to upload them manually (check Hackage webpage for instructions, it should be smth like cabal v2-haddock --haddock-for-hackage --enable-doc and then cabal upload -d --publish <path_to_docs.tar.gz>).

We should also tag the commit in git with version tag (e.g. v1.0.0.0) so we know which version of code was used to produce that release.

wasp-lang_strong-path's People

Contributors

ccntrq avatar faassen avatar martinsos avatar

Stargazers

 avatar

Watchers

 avatar  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.