advent-0.1.0.0: Advent of Code common library
Copyright(c) Eric Mertens 2021
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Advent.Fix

Description

 
Synopsis

Documentation

newtype Fix (f :: Type -> Type) Source #

Fixed-point of a type

Constructors

Fix 

Fields

Instances

Instances details
Show1 f => Show (Fix f) Source # 
Instance details

Defined in Advent.Fix

Methods

showsPrec :: Int -> Fix f -> ShowS #

show :: Fix f -> String #

showList :: [Fix f] -> ShowS #

cata :: Functor t => (t a -> a) -> Fix t -> a Source #

Generic fold

cataM :: (Monad m, Traversable t) => (t a -> m a) -> Fix t -> m a Source #

Generic monadic fold

ana :: Functor f => (a -> f a) -> a -> Fix f Source #

Generic unfold

anaFromMap Source #

Arguments

:: (Ord k, Functor f) 
=> Map k (f k)

entries by name

-> k

root name

-> Fix f

root node with keys recursively resolved

Convert a map of values parameterized by names into a recursively defined datatype.