Closed mstn closed 4 years ago
@mstn sorry for being so late, there's a draft in the 0.3.0
branch
@gcanti what's blocking you from releasing 0.3.0 ? I'm extremely bad at higher order typing stuff but am an old hand at javascript w/ some scala experience if there's a way I can reasonably help.
(loving fp-ts by the way, it's making me super nostalgic for scalaz - in a good way!)
what's blocking you from releasing 0.3.0 ?
@jfhbrook well nothing, my draft is 22 hours old though, and it's quite different from @mstn 's solution.
@mstn basically I used the same technique used in OptionT
, EitherT
, ReaderT
, etc... so index.ts
works like a LoggerT
and LoggerIO
is a logger specialized to IO
computations
Oh wow, didn't even notice the timestamps - just thought you coincidentally replied to an issue around the same time I was digging into it. Stoked to see you're on it! And yeah, if you need a test drive or anything I'm in general trying to hack on typescript on weekends, just lmk,.
@gcanti thanks, Your solution looks better than mine :) Feel free to close this pr if you feel like it
Closing in favor of https://github.com/gcanti/logging-ts/pull/17
@mstn thanks for reviewing
It upgrades
fp-ts
to 2.0. Related to #8.I defined a logger with an interface
The problem is that
HKT<M, void>
is a "phantom" type and anyLogger
implementation returns aKind<M, void>
instead, resulting in a type error.My solution is a logger "constructor" that "attaches" (virtually)
_URI
and and_A
to a simpleKind<M, void>
object.It is the first time I play with
fp-ts
HKTs, so I do not know if there is a better way. What do you think, @gcanti?TODO
README