[Haskell-beginners] hidden package error when using Snap

Todd Porter contact at oddity.net.au
Sun May 15 07:24:12 CEST 2011


Hi,

I am using the parseTime function from Data.Time.Format. The first parameter is a TimeLocale defined in System.Locale (old-locale-1.0.0.2).

I first wrote a trivial little module to test my understanding in ghci:

module Tbasic where

import Data.Time
import System.Locale

parseDate :: String -> Maybe UTCTime
parseDate s = parseTime defaultTimeLocale "%d/%m/%Y" s

Works fine.

I then tried using this same function in my Snap web application. The application builds (via cabal install) fine. However when I start up the application and make my first request I get the following error:

A web handler threw an exception. Details:
Compile errors:

Could not find module `System.Locale':
  It is a member of the hidden package `old-locale-1.0.0.2'.
  Use -v to see a list of the files searched for.

I have added old-locale to Build-depends in the applications .cabal file.

old-locale-1.0.0.2 appears in the global list of packages when I run ghc-pkg list

Unsure what to try next. To be honest I don't understand a compile error at runtime given I didn't activate dynamic recompilation (i.e. I last built using cabal install, not cabal install -fdevelopment).

appreciate any advice, Todd


More information about the Beginners mailing list