Skip to content

Commit 115c0e3

Browse files
committed
throw Error when no metadata found, fix xstream apply
1 parent 8cb5f61 commit 115c0e3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/fantasy/typeclasses/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function kind(target: any) {
2020
else {
2121
let tag = Reflect.getMetadata('design:type', target.constructor);
2222
if (tag) return tag
23-
throw `target ${target.constructor} is not a datatype, please decorate it with @datatype!`
23+
throw new Error(`target ${target.constructor} is not a datatype, please decorate it with @datatype!`)
2424
}
2525

2626
}

src/fantasy/xstream.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ declare module './typeclasses/cartesian' {
109109
}
110110

111111
export class XstreamApply implements Apply<"Xstream"> {
112-
ap<A, B>(
113-
fab: Xstream<any, any, (a: A) => B>,
114-
fa: Xstream<any, any, A>
115-
): Xstream<any, any, B> {
112+
ap<A, B, F extends Stream>(
113+
fab: Xstream<F, any, (a: A) => B>,
114+
fa: Xstream<F, any, A>
115+
): Xstream<F, any, B> {
116116
return new Xstream(
117117
FlatMap.State.flatMap(s1 => (
118118
Functor.State.map(s2 => (
119-
map((([a, b]) => a(b)), product(s1, s2))
119+
streamOps.combine<(a: A) => B, A, B>((a, b) => a(b), s1, s2)
120120
), fa.streamS)
121121
), fab.streamS))
122122
}

0 commit comments

Comments
 (0)