1
Fork 0

typescript(option): fix: fixed fold returning void

Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
Matei Adriel 2019-12-19 20:23:59 +02:00 committed by prescientmoon
parent 1fda9e8242
commit 5c3225273c
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4

View file

@ -49,7 +49,7 @@ export const fold = <T, U>(
initial: U, initial: U,
option: Option<T> option: Option<T>
) => { ) => {
match(option, v => folder(initial, v), always(initial)) return match(option, v => folder(initial, v), always(initial))
} }
export const foldback = <T, U>( export const foldback = <T, U>(
@ -92,7 +92,7 @@ export const withDefault = <T>(_default: T, option: Option<T>) => {
const checkIfOption = <T>(x): x is Option<T> => x[isOption] const checkIfOption = <T>(x): x is Option<T> => x[isOption]
export const flat = <T>(option: Option<T>) => { export const flat = <T, U>(option: Option<T>): Option<U> => {
return match( return match(
option, option,
inner => { inner => {