Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates the library, improves naming and some types #1

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

anton-k
Copy link

@anton-k anton-k commented Jan 31, 2018

Hello! Thanks for the library!

I've made some updates, hope you will find them useful:

  • Builds with stack
  • Scientific instead of Double for prices
  • UTCTime instead of string for timestamps (i've made the proper conversion)
  • Adds some useful instances for types (Eq, Ord, Data,Generic)
  • Adds top-level module for easy import of the whole library
  • Adds wrapper DayPeriod
  • Renames some types: there were some conceptional glitches with original API:
    Ticker to Symbol, - since with getSymbols we get probably symbols.
    Symbol to SymbolDetails
    TickerData to just Ticker
  • Adds example of usage to README

Small example (it can be executed in the repo with stack ghci):

import Bitfinex

right = fmap (either (error "It's left") id)

main = do
  sym <- fmap head $ right $ getSymbols
  ticker <- getTicker sym
  stat <- fmap head $ right $ getStats sym

  print sym
  print ticker
  print stat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant