Похожие чаты

I need some advice in functional programming. I'm writing library to

contacting Telegram bot api. Difference from all the other 9999 libraries that do the same? Mine will allow to write pure functional handlers. Handlers have signature next -> tgUpdate -> IO.

I wrote a minimal proof-of-concept echo bot, I can send it if somebody is interested, 23 LOC.

IO will be a monadic type, slightly repurposed to behave also as a Reader monad. And in the passed env, lies the actual function to send requests to bot api. So, in other words, IO is not bound to any bot instance when it's created — the env is only passed when IO is being ran.

Maybe Free monad would be a better fit here, but I'm yet to grasp it.

The problem is, how does database fit into all of this? Should the db live in env as well, or not?

Feel free to ask if you don't understand something, I feel as I have everything else about the lib figured out.

2 ответов

2 просмотра
Wojciech-Pawlik Автор вопроса

while we are kinda talking about functional, I'll remind that this is still open ^

I think the database should just be a part of the IO chain?

Похожие вопросы

Обсуждают сегодня

А еще в перле можно уже @arr1 + @arr2?
Sergei Zhmylove
53
Подскажите, где смотреть результат выполнения программы? Код: ;.686 ;Система команд процессора 686 ;.MODEL FLAT,stdcall ;Модель памяти плоская, станда...
Егор Анелькин
5
I arrived here after a Chico Crypto show highlighted the project & the Team - the fact that the Team had a long history of successfully working with household names gave me e...
Banter is Bullish
1
я не магистр хаскеля, но разве не может лейзи тип конвертнуться в не-лейзи запросив вычисление содержимого прям при инициализации?
deadgnom32 λ madao
100
Привет всем. появился вопрос. Разрабатываю сайт, в данный момент он запущен. Хостинг beget. Добавляю на сайт яндекс метрику с помощью полей client-settings (взято отсюда http...
Andrew
2
;.686 ;Система команд процессора 686 ;.MODEL FLAT,stdcall ;Модель памяти плоская, стандартный ;вызов процедуры ;option casemap:no...
Егор Анелькин
1
Почему у макбука экран не сенсорный?
✨ Anatolii Cherednichenko
28
It's unfortunate that the "Then why are you here" or "lol you must've bought high" mantras always come up. I already tried bringing up this subject in the price channel but si...
Leroy Gerrits
4
Так а кто может спарсить всех участников чата? Идишники
Magic
17
Есть вопрос: допустим есть железка с каким-то интерфейсом(допустим usb), но как по этому интерфейсу железкой управлять неизвестно, прог нету, а управлять очень хочется надо. К...
Mixail Frolov
15
Карта сайта