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.Graph

Description

Random graph generation examples.

Synopsis

Documentation

type Graph = [(Vertex, Edges)] Source

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

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

sumEdgesPut :: PutlensM (ReaderT [Vertex] (MaybeT Gen)) [Int] Int Source

Updates the sum of a list (distributes the difference by dividing it by the length of the original list, always preserving the size of the original list even when the view is zero) the source always contains positive numbers