ema-0.10.0.0: Static site generator library with hot reload
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ema.Route.Prism.Type

Synopsis

Documentation

type Prism_ s a = (a -> s, s -> Maybe a) Source #

Isomorphic to Prism' s a, but coercion-friendly.

Use fromPrism_ and toPrism_ to convert between the optics Prism' and this Prism_.

fromPrism_ :: Prism_ s a -> Prism' s a Source #

Convert a Prism_ to a Prism'.

toPrism_ :: Prism' s a -> Prism_ s a Source #

Convert a Prism' to a Prism_.

mapRoutePrism Source #

Arguments

:: (pr `Is` A_Prism, pf `Is` A_Prism) 
=> Optic' pf NoIx FilePath FilePath

How to transform the encoded FilePath

-> Optic' pr NoIx r1 r2

How to transform the decode route

-> (b -> a)

How to transform (contramap) the resultant model

-> (a -> Prism_ FilePath r1)

The route prism to fmap.

-> b -> Prism_ FilePath r2 

map over the filepath, route and model of the given route prism.