Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Non-Empty Arrays #22

Open
anthonyjoeseph opened this issue Apr 7, 2022 · 0 comments
Open

Support Non-Empty Arrays #22

anthonyjoeseph opened this issue Apr 7, 2022 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@anthonyjoeseph
Copy link
Owner

anthonyjoeseph commented Apr 7, 2022

🚀 Feature request

Support NonEmptyArray (from fp-ts) as being a tuple with [0] defined as well as a traversable & indexable array

Current Behavior

nonempty arrays are treated like normal arrays

Desired Behavior

const a: NonEmptyArray<string> = ["abc", "def"]
const x: string = pipe(a, get("a.[0]"))
const y: Option<string> = pipe(a, get("a.[number]", 1))

Suggested Solution

Update Paths and Build (I think AtPath should work properly as-is)

Who does this impact? Who is this for?

Users of NonEmptyArray

Describe alternatives you've considered

try to support other implementations of NonEmptyArray as well (which would be safe, since we require typescript >v4.0).

Additional context

Your environment

Software Version(s)
spectacles-ts 1.0.6
fp-ts 2.11
TypeScript 4.6
@anthonyjoeseph anthonyjoeseph added enhancement New feature or request good first issue Good for newcomers labels Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant