Ailrun / typed-f

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

Maybe.from always returns Just in type level #18

Closed Ailrun closed 6 years ago

Ailrun commented 6 years ago

Description

Following code clearly says that from should return Nothing when input is null | undefined. https://github.com/Ailrun/typed-f/blob/ae02c10665cb89a1594cb24b6c8647399115fea0/packages/maybe/src/Maybe.ts#L174-L180

However, because of order of function type overloading, typescript always gives you Just even if you called it with undefined.