Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.
Replacing TOML with Free monads. In a static site of tracking every data (like diet, health). a la https://quantifiedself.com/
do you have some examples?
Using barebie to declare the per-day entry record:
declareBareB [d| data Entry' = Entry' { skin :: Mood, food :: [F], note :: Maybe Markdown } |]
And then doing free monad magic to build these entries in a monadic fashion:
runEntry $ do setSkin Neutral common0 addFoods [ffWagyu, costcoShrimpW] where common0 = do addFood $ Coffee 3 addFood $ fwTallow addFood $ pepper
No files under ./a. All data lives in Haskell source. Full type safety. :-D (Toml doesn't handle non-trivial ADTs)
./a
speaking of which, ive thought a bit about doing this; a next-version of what I am doing might be some language within a haskell quasiquoter
Current snapshot of the module: https://gist.github.com/srid/136adf8009e7576f2fedc3f789d34e76
One interesting thing about the free monad is that, I can swap out in-memory record building with something totally different, like writing to sqlite DB if I want, without changing the free monad 'program' (technically, DSL)
nice
Replacing TOML with Free monads. In a static site of tracking every data (like diet, health). a la https://quantifiedself.com/
do you have some examples?
Using barebie to declare the per-day entry record:
And then doing free monad magic to build these entries in a monadic fashion:
No files under
./a
. All data lives in Haskell source. Full type safety. :-D (Toml doesn't handle non-trivial ADTs)speaking of which, ive thought a bit about doing this; a next-version of what I am doing might be some language within a haskell quasiquoter
Current snapshot of the module: https://gist.github.com/srid/136adf8009e7576f2fedc3f789d34e76
One interesting thing about the free monad is that, I can swap out in-memory record building with something totally different, like writing to sqlite DB if I want, without changing the free monad 'program' (technically, DSL)
nice