Skip to content

Fix Newtype instance in test code #14

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

Merged
merged 4 commits into from
Jan 16, 2021
Merged
Changes from 1 commit
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
Next Next commit
Remove wrap/unwrap from test code's Newtype instance
  • Loading branch information
JordanMartinez committed Jan 10, 2021
commit 6c1fe85826325097651ea17e079d50868bfb0846
4 changes: 1 addition & 3 deletions test/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ newtype RecordNewtype = RecordNewtype

instance newtypeRecordNewtype ::
TypeEquals inner { message :: String }
=> Newtype RecordNewtype inner where
wrap = RecordNewtype <<< to
unwrap (RecordNewtype rec) = from rec
=> Newtype RecordNewtype inner

message :: forall ty row. TypeEquals row ( message :: String ) => Newtype ty (Record row) => ty -> String
message = unwrap >>> proof >>> _.message
Expand Down