interchangeable-0.1.0.0: A type class for interchangeable data.

Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Interchangeable

Synopsis

Documentation

class Interchangeable a b where Source

Minimal definition is (interchange, interchange') and (appendI, appendI') or (modifyI, modifyI').

Minimal complete definition

interchange, interchange'

Methods

interchange :: a -> b Source

Interchange a with b

interchange' :: b -> a Source

Interchange b with a

appendI :: a -> b -> b Source

Append a to b

appendI' :: b -> a -> a Source

Append b to a

modifyI :: a -> (b -> b) -> a Source

Modify a with an operation to b

modifyI' :: b -> (a -> a) -> b Source

Modify a with an operation to b

Instances

Interchangeable a b => Interchangeable b a 
Ord a => Interchangeable [a] (Set a) 
Ord k => Interchangeable [(k, a)] (Map k a)