darcs-2.14.1: a distributed, interactive, smart revision control system

Safe HaskellSafe
LanguageHaskell2010

Darcs.UI.Options.Iso

Contents

Synopsis

Isomorphisms

data Iso a b Source #

Lightweight type ismomorphisms (a.k.a. invertible functions). If

Iso fw bw :: Iso a b

then fw and bw are supposed to satisfy

fw . bw = id = bw . fw

Constructors

Iso (a -> b) (b -> a) 

class IsoFunctor f where Source #

Lift an isomorphism between a and b to one between f a and f b. Like Functor, except we can only map invertible functions (i.e. an Isomorphisms).

Minimal complete definition

imap

Methods

imap :: Iso a b -> f a -> f b Source #

Instances

IsoFunctor (RawOptSpec f) Source # 

Methods

imap :: Iso a b -> RawOptSpec f a -> RawOptSpec f b Source #

IsoFunctor (OptSpec d f a) Source # 

Methods

imap :: Iso a b -> OptSpec d f a a -> OptSpec d f a b Source #

under :: Functor f => Iso a b -> Iso (f a) (f b) Source #

Apply an iso under a functor.

cps :: Iso a b -> Iso (a -> c) (b -> c) Source #

Apply an iso under cps (which is a cofunctor).