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

Eliminate use of unrefined types to simplify API appearance #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tel
Copy link
Owner

@tel tel commented Jan 31, 2016

Right now the Api type is ugly as all hell

data Api nat symbol star where ...

What is that? nat symbol star? Ugly! Confusing!

We can eliminate (probably?) the uses of nat and symbol if we never actually use unrefined types (see here) though I'm not yet sure how. This will reduce the type noise to just Api star which is easier to explain and less noisy. This is a big improvement!

@tel
Copy link
Owner Author

tel commented Jan 31, 2016

These instances are a bit broken by this change:

instance HeaderEncode 'AccessControlAllowHeaders (Set (HeaderType Text)) where
  headerEncode _ = displaySetOpt . Set.map headerName

instance HeaderEncode 'AccessControlAllowHeaders [HeaderType Text] where
  headerEncode = uniqueSet

@tel
Copy link
Owner Author

tel commented Feb 5, 2016

I could probably replace those with something like Set SomeHeader for SomeHeader = exists (h :: HeaderType Symbol) . Sing h. That's a possible way forward!

@tel tel added this to the Public 1.0.0 milestone Feb 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant