Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ export type Option<A> = None | Some<A>
* @category constructors
* @since 2.0.0
*/
export const none: Option<never> = _.none
export const none: None = _.none

/**
* Constructs a `Some`. Represents an optional value that exists.
*
* @category constructors
* @since 2.0.0
*/
export const some: <A>(a: A) => Option<A> = _.some
export const some: <A>(a: A) => Some<A> = _.some

/**
* Returns a *smart constructor* based on the given predicate.
Expand Down
4 changes: 2 additions & 2 deletions src/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ export const isNone = (fa: Option<unknown>): fa is None => fa._tag === 'None'
export const isSome = <A>(fa: Option<A>): fa is Some<A> => fa._tag === 'Some'

/** @internal */
export const none: Option<never> = { _tag: 'None' }
export const none: None = { _tag: 'None' }

/** @internal */
export const some = <A>(a: A): Option<A> => ({ _tag: 'Some', value: a })
export const some = <A>(a: A): Some<A> => ({ _tag: 'Some', value: a })

// -------------------------------------------------------------------------------------
// Either
Expand Down