retroclash-lib-0.1.2.1: Code shared across the code samples in the book "Retrocomputing with Clash"
Safe HaskellNone
LanguageHaskell2010

RetroClash.Stack

Documentation

data Stack n a Source #

Constructors

Stack (Vec n a) (Index n) 

Instances

Instances details
Show a => Show (Stack n a) Source # 
Instance details

Defined in RetroClash.Stack

Methods

showsPrec :: Int -> Stack n a -> ShowS #

show :: Stack n a -> String #

showList :: [Stack n a] -> ShowS #

Generic (Stack n a) Source # 
Instance details

Defined in RetroClash.Stack

Associated Types

type Rep (Stack n a) :: Type -> Type #

Methods

from :: Stack n a -> Rep (Stack n a) x #

to :: Rep (Stack n a) x -> Stack n a #

(NFDataX a, KnownNat n) => NFDataX (Stack n a) Source # 
Instance details

Defined in RetroClash.Stack

Methods

deepErrorX :: String -> Stack n a #

hasUndefined :: Stack n a -> Bool #

ensureSpine :: Stack n a -> Stack n a #

rnfX :: Stack n a -> () #

type Rep (Stack n a) Source # 
Instance details

Defined in RetroClash.Stack

type Rep (Stack n a) = D1 ('MetaData "Stack" "RetroClash.Stack" "retroclash-lib-0.1.2.1-3QYYIIVHJO83EmrUE6AW6v" 'False) (C1 ('MetaCons "Stack" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vec n a)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Index n))))

push :: KnownNat n => a -> Stack n a -> Stack n a Source #

pop :: KnownNat n => Stack n a -> (a, Stack n a) Source #