Skip to content

Commit 7188a14

Browse files
committed
Added lazy IO creation
1 parent 62977fc commit 7188a14

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

core/src/main/java/fj/data/IOFunctions.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,15 @@ public static final <A> IO<A> lazy(final F<Unit, A> f) {
158158
return () -> f.f(Unit.unit());
159159
}
160160

161-
/**
161+
public static final <A> SafeIO<A> lazySafe(final F<Unit, A> f) {
162+
return () -> f.f(Unit.unit());
163+
}
164+
165+
public static final <A> SafeIO<A> lazySafe(final P1<A> f) {
166+
return () -> f._1();
167+
}
168+
169+
/**
162170
* A function that feeds an iteratee with lines read from a {@link BufferedReader}.
163171
*/
164172
public static <A> F<BufferedReader, F<IterV<String, A>, IO<IterV<String, A>>>> lineReader() {

0 commit comments

Comments
 (0)