| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Autolib.Symbol
Contents
Synopsis
- class (Size s, Hash s, Eq s, Ord s, ToDoc s, Show s, Reader s) => Symbol s where
- arity :: s -> Int
- set_arity :: Int -> s -> s
- precedence :: s -> Maybe Int
- assoc :: s -> Assoc
- pool :: [s]
- symbol_toDoc :: s -> Doc
- symbol_reader :: Parser s
- stringify :: [s] -> String
- toDoc_list :: [s] -> Doc
- unused :: Symbol s => Int -> Set s -> [s]
- is_operator :: Symbol s => s -> Bool
- is_binary_operator :: Symbol s => s -> Bool
- is_unary_operator :: Symbol s => s -> Bool
- is_constant :: Symbol s => s -> Bool
Documentation
class (Size s, Hash s, Eq s, Ord s, ToDoc s, Show s, Reader s) => Symbol s where Source #
Minimal complete definition
Nothing
Methods
set_arity :: Int -> s -> s Source #
precedence :: s -> Maybe Int Source #
default: not as operator, i. e. prefix notation with parentheses
if Just p, then for binary ops: use infix notation;
for unary ops, use prefix notation without parentheses
(allows "! ! x")
symbol_toDoc :: s -> Doc Source #
symbol_reader :: Parser s Source #
stringify :: [s] -> String Source #
use to create a directory name
toDoc_list :: [s] -> Doc Source #
used for SRS output
Instances
| Symbol () Source # | |
Defined in Autolib.Symbol | |
| Symbol Bool Source # | |
| Symbol Char Source # | |
| Symbol Int Source # | |
| (Symbol a, Symbol b) => Symbol (a, b) Source # | |
Defined in Autolib.Symbol Methods arity :: (a, b) -> Int Source # set_arity :: Int -> (a, b) -> (a, b) Source # precedence :: (a, b) -> Maybe Int Source # assoc :: (a, b) -> Assoc Source # symbol_toDoc :: (a, b) -> Doc Source # symbol_reader :: Parser (a, b) Source # stringify :: [(a, b)] -> String Source # toDoc_list :: [(a, b)] -> Doc Source # | |
is_operator :: Symbol s => s -> Bool Source #
unary: omit parens around argument binary: use infix notation
is_binary_operator :: Symbol s => s -> Bool Source #
is_unary_operator :: Symbol s => s -> Bool Source #
is_constant :: Symbol s => s -> Bool Source #