Skip to main content

Module traits

Module traits 

Source
Expand description

This module contains the traits for the IOPattern type, along with the implementation of type-level operations checking on their correct usage. The IOPattern type is a type-level HList of IOWords, which are either Absorb or Squeeze. The main operations are Normalize, which merges successive words of the same type, and Consume, which takes a word and an IOPattern, and checks whether it is legal to use the operation of this word on the tip of the IOPattern. This is explained in more detail in the spec document.

Re-exports§

pub use typenum;

Structs§

Absorb
The type-level Absorb operation
Cons
The concrete type constructor for our HList trait
Nil
The concrete type for our empty HList representant
Squeeze
The type-level Squeeze operation

Traits§

Consume
Emptying an IOPattern using an IOWord. This assumes that it is working with a list in head-normal form (i.e. the first element cannot be merged with the immediately following list). All lists that have been normalized are in head-normal form.
IOWord
Our trait for common treatment of both patterns
List
Type-level HList, specialized to IOWord using a sealed trait See e.g. <https://hackage.haskell.org/package/heterolist> (or frunk) for what a HList is.
Normalize
Normalizing an IOPattern with merge operations applied recursively

Type Aliases§

Norm
Convenience trait for projection of Normalize
Use
Convenience trait for projection of Consume