Skip to content

Conversation

@fahchen
Copy link

@fahchen fahchen commented Sep 19, 2022

related pr #28

@flupke flupke mentioned this pull request Sep 23, 2022
Copy link

@flupke flupke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with just a few naming nits. Thanks for showing me how it's done :)

(note: I'm not a maintainer, just commenting)

Comment on lines 180 to 181
# A arg named :int
arg :int
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# A arg named :int
arg :int
# A type parameter named int
arg :int

README.md Outdated
use TypedStruct

typedstruct do
arg :state
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I would call it parameter:

  • to match the style of field and plugin, which are not abbreviated
  • to match the documentation, which talks about "parameterized types"

end

def __arg__(name, _env) do
raise ArgumentError, "a arg name must be an atom, got #{inspect(name)}"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
raise ArgumentError, "a arg name must be an atom, got #{inspect(name)}"
raise ArgumentError, "a parameter name must be an atom, got #{inspect(name)}"

end

@doc """
Defines a argument for a typed struct.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Defines a argument for a typed struct.
Defines a type parameter for a typed struct.

@ejpcmac
Copy link
Owner

ejpcmac commented Sep 23, 2022

Hello, thank you for your PR! @flupke, I’ve also read your comments on the other PR, sorry that both of you have worked on the same subject.

I’m still quite loaded on non-OSS personal duties this week, and not available this week-end, but I will review it next week, along with other pending PRs.

As stated in the CONTRIBUTING.md, work should be based and merged back to develop. Could you then just rebase your PR on top of develop and re-target it to develop? It will run the CI as well, as it is enabled only for PRs to develop.

Note that I have disabled Elixir 1.14 from the CI as of now, as there is a bug in Elixir 1.14.0 breaking typed_struct, which will be fixed in the next Elixir release.

@fahchen fahchen force-pushed the feat/fahchen/parameterized-types branch from 2a33f4f to b31b509 Compare September 24, 2022 05:50
@fahchen fahchen changed the base branch from main to develop September 24, 2022 05:50
@fahchen
Copy link
Author

fahchen commented Sep 24, 2022

@flupke Thanks for your suggestions that makes sense.

@ejpcmac Thanks for your reply, and I’ve updated the PR according to the CONTRIBUTING.

@ejpcmac ejpcmac added this to the 0.3.1 milestone Oct 5, 2022
@sethcalebweeks
Copy link

This is an awesome package that saves me a ton of boilerplate. Thanks @ejpcmac! Unfortunately, I really need parameterized types. Is this still being considered, or am I better off forking/creating a plugin? Thanks!

@ejpcmac ejpcmac added the T:Feature Type: Feature label Dec 29, 2023
@fahchen
Copy link
Author

fahchen commented Jul 5, 2024

I am extremely grateful to @ejpcmac for providing this package, which has performed excellently in my projects. However, it lacked some features I needed, and it appeared that the repo was not being maintained actively. I rewrite this package with some new functionalities, including those introduced in this PR. For those interested in these enhancements, you are welcome to visit https://github.com/elixir-typed-structor/typed_structor or https://hexdocs.pm/typed_structor/readme.html. Once again, many thanks to @ejpcmac .

@ejpcmac ejpcmac moved this from Backlog to Preparation in ejpcmac’s personal OSS work Nov 9, 2025
@ejpcmac
Copy link
Owner

ejpcmac commented Nov 9, 2025

Thank you @fahchen for your work and kind words. I’ve actually burned out of OSS maintenance three years ago around a bad pull request experience. I was under pressure at my job at the same moment, also doing a lot of difficult code reviews. I could not handle both. Since then it’s been hard to break the silence, and I’ve mostly avoided to work on typed_struct due to that.

I’m sorry you needed to rewrite it, though looking at the code of your fork there seems to be really neat things that could benefit typed_struct in the long run too.

I’m now getting back to maintenance, starting by merging open pull requests and tackling some easy features. I plan to do a new release in the weeks to come.

I’ll rebase your PR and handle any change myself.

@ejpcmac ejpcmac moved this from Preparation to Ongoing in ejpcmac’s personal OSS work Nov 9, 2025
Copilot AI review requested due to automatic review settings November 11, 2025 20:22
@ejpcmac ejpcmac force-pushed the feat/fahchen/parameterized-types branch from b31b509 to e9c7edc Compare November 11, 2025 20:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (da6414f) to head (056086d).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff            @@
##           develop       #34   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           41        45    +4     
=========================================
+ Hits            41        45    +4     
Files with missing lines Coverage Δ
lib/typed_struct.ex 100.00% <100.00%> (ø)
test/support/test_struct.ex 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ejpcmac ejpcmac force-pushed the feat/fahchen/parameterized-types branch from e9c7edc to 2a07149 Compare November 12, 2025 08:24
@ejpcmac
Copy link
Owner

ejpcmac commented Nov 12, 2025

I have done two pushes:

  1. the rebase + mandatory fixes to get it work,
  2. some slight changes + a fix.

In push (2) I have updated the test to include two type parameters, and fixed a bug where the type parameters where passed in reverse.

I’ll push type parameter documentation support with an additional :doc parameter to parameter/2 in another commit.

@ejpcmac ejpcmac force-pushed the feat/fahchen/parameterized-types branch from 2a07149 to 0f6532f Compare November 12, 2025 08:32
Co-authored-by: Phil Chen <06fahchen@gmail.com>
Co-authored-by: Jean-Philippe Cugnet <jean-philippe@cugnet.eu>
@ejpcmac ejpcmac force-pushed the feat/fahchen/parameterized-types branch from 0f6532f to 8d72169 Compare November 17, 2025 08:29
@ejpcmac ejpcmac moved this from Ongoing to In Review in ejpcmac’s personal OSS work Nov 17, 2025
@ejpcmac ejpcmac force-pushed the feat/fahchen/parameterized-types branch from a096de5 to 056086d Compare November 17, 2025 08:35
@ejpcmac ejpcmac merged commit 36774c2 into ejpcmac:develop Nov 17, 2025
16 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Solved in ejpcmac’s personal OSS work Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T:Feature Type: Feature

Projects

Status: Solved

Development

Successfully merging this pull request may close these issues.

4 participants