1
1
mirror of https://github.com/github/semantic.git synced 2024-12-21 22:01:46 +03:00

Define unModuleTable as a function rather than a selector.

This commit is contained in:
Rob Rix 2018-05-11 09:08:01 -04:00
parent 24778e808f
commit 17c6a5be85

View File

@ -21,9 +21,12 @@ import System.FilePath.Posix
import GHC.Generics (Generic1)
import Prelude hiding (lookup)
newtype ModuleTable a = ModuleTable { unModuleTable :: Map.Map ModulePath a }
newtype ModuleTable a = ModuleTable (Map.Map ModulePath a)
deriving (Eq, Foldable, Functor, Generic1, Lower, Monoid, Ord, Semigroup, Show, Traversable)
unModuleTable :: ModuleTable a -> Map.Map ModulePath a
unModuleTable (ModuleTable table) = table
singleton :: ModulePath -> a -> ModuleTable a
singleton name = ModuleTable . Map.singleton name