1
Fork 0

typescript(option): fix: compL was only used once so it wasn't worth the bundle sacrifice

Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
Matei Adriel 2019-12-23 15:17:09 +02:00 committed by prescientmoon
parent a32f62cfc6
commit dcd55c5047
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4

View file

@ -1,11 +1,10 @@
import { match } from './match' import { match } from './match'
import { Mapper } from '../internalTypes' import { Mapper } from '../internalTypes'
import { Option, Some, None } from '../types' import { Option, Some, None } from '../types'
import { compL } from '@thi.ng/compose'
export const map = <T, U>( export const map = <T, U>(
mapper: Mapper<T, U>, mapper: Mapper<T, U>,
option: Option<T> option: Option<T>
): Option<U> => { ): Option<U> => {
return match(compL(mapper, Some), None, option) return match(v => Some(mapper(v)), None, option)
} }