hakyll-4.9.8.0: A static website compiler library

Safe Haskell | Safe
Language | Haskell98

Hakyll.Core.Store

Description

A store for storing and retreiving items

Synopsis

- data Store
- data Result a
  - = Found a
  - | NotFound
  - | WrongType TypeRep TypeRep
- toMaybe :: Result a -> Maybe a
- new :: Bool -> FilePath -> IO Store
- set :: (Binary a, Typeable a) => Store -> [String] -> a -> IO ()
- get :: (Binary a, Typeable a) => Store -> [String] -> IO (Result a)
- isMember :: Store -> [String] -> IO Bool
- delete :: Store -> [String] -> IO ()
- hash :: [String] -> String

# Documentation

data Store #

Instances

Show Store # |
Methods showsPrec :: Int -> Store -> ShowS # show :: Store -> String # showList :: [Store] -> ShowS #

data Result a #

Result of a store query

Constructors

Found a | Found, result
NotFound | Not found
WrongType TypeRep TypeRep | Expected, true type

Instances

Eq a => Eq (Result a) # |
Methods (==) :: Result a -> Result a -> Bool # (/=) :: Result a -> Result a -> Bool #
Show a => Show (Result a) # |
Methods showsPrec :: Int -> Result a -> ShowS # show :: Result a -> String # showList :: [Result a] -> ShowS #

toMaybe :: Result a -> Maybe a #

Convert result to `Maybe`

new #

Arguments

:: Bool | Use in-memory caching
-> FilePath | Directory to use for hard disk storage
-> IO Store | Store

Initialize the store

set :: (Binary a, Typeable a) => Store -> [String] -> a -> IO () #

Store an item

get :: (Binary a, Typeable a) => Store -> [String] -> IO (Result a) #

Load an item

isMember :: Store -> [String] -> IO Bool #

Strict function

delete :: Store -> [String] -> IO () #

Delete an item

hash :: [String] -> String #

Mostly meant for internal usage