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

Write lookup segments #25

Merged
merged 3 commits into from
Mar 28, 2019
Merged

Write lookup segments #25

merged 3 commits into from
Mar 28, 2019

Conversation

AlexeyRaga
Copy link
Collaborator

No description provided.

@AlexeyRaga AlexeyRaga force-pushed the write-lookup-segments branch from 67588d5 to a768469 Compare March 27, 2019 03:52
]

updateMap k c m =
maybe (c, c+1, Map.insert k c m) (, c, m) (Map.lookup k m)
Copy link
Collaborator

Choose a reason for hiding this comment

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

More type signatures please 😁

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What do you mean? Adding type signature for updateMap in where?
Do you think that (Num a, Ord k) => k -> a -> Map.Map k a -> (a, a, Map.Map k a) would help? :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Something like that. Although consider using type variables from lookupSegment with scoped type variables.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or names

word16LookupSegment name f = lookupSegment name f (Known F.Word16LE) BB.word16LE

-- | Creates a lookup segment where index keys are 'Word32'
-- Missing values are represented by 'maxValue :: Word32'
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be maxBound I think

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks!

@newhoggy
Copy link
Collaborator

👍

@AlexeyRaga AlexeyRaga force-pushed the write-lookup-segments branch from a768469 to 2f05bc7 Compare March 27, 2019 03:59
@AlexeyRaga AlexeyRaga merged commit 56b9b72 into master Mar 28, 2019
@AlexeyRaga AlexeyRaga deleted the write-lookup-segments branch March 28, 2019 03:34
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.

3 participants