ord-adhoc-0.0.0.1: Creating Ord instances instantly

MaintainerFumiaki Kinsohita <fumiexcel@gmail.com>
Safe HaskellSafe-Inferred

Data.Ord.Ala

Description

Creating Ord instance by a key function

Synopsis

Documentation

newtype Ala k a Source

Also known as store comonad

Constructors

Ala (a -> k, a) 

Instances

Eq k => Eq (Ala k a) 
Ord k => Ord (Ala k a) 

ordBy :: Ord k => (a -> k) -> a -> Ala k aSource

Make Ord instance from the key function.

unAla :: Ala k a -> aSource

Extract the original value from Ala.

keyAla :: Ala k a -> kSource

Extract the key from Ala.

mapAla :: (j -> k) -> Ala j a -> Ala k aSource