Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prikhi/bodyweight-server
A Haskell REST Server for a BodyWeight Workout Log Application.
https://github.com/prikhi/bodyweight-server
bodyweight haskell routines
Last synced: 1 day ago
JSON representation
A Haskell REST Server for a BodyWeight Workout Log Application.
- Host: GitHub
- URL: https://github.com/prikhi/bodyweight-server
- Owner: prikhi
- License: gpl-3.0
- Created: 2016-04-04T22:06:23.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-02T15:56:16.000Z (over 7 years ago)
- Last Synced: 2025-02-02T01:02:07.179Z (13 days ago)
- Topics: bodyweight, haskell, routines
- Language: Haskell
- Size: 64.5 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Bodyweight Logger Server
A Bodyweight Workout Logging REST server written in Haskell.
Right now this is pretty much a minimal REST API wrapper around a postgresql
database.CRUD operations on the following resources are exposed:
* Exercises
* Routines
* Sections/SectionExercises
* Subscriptions
* Users
* Routine Logs## Setup
```
pacman -S stack
make
```## TODO
* Documentation
* Add expected Environmental Variables to README
* Document Typeclasses & instance implementations in Models module
* Add API Docs using servant-doc
* User Auth
* Add User/Subscriber field to RoutineLogs## Code Style
Loosely based off of Elm's style guide & `elm-format`, the goal is to minimize
noise in commit diffs.Try not to go too far over a line width of 80 characters.
**Let/In/Where**
Use let/in for values & where for functions:
```
someFunc someArg =
let
someVar =
someExpr 2 3 4
in
return $ wrap someVar
where wrap =
VarsomeFunc someArg =
extrapolate 2 3 4 someArg
where extrapolate =
anotherFunc 2 4
```**Multiline Lists/Tuples**
```
[ firstElem
, secondElem
, thirdElem
]
```**Multiline Type Definitions**
```
someFunction :: (ShortTypeclass a) => a -> asomeFunction :: ( TypeclassOne a b c, AVeryLongTypeclassNameSoWeCanShowWrapping a
, TypeclassThree c )
=> a -> b -> csomeFunction :: SomeReallyLongFunctionArguement
-> AndAnotherReallyLongOneSoWeCantFitItAllInALine
-> Int
```**Function Definitions**
```
someFunction arg1 arg2 arg3 =
someExpr arg2 arg3 $ otherExpr arg1someFunction someArg monadicFunction = do
someResult <- monadicFunction
handleResult someArg someResultsomeFunction someArg =
aMultilineFunctionCall withLots ofArguments thatWont fitIn
aSingleLine
```**Imports**
Proper order is explicit imports, qualified imports, application imports.
Alignment doesn't really matter, but we might automate it using
stylish-haskell in the future.```
module MyModule whereimport Data.Maybe (isJust, isNothing)
import Servant (err401)import qualified Data.Text as T
import Models
import Types
```## License
GPL-3.0