cabal-version: 1.12 -- This file has been generated from package.yaml by hpack version 0.31.0. -- -- see: https://github.com/sol/hpack -- -- hash: 724ed4284796e6183f3e0d1d8985319bbd1d4aabedf6dbbf827b5973f884b38e name: once version: 0.4 synopsis: memoization for IO actions and functions description: Package provides single polymorphic function 'once', that allows you to memoize IO actions and functions, evaluating them at most once. . >>> let mkStamp = (putStrLn "stamping" >> writeFile "/tmp/stamp" "") :: IO () >>> -- onceStamp :: IO () >>> onceStamp <- once mkStamp >>> -- onceStamp actually evaluates mkStamp it wraps first time. >>> onceStamp stamping >>> -- but second time result `()' is memoized, no action is performed. >>> onceStamp >>> -- we can memoize functions too >>> foo <- once $ \x -> print "foo" >> print (x :: Int) >>> -- action will be performed once for every distinct argument >>> foo 10 foo 10 >>> foo 10 10 >>> foo 4 foo 4 category: Data homepage: https://gitlab.com/kaction/haskell-once author: Dmitry Bogatov maintainer: KAction@debian.org copyright: 2015-2018 Dmitry Bogatov license: GPL-3 license-file: LICENSE build-type: Simple source-repository head type: git location: https://gitlab.com/kaction/haskell-once library exposed-modules: Control.Once other-modules: Control.Once.Class Control.Once.Internal Control.Once.TH Paths_once hs-source-dirs: src build-depends: base >=4.7 && <5 , containers >=0.5 , hashable >=1.2 , template-haskell >=2.10 , unordered-containers >=0.2 default-language: Haskell2010 test-suite spec type: exitcode-stdio-1.0 main-is: Spec.hs other-modules: Paths_once hs-source-dirs: test ghc-options: -threaded -rtsopts build-depends: HUnit , async , base >=4.7 && <5 , containers >=0.5 , hashable >=1.2 , hspec , once , template-haskell >=2.10 , unordered-containers >=0.2 build-tool-depends: hspec-discover:hspec-discover default-language: Haskell2010