My first package: elm-triplet


#1

I created elm-triplet, but since it is the first elm package that I am publishing and I don’t want to fill up the repository with unnecessary stuff, I would like to know if it is properly assembled and if I am not repeating someone else’s work. Here is the doc preview:

https://elm-doc-preview.netlify.com/?repo=francescortiz%2Felm-triplet

Thanks!


#2

Nice, this is neat! The only other 0.19 package I know with similar functionality is https://package.elm-lang.org/packages/TSFoster/elm-tuple-extra/latest/Tuple3


#3

Well, duplicate effort then xD. Thanks for pointink it out!


#4

I seem to end up writing similar functions again and again so definitely useful to wrap them up in a package. I like the nice compact conversion to three element records, so thanks for that.

I do wonder, now the Elm can only use 2- and 3- tuples, whether there’s now a stronger argument for such functions to be standard in the core Tuples module.


#5

In elm-tuple-extra you have uncurry that does the same, and since it is much more complete and the elm compiler gets rid of all dead code, I think it is better to use the bigger package, but thanks for the nice comment anyway :slight_smile:


#6

I might be misunderstanding you, but as far as I remember tuple3 was just removed in 0.19, as you should be using records instead.


#7

You can have tuples up to the size of 3 elements, otherwise the compiler encourages you to use records. The Tuple3 that I am referring is part of the package elm-tuple-extra from TSFoster.


closed #8

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.