putlenses-0.1.3: Put-based lens library

Copyright(C) 2014 Hugo Pacheco
LicenseBSD-style (see the file LICENSE)
MaintainerHugo Pacheco <hpacheco@nii.ac.jp>
Stabilityprovisional
Safe HaskellNone
LanguageHaskell98

Generics.Putlenses.Examples.Color

Contents

Description

Graph coloring examples.

Synopsis

Colored graphs and utility functions

data Color Source

Constructors

Red 
Yellow 
Green 
Blue 

Instances

type Graph = [(Vertex, Edges)] Source

genColors :: MonadPlus m => (Color -> Bool) -> [Color] -> m Color Source

genGraph' :: [Int] -> [(Int, Int)] -> Graph Source

genEdges :: [Int] -> Int -> Gen [(Int, Int)] Source

Lenses

colorPut :: MonadPlus m => PutlensM m ColoredGraph Graph Source

Putlens that colors a graph in the backward direction

colorPutNaive :: MonadPlus m => PutlensM m ColoredGraph Graph Source

Putlens that colors a graph in the backward direction (slow version)