typeclasses / haskell-phrasebook

The Haskell Phrasebook: a quick intro to Haskell via small annotated example programs
https://typeclasses.com/phrasebook
210 stars 22 forks source link

Adds basic logging example #36

Closed friedbrice closed 4 years ago

friedbrice commented 4 years ago

Addresses issue https://github.com/typeclasses/haskell-phrasebook/issues/15

This is perhaps already too complicated and it doesn't even get to concurrency or application architecture.

chris-martin commented 4 years ago

Sorry sorry I've been neglecting the Phrasebook :grimacing:

I'm fiddling around with this code now, but initial thoughts:

I think the Log type with multiple kinds of logs will come across well to Java users with an impulse for a log "interface". The log monoid is clever and I don't think it's too complicated. Using only the console log at first, while reading the config for the fancier log, nicely motivates why we would want such "log combinators".

chris-martin commented 4 years ago

I'm thinking of reading the file paths from environment variables instead of getLine, just because the interactivity is a little harder to demo.

friedbrice commented 4 years ago

I agree. I'll patch this tonight.

friedbrice commented 4 years ago

I made a huge mistake and deleted my original fork. This PR is pickup up in https://github.com/typeclasses/haskell-phrasebook/pull/39