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

LTS-9.x (stage 2) #4

Merged
merged 24 commits into from
Apr 28, 2018
Merged

LTS-9.x (stage 2) #4

merged 24 commits into from
Apr 28, 2018

Conversation

unclechu
Copy link
Contributor

No description provided.

@unclechu unclechu self-assigned this Apr 16, 2018
@unclechu unclechu requested a review from dzhus April 16, 2018 21:05
@unclechu
Copy link
Contributor Author

@dzhus Work in progress. For now just partially refactored Main.hs (fixed logger monad in realMain by using polymorphic exceptions).

@unclechu unclechu changed the base branch from master to lts-9 April 16, 2018 21:06
@unclechu unclechu mentioned this pull request Apr 16, 2018
@dzhus dzhus mentioned this pull request Apr 17, 2018
Closed
dmcc-ws/Main.hs Outdated
data Config =
Config
data Config
= Config
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dzhus If you have multiple constructors they will be at the same column:

data Foo
  = Bar
  | Baz
  | Bzz

Or for records:

data RFoo
  = RBar
  { foo :: Int
  , bar :: Int
  }
  | RBaz
  { bzz :: Int
  , zzz :: Int
  }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это я там ёбу дал, надо писать

data Foo = Foo
  { kek :: Double
  , foo :: String
  }

Суммы-рекордов вообще нахуй запретить надо, вместо них использовать generic-lens (типобезопаснее).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dzhus Я что-то не понял про какие "суммы-рекордов" ты говоришь?

Copy link
Member

@dzhus dzhus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я ещё пару дней почешу репу, но вроде по коду сейчас норм. Было бы неплохо протестировать на тестовом серваке :)

@unclechu
Copy link
Contributor Author

@dzhus Да как норм, там же ещё эти вызовы runStdoutLoggingT не зачищены.

@unclechu
Copy link
Contributor Author

Было бы вообще неплохо как-нибудь замокать api авайи, чтобы автотесты написать.

@unclechu
Copy link
Contributor Author

@dzhus Main.hs вроде готов, осталось по модулям пройтись.

@unclechu
Copy link
Contributor Author

Там websockets подвязан явно на IO, по-этому приходится в одном месте прокидывать логгер и обворачивать IO монаду, которая как аргумент передаётся (см. runServer).

added type signatures for top-level bindings and stuff
- using DMCC.Prelude everywhere where it's needed
- added Control.Monad.Logger to DMCC.Prelude
  (it was there but haven't been exported)
- fixed some warnings
@unclechu
Copy link
Contributor Author

На данный момент подчищены все ворнинги. Осталось только избавиться от вермишели с runStdoutLoggingT.

@unclechu
Copy link
Contributor Author

@dzhus Вроде готово, по-моему можно сливать в мастер.

@unclechu
Copy link
Contributor Author

Тип логгера инициализируется в самой верхней монаде единожды.

@dzhus dzhus merged commit aaed741 into lts-9 Apr 28, 2018
@dzhus dzhus deleted the feature/lts-9-stage-2 branch April 28, 2018 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants