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

Provide pretty syntax for generic record typing #68

Merged
merged 11 commits into from
Mar 25, 2024
Merged

Conversation

tarao
Copy link
Owner

@tarao tarao commented Feb 7, 2024

Before

import com.github.tarao.record4s.%
import com.github.tarao.record4s.typing.Record.Concat

def addEmail[R <: %, RR <: %](record: R, email: String)(using
  Concat.Aux[R, % { val email: String }, RR],
): RR = record + email

After

import com.github.tarao.record4s.%
import com.github.tarao.record4s.typing.syntax.{++, :=}

def addEmail[R <: %, RR <: %](record: R, email: String)(using
  RR := R ++ % { val email: String },
): RR = record + email

or

import com.github.tarao.record4s.%
import com.github.tarao.record4s.typing.syntax.{+, :=}

def addEmail[R <: %, RR <: %](record: R, email: String)(using
  RR := R + ("email", String),
): RR = record + email

Copy link

codecov bot commented Feb 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.76%. Comparing base (8c351c3) to head (a4f0a10).

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #68   +/-   ##
=======================================
  Coverage   93.76%   93.76%           
=======================================
  Files          14       14           
  Lines         513      513           
  Branches      110      110           
=======================================
  Hits          481      481           
  Misses         32       32           
Flag Coverage Δ
3 93.76% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tarao tarao merged commit 06bbc14 into master Mar 25, 2024
16 checks passed
@tarao tarao deleted the typing-syntax branch March 25, 2024 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant