HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulesyb-0.7.3Haskell98

Data.Generics.Schemes

"Scrap your boilerplate" --- Generic programming in Haskell See http://www.cs.uu.nl/wiki/GenericProgramming/SYB. The present module provides frequently used generic traversal schemes.

  • 18 values
  • Packagesyb-0.7.3
  • Exports18
  • LanguageHaskell98
  • LicenceBSD-3-Clause
  • SourceSchemes.hs
valueeverywhere :: (forall a. Data a => a -> a) -> forall a. Data a => a -> a
#

Apply a transformation everywhere in bottom-up manner

valueeverywhere' :: (forall a. Data a => a -> a) -> forall a. Data a => a -> a
#

Apply a transformation everywhere in top-down manner

valueeverythingWithContext
  1. :: s
  2. -> r -> r -> r
  3. -> GenericQ (s -> (r, s))
  4. -> GenericQ r
#

Summarise all nodes in top-down, left-to-right order, carrying some state down the tree during the computation, but not left-to-right to siblings.

valuesynthesize :: s -> (t -> s -> s) -> GenericQ (s -> t) -> GenericQ t
#

Bottom-up synthesis of a data structure; 1st argument z is the initial element for the synthesis; 2nd argument o is for reduction of results from subterms; 3rd argument f updates the synthesised data according to the given term

valuegsize :: Data a => a -> Int
#

Compute size of an arbitrary data structure