Language-ext: Does language-ext have a Using() function?

Created on 30 Jan 2019  ·  5Comments  ·  Source: louthy/language-ext

Hello,

One of the functions Enrico Buonanno shows in Functional Programming In C# is the following...

static R Using<TDisp, R>(TDisp disposable, Func<TDisp, R> f) where TDisp : IDisposable {
  using (disposable) return f(disposable);
}

Does language-ext have such a function?

Most helpful comment

Yes, there are several overloads called use.

All 5 comments

Yes, there are several overloads called use.

@bender2k14 Thanks for the reply. I assumed there would be, but I can't see them mentioned anywhere. I looked in the list on the main project page, but couldn't see anything.

Where can I find docs on these functions?

Thanks again.

public static B use(A disposable, System.Func f)
where A : System.IDisposable
LanguageExt.Prelude 的成员

摘要:
Functional implementation of the using(...) { } pattern

I am not sure what docs you are expecting to find or if such docs exists.

Here are tests of all the use methods. That should help you figure out what you would like to know.

@bender2k14 I was hoping for something like you see on the project's main page, where there are links to things like Try(). There's not much there in the way of documentation, but at least you can see that the function exists.

Bear in mind that I'm not familiar with all the features of the package, it's very hard finding out what's in there and what it all does.

Thanks anyway, at least now I know use exists, I can play with it.

Was this page helpful?
0 / 5 - 0 ratings