brainheck-0.1.0.6: Brainh*ck interpreter in haskell

Safe HaskellNone
LanguageHaskell2010

Brainheck

Contents

Description

Module with parser etc.

Synopsis

Documentation

run :: Syntax Char -> IO () Source #

Evaluate syntax tree

parseBrainheck :: FilePath -> Text -> Either (ParseError (Token Text) Void) (Syntax Char) Source #

Parse and return an error or a syntax tree

Types

data Syntax a Source #

Syntax tree for brainfuck

Constructors

Loop (Syntax a) 
Seq [Syntax a] 
Token a 

Instances

Show a => Show (Syntax a) Source # 

Methods

showsPrec :: Int -> Syntax a -> ShowS #

show :: Syntax a -> String #

showList :: [Syntax a] -> ShowS #

Recursive (Syntax a0) Source # 

Methods

project :: Syntax a0 -> Base (Syntax a0) (Syntax a0) #

cata :: (Base (Syntax a0) a -> a) -> Syntax a0 -> a #

para :: (Base (Syntax a0) (Syntax a0, a) -> a) -> Syntax a0 -> a #

gpara :: (Corecursive (Syntax a0), Comonad w) => (forall b. Base (Syntax a0) (w b) -> w (Base (Syntax a0) b)) -> (Base (Syntax a0) (EnvT (Syntax a0) w a) -> a) -> Syntax a0 -> a #

prepro :: Corecursive (Syntax a0) => (forall b. Base (Syntax a0) b -> Base (Syntax a0) b) -> (Base (Syntax a0) a -> a) -> Syntax a0 -> a #

gprepro :: (Corecursive (Syntax a0), Comonad w) => (forall b. Base (Syntax a0) (w b) -> w (Base (Syntax a0) b)) -> (forall c. Base (Syntax a0) c -> Base (Syntax a0) c) -> (Base (Syntax a0) (w a) -> a) -> Syntax a0 -> a #

Corecursive (Syntax a0) Source # 

Methods

embed :: Base (Syntax a0) (Syntax a0) -> Syntax a0 #

ana :: (a -> Base (Syntax a0) a) -> a -> Syntax a0 #

apo :: (a -> Base (Syntax a0) (Either (Syntax a0) a)) -> a -> Syntax a0 #

postpro :: Recursive (Syntax a0) => (forall b. Base (Syntax a0) b -> Base (Syntax a0) b) -> (a -> Base (Syntax a0) a) -> a -> Syntax a0 #

gpostpro :: (Recursive (Syntax a0), Monad m) => (forall b. m (Base (Syntax a0) b) -> Base (Syntax a0) (m b)) -> (forall c. Base (Syntax a0) c -> Base (Syntax a0) c) -> (a -> Base (Syntax a0) (m a)) -> a -> Syntax a0 #

type Base (Syntax a0) Source # 
type Base (Syntax a0)