1-- | A module containing a box datatype representing a compiled item. This
2-- item can be of any type, given that a few restrictions hold (e.g. we want
3-- a 'Typeable' instance to perform type-safe casts).
5{-# LANGUAGE ExistentialQuantification #-}
6module Hakyll.Core.CompiledItem
12import Data.Binary (Binary)
13import Data.Typeable (Typeable, cast)
15import Hakyll.Core.Writable
17-- | Box type for a compiled item
19data CompiledItem = forall a. (Binary a, Typeable a, Writable a)
22instance Writable CompiledItem where
23 write p (CompiledItem x) = write p x
25-- | Box a value into a 'CompiledItem'
27compiledItem :: (Binary a, Typeable a, Writable a)
30compiledItem = CompiledItem
32-- | Unbox a value from a 'CompiledItem'
34unCompiledItem :: (Binary a, Typeable a, Writable a)
37unCompiledItem (CompiledItem x) = case cast x of
39 Nothing -> error "unCompiledItem: Unsupported type"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list