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

Add new Data instances for immutable vectors #205

Merged
merged 2 commits into from
Apr 4, 2018

Conversation

andy-morris
Copy link
Contributor

I included a test for gfoldl, but not for gunfold because I don't really know how to use it. If someone has any pointers, I'll be happy to add one for it too.

Copy link
Member

@RyanGlScott RyanGlScott left a comment

Choose a reason for hiding this comment

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

Thanks @andy-morris, this looks good to me. One minor comment inline.

mkType :: String -> DataType
{-# INLINE mkType #-}
mkType = mkNoRepType
mkTypeConstr :: String -> (DataType, Constr)
Copy link
Member

Choose a reason for hiding this comment

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

Tupling these together feels a mite strange. Why not separate these into two separate functions which return DataType and Constr respectively? Then you wouldn't have to manually project out of it with fst and snd everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I only tupled them because they're mutually recursive, but I know that's a bit of a silly reason. I'll separate them this evening when I get a chance.

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.

2 participants