hnix-0.5.1: Haskell implementation of the Nix language

Safe HaskellNone
LanguageHaskell2010

Nix.Utils

Synopsis

Documentation

trace :: String -> a -> a Source #

traceM :: Monad m => String -> m () Source #

type DList a = Endo [a] Source #

type Alg f a = f a -> a Source #

An f-algebra defines how to reduced the fixed-point of a functor to a value.

type AlgM f m a = f a -> m a Source #

type Transform f a = (Fix f -> a) -> Fix f -> a Source #

An "transform" here is a modification of a catamorphism.

(<&>) :: Functor f => f a -> (a -> c) -> f c Source #

(??) :: Functor f => f (a -> b) -> a -> f b Source #

loeb :: Functor f => f (f a -> a) -> f a Source #

loebM :: (MonadFix m, Traversable t) => t (t a -> m a) -> m (t a) Source #

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

paraM :: (Traversable f, Monad m) => (f (Fix f, a) -> m a) -> Fix f -> m a Source #

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

cataPM :: (Traversable f, Monad m) => (Fix f -> f a -> m a) -> Fix f -> m a Source #

transport :: Functor g => (forall x. f x -> g x) -> Fix f -> Fix g Source #

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

adi is Abstracting Definitional Interpreters:

https://arxiv.org/abs/1707.04755

Essentially, it does for evaluation what recursion schemes do for representation: allows threading layers through existing structure, only in this case through behavior.

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

class Has a b where Source #

Minimal complete definition

hasLens

Methods

hasLens :: Lens' a b Source #

Instances

Has a a Source # 

Methods

hasLens :: Lens' a a Source #

Has (a, b) b Source # 

Methods

hasLens :: Lens' (a, b) b Source #

Has (a, b) a Source # 

Methods

hasLens :: Lens' (a, b) a Source #

Has (Context m v) Options Source # 
Has (Context m v) Frames Source # 
Has (Context m v) SrcSpan Source # 
Has (Context m v) (Scopes m v) Source # 

Methods

hasLens :: Lens' (Context m v) (Scopes m v) Source #