Sys.IO improvements / Triaged issues + fixes release
#1389
louthy
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Sys.IOimprovementThe
Sys.IOfunctions were generalised to support any monad that has the correctHastraits. However, this added a burden to any users ofEffandAfffromv4of language-ext.For example, this in
v4:Would become this in
v5:That works well when you're write entirely generalised IO code, like you see in the
Newslettersample project.Writing this:
Is clearly not much worse than before. And adds lots of possibilities for writing your IO functions once and have them work with all IO based monads. But, this
Console<Eff<RT>, RT>.writeLine(text)is quite ugly to look at in my humble opinion. There's too much clutter and it shows up on every line of IO you write, which doesn't feel good.So, as
Eff<RT, A>is an important type for doing dependecy-injection based IO, I have addedEffspecific versions for every static class in theSyslibrary.So, for example, as well as
Console<M, RT>, there is also aConsole<RT>which only works with theEff<RT, A>monad. This allows existing code that usesEff<RT, A>to work without a change.I'm not a huge fan of doubling up the work like this, but I think this is a pragmatic solution that works without much drama.
Fixes and Updates:
Unitmade into aMonoidOption<A>made into aMonoidToEnumerableextension forFoldablehas been renamed toToIterable(it was missed on the previous refactor)StreamTinternals made lazyIEnumerableandIAsyncEnumerableHeadUnsaferemoved fromStreamTHeadOrFailextension toStreamTadded. Only works withFalliblemonads.MemoryFS, replaced with use of/tmpas a virtual file-system. Fixes:Additions, but not ready for primetime
Source<A>- a source of events that can be subscribed to. Subscriptions yield aStreamTStreamssampleThis discussion was created from the release `Sys.IO` improvements / Triaged issues + fixes release.
Beta Was this translation helpful? Give feedback.
All reactions