ku-fpg / hermit

Haskell Equational Reasoning Model-to-Implementation Tunnel
http://www.ittc.ku.edu/csdl/fpg/Tools/HERMIT
BSD 2-Clause "Simplified" License
49 stars 8 forks source link

Make HermitName from module and unqualified name strings #151

Closed conal closed 8 years ago

conal commented 8 years ago

I often have a module name and unqualified name as strings and want to combine them into a HermitName. I use the following utility:

moduledName :: String -> String -> HermitName
moduledName modName = fromString . (modName ++) . ('.' :)

I poked around in HERMIT.Name, where I see the following, which looks like what I want:

mkQualified :: String -> String -> HermitName
mkQualified mnm = HermitName (Just $ mkModuleName mnm) . mkFastString

This definition, however, is not exported. It seems a shame to use construct the qualified name string, just to use fromString (i.e., parseName) to pull it back apart. Is there another easy and fast way to get the equivalent of mkQualified? Alternatively, would there be any harm in exporting mkQualified and mkUnqualified?

xich commented 8 years ago

We should export it... the fact that it's not exported is an oversight.

conal commented 8 years ago

Done in 4b64081f1301f49f6375faec4381c0bb9a9955eb.