Conversation
Co-authored-by: Simon Jakobi <simon.jakobi@gmail.com>
|
I've made
The Core size for these functions is pretty huge though: There are still a few things to improve though. |
|
Core sizes at 50e2490:
|
|
Large. Probably not something we'd want to newtype Maybe# a = Maybe# (# (##) | a
#)
pattern Just# :: a -> Maybe# a
pattern Just# a = Maybe# (# | a #)
pattern Nothing# :: Maybe# a
pattern Nothing# = Maybe# (# (##) | #)
{-# COMPLETE Nothing#, Just# #-}
toMaybe :: Maybe# a -> Maybe a
fromMaybe :: Maybe a -> Maybe# a
alter f = alter# $ \m# -> fromMaybe (f (toMaybe m#))
alter# :: (Hashable k, Eq k) => (Maybe# a -> Maybe# a) -> HashMap k a -> k -> HashMap k aIn the (I believe typical) case that the passed function is known, small, and non-recursive, GHC will inline it into the function passed to |
|
At the current state of this branch, the I guess this |
Exactly. |
This is a continuation of @oberblastmeister's work done in #471.
Resolves #392.
TODO:
MaybesCollision-handling code out of line