Open treeowl opened 8 years ago
If you'd prefer to delay the conversion, which seems somewhat less peculiar than delaying the lookup, that would be
lookup (Config root BaseConfig{..}) name = do
mp <- readIORef cfgMap
let result = H.lookup (root `T.append` name) mp
evaluate result
return (convert =<< result)
Currently,
I'd have expected
lookup
is also a bit weird:There's no obvious reason to delay the
lookup
to the use site (which keeps the entireHashMap
live). Why not use something like this?