hg: lambda/lambda/jdk: Add BufferedReader.lines
Olexandr Demura
oleksander.demura at gmail.com
Mon Nov 12 01:01:47 PST 2012
Exceptional streams looks to me simply like one more StreamShape,
dual to Mapping<K, V> stream shape - some analogue to `Either A B`.
If concept of Map Stream is viable yet, of course.
BTW, java implicitly have that `shape` for years (:
Callable<T> ~= () -> (T | Exception)
e.g. what if Optional<T> doesn't exist.
T reduce(T base, BinaryOperator<T> op);
Optional<T> reduce(BinaryOperator<T> op);
->
<X> T reduce(BinaryOperator<T> op, Factory<X> otherwise) throws X;
Optional<T> findFirst();
Optional<T> findAny();
->
<X> T findFirst(Factory<X> otherwise) throws X;
<X> T findAny(Factory<X> otherwise) throws X;
2012/11/12 Zhong Yu <zhong.j.yu at gmail.com>
>
> UncheckedIOException would also be useful in many applications where
> IO exceptions aren't expected to occur, and it would have been better
> if they are unchecked. Now programmers can use UncheckedIOException to
> convert IO exceptions to uncheck exceptions.
>
> However, why not have a general UncheckedException, so that we don't
> need to invent UncheckSQLException, UncheckedReflectionException etc.
> We can use RuntimeException as the wrapper now, but a dedicated
> UncheckedException can be more clear that this is just a wrapper of
> the actual exception.
>
> Zhong Yu
>
>
More information about the lambda-dev
mailing list