Safe Haskell | None |
---|---|
Language | Haskell2010 |
Naive implementation of data-prism approach.
- data Prism object field = Prism {}
- match :: Prism AnyValue a -> Value t -> Maybe a
- mkAnyValuePrism :: (forall t. Value t -> Maybe a) -> (a -> Value tag) -> Prism AnyValue a
- _Bool :: Prism AnyValue Bool
- _Integer :: Prism AnyValue Integer
- _Double :: Prism AnyValue Double
- _Text :: Prism AnyValue Text
- _Array :: Prism AnyValue a -> Prism AnyValue [a]
- unsafeArray :: [AnyValue] -> Value TArray
Prism idea
data Prism object field Source #
Implementation of prism idea using simple data prism approach. Single value
of type Prism
has two capabilities:
mkAnyValuePrism :: (forall t. Value t -> Maybe a) -> (a -> Value tag) -> Prism AnyValue a Source #
Creates prism for AnyValue
.