Skip to content

empty is badly broken #24

@treeowl

Description

@treeowl

empty is defined as

-- | A completely empty configuration.
empty :: Config
empty = Config "" $ unsafePerformIO $ do
          p <- newIORef []
          m <- newIORef H.empty
          s <- newIORef H.empty
          return BaseConfig {
                       cfgAuto = Nothing
                     , cfgPaths = p
                     , cfgMap = m
                     , cfgSubs = s
                     }
{-# NOINLINE empty #-}

If I let myEmpty = empty, and then apply something like addToConfig to myEmpty, suddenly myEmpty and empty are no longer equivalent. I believe the only sane thing to do is to remove empty altogether, replacing it with mkEmpty :: IO Config.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions