Open
Conversation
Contributor
|
@jfoutz unable to compile your code because of the missing cabal file. Did you forget to commit? |
Author
|
Yes. Added and pushed. This should cover the DomainAPI only, i'll have another update for design goals tomorrow. (at least some of the design goals will move to the next sprint.) |
| mkData6 f (x1:x2:x3:x4:x5:x6:[]) = Just $ f (fromSql x1) (fromSql x2) (fromSql x3) (fromSql x4) (fromSql x5) (fromSql x6) | ||
| mkData9 f (x1:x2:x3:x4:x5:x6:x7:x8:x9:[]) = Just $ f (fromSql x1) (fromSql x2) (fromSql x3) (fromSql x4) (fromSql x5) (fromSql x6) (fromSql x7) (fromSql x8) (fromSql x9) | ||
| mkData9 _ _ = Nothing | ||
| mkData11 f (x1:x2:x3:x4:x5:x6:x7:x8:x9:x10:x11:[]) = Just $ f (fromSql x1) (fromSql x2) (fromSql x3) (fromSql x4) (fromSql x5) (fromSql x6) (fromSql x7) (fromSql x8) (fromSql x9) (fromSql x10) (fromSql x11) |
Contributor
There was a problem hiding this comment.
is there any way to write these functions so that they work with lists of exactly N elements? Does HDBC have functions which return fixed sized tuples instead of lists?
| _ -> Nothing | ||
|
|
||
| createTenant :: Connection -> Tenant -> IO (Maybe Int) | ||
| createTenant conn (Tenant _ created updated name first last email phone status owner backoffice) = do |
Contributor
There was a problem hiding this comment.
isn't using the record constructor a much safer way of pattern matching this? It protects against change in position of fields.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm interested in DomainAPI and Types
I think maybe each primitive type in Tenant and User should become a type alias, and the "create" versions should take typed arguments rather than a tennant or a user. I don't think ignoring arguments is bad but it's not great.