DPutils-0.1.0.0: utilities for DP

Safe HaskellNone
LanguageHaskell2010

DP.Backtraced.Core

Description

The base constructors for generic backtracing.

NOTE this currently can capture dot-bracket notation, but not deep semantics.

Synopsis

Documentation

data Backtraced ty where Source #

This is a bit like a lazy Data.Sequence in terms of constructors. We can not be spine-strict, otherwise we'd use Data.Sequence and enjoy the better performance.

Constructors

Epsilon :: Backtraced ty

This backtrace is done

Cons :: ty -> Backtraced ty -> Backtraced ty

Expand a backtrace to the left. This is lazy, since backtracing relies on laziness.

Snoc :: Backtraced ty -> ty -> Backtraced ty

Expand lazily to the right.

Append :: Backtraced ty -> Backtraced ty -> Backtraced ty

concatenate two structures

Instances
Functor Backtraced Source # 
Instance details

Defined in DP.Backtraced.Core

Methods

fmap :: (a -> b) -> Backtraced a -> Backtraced b #

(<$) :: a -> Backtraced b -> Backtraced a #

Foldable Backtraced Source # 
Instance details

Defined in DP.Backtraced.Core

Methods

fold :: Monoid m => Backtraced m -> m #

foldMap :: Monoid m => (a -> m) -> Backtraced a -> m #

foldr :: (a -> b -> b) -> b -> Backtraced a -> b #

foldr' :: (a -> b -> b) -> b -> Backtraced a -> b #

foldl :: (b -> a -> b) -> b -> Backtraced a -> b #

foldl' :: (b -> a -> b) -> b -> Backtraced a -> b #

foldr1 :: (a -> a -> a) -> Backtraced a -> a #

foldl1 :: (a -> a -> a) -> Backtraced a -> a #

toList :: Backtraced a -> [a] #

null :: Backtraced a -> Bool #

length :: Backtraced a -> Int #

elem :: Eq a => a -> Backtraced a -> Bool #

maximum :: Ord a => Backtraced a -> a #

minimum :: Ord a => Backtraced a -> a #

sum :: Num a => Backtraced a -> a #

product :: Num a => Backtraced a -> a #

Traversable Backtraced Source # 
Instance details

Defined in DP.Backtraced.Core

Methods

traverse :: Applicative f => (a -> f b) -> Backtraced a -> f (Backtraced b) #

sequenceA :: Applicative f => Backtraced (f a) -> f (Backtraced a) #

mapM :: Monad m => (a -> m b) -> Backtraced a -> m (Backtraced b) #

sequence :: Monad m => Backtraced (m a) -> m (Backtraced a) #

Serial m a => Serial m (Backtraced a) Source # 
Instance details

Defined in DP.Backtraced.Core

Methods

series :: Series m (Backtraced a) #

Eq ty => Eq (Backtraced ty) Source # 
Instance details

Defined in DP.Backtraced.Core

Methods

(==) :: Backtraced ty -> Backtraced ty -> Bool #

(/=) :: Backtraced ty -> Backtraced ty -> Bool #

Ord ty => Ord (Backtraced ty) Source # 
Instance details

Defined in DP.Backtraced.Core

Methods

compare :: Backtraced ty -> Backtraced ty -> Ordering #

(<) :: Backtraced ty -> Backtraced ty -> Bool #

(<=) :: Backtraced ty -> Backtraced ty -> Bool #

(>) :: Backtraced ty -> Backtraced ty -> Bool #

(>=) :: Backtraced ty -> Backtraced ty -> Bool #

max :: Backtraced ty -> Backtraced ty -> Backtraced ty #

min :: Backtraced ty -> Backtraced ty -> Backtraced ty #

Read ty => Read (Backtraced ty) Source # 
Instance details

Defined in DP.Backtraced.Core

Show ty => Show (Backtraced ty) Source # 
Instance details

Defined in DP.Backtraced.Core

Methods

showsPrec :: Int -> Backtraced ty -> ShowS #

show :: Backtraced ty -> String #

showList :: [Backtraced ty] -> ShowS #

Generic (Backtraced ty) Source # 
Instance details

Defined in DP.Backtraced.Core

Associated Types

type Rep (Backtraced ty) :: Type -> Type #

Methods

from :: Backtraced ty -> Rep (Backtraced ty) x #

to :: Rep (Backtraced ty) x -> Backtraced ty #

Cons (Backtraced ty) (Backtraced ty') ty ty' Source #

This is somewhat tricky, since we might have to walk down the structure quite a bit and shuffle constructors without changing the actual leaf order.

Instance details

Defined in DP.Backtraced.Core

Methods

_Cons :: Prism (Backtraced ty) (Backtraced ty') (ty, Backtraced ty) (ty', Backtraced ty') #

Snoc (Backtraced ty) (Backtraced ty') ty ty' Source # 
Instance details

Defined in DP.Backtraced.Core

Methods

_Snoc :: Prism (Backtraced ty) (Backtraced ty') (Backtraced ty, ty) (Backtraced ty', ty') #

type Rep (Backtraced ty) Source # 
Instance details

Defined in DP.Backtraced.Core

(<|) :: ty -> Backtraced ty -> Backtraced ty infixr 5 Source #

(|>) :: Backtraced ty -> ty -> Backtraced ty infixl 5 Source #

(><) :: Backtraced ty -> Backtraced ty -> Backtraced ty infixr 5 Source #