Giulio Canti

Results 398 comments of Giulio Canti

Thanks @SamHH > Add documentation alluding to this unsafety This is a good first step.

Using `switchMap` does produce a lawful Monad / Alt instance?

@mlegenhausen thanks for reporting, `toPromise`'s signature is inaccurate: ```ts toPromise(this: Observable): Promise ``` Is it possible to detect if an observable completes without emitting a value?

Ok, so I guess we can do the same and define an internal `lastValueFrom` helper (except we can't reject) and use that instead of `toPromise`

Yes, like `Task`'s [`never`](https://github.com/gcanti/fp-ts/blob/465a1db88cd710115db3fef86eb45d5d9bbd5eba/src/Task.ts#L421).

This is weird, all the following libraries define an `Alternative` instance: - https://github.com/bodil/purescript-observable - https://github.com/jasonzoladz/purescript-rxjs - https://github.com/LukaJCB/purescript-rxps

@raveclassic does the actual problem stem from the `ap` implementation which uses [`combineLatest`](https://github.com/gcanti/fp-ts-rxjs/blob/87ecd28ef7181b4c2ed73b32ce7dc5c1ad77e7ed/src/Observable.ts#L86)? I guess should use `zip` instead ```ts ap: (fab, fa) => zip(fab, fa).pipe(rxMap(([f, a]) => f(a))) ```...

@raveclassic never mind, `zip` doesn't behave like I thought

@raveclassic this is a theoretical problem: what's the meaning of `=` in the Distributivity law? ``` A.ap(A.alt(fab, gab), fa) = A.alt(A.ap(fab, fa), A.ap(gab, fa)) ``` or, in other words, given...

> we can't define it for Task @mlegenhausen well, actually we *can*, the trivial one ```ts import { Eq } from 'fp-ts/lib/Eq' import { constTrue } from 'fp-ts/lib/function' import {...