-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
67588d5
to
a768469
Compare
] | ||
|
||
updateMap k c m = | ||
maybe (c, c+1, Map.insert k c m) (, c, m) (Map.lookup k m) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More type signatures please 😁
There was a problem hiding this comment.
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? :)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or names
src/Arbor/File/Format/Asif/Write.hs
Outdated
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' |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
👍 |
a768469
to
2f05bc7
Compare
No description provided.