MyFreeMonad
type ArithM = Free ArithF Source #
The free monad for the arithmetic language.
data ArithF x Source #
The functor for the arithmetic language.
Constructors
Defined in MyFreeMonad
Methods
fmap :: (a -> b) -> ArithF a -> ArithF b #
(<$) :: a -> ArithF b -> ArithF a #
showsPrec :: Int -> ArithF x -> ShowS #
show :: ArithF x -> String #
showList :: [ArithF x] -> ShowS #
addA :: Int -> ArithM () Source #
subA :: Int -> ArithM () Source #
mulA :: Int -> ArithM () Source #
divA :: Int -> ArithM () Source #
evalArith :: Free ArithF Int -> Int Source #
Evaluate an arithmetic expression.
example :: Int -> ArithM Int Source #
exampleDo :: Int -> ArithM Int Source #