Ailrun / typed-f

Typed functional programming utilities
MIT License
20 stars 2 forks source link

Maybe.from has wrong type #46

Closed Ailrun closed 5 years ago

Ailrun commented 5 years ago

Description

Following code gives me Just<string | undefined>

function test(v: string | undefined): {} {
  return Maybe.from(v);
}

and if I gave <string> to from, i.e., calling it as Maybe.from<string>(v), it gives me a error

Type 'undefined' is not assignable to type 'string'

Possible Solution

Reported by

@JohannesHome