| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Graphics.Implicit.ExtOpenScad.Definitions
Synopsis
- data ArgParser a
- newtype Symbol = Symbol Text
- data Pattern
- data Expr
- data StatementI = StatementI SourcePosition (Statement StatementI)
- data Statement st
- data OVal
- = OUndefined
- | OError Text
- | OBool Bool
- | ONum ℝ
- | OList [OVal]
- | OString Text
- | OFunc (OVal -> OVal)
- | OIO (IO OVal)
- | OUModule Symbol (Maybe [(Symbol, Bool)]) (VarLookup -> ArgParser (StateC [OVal]))
- | ONModule Symbol (SourcePosition -> [OVal] -> ArgParser (StateC [OVal])) [([(Symbol, Bool)], Maybe Bool)]
- | OVargsModule Symbol (Symbol -> SourcePosition -> [(Maybe Symbol, OVal)] -> [StatementI] -> ([StatementI] -> StateC ()) -> StateC ())
- | OObj3 SymbolicObj3
- | OObj2 SymbolicObj2
- newtype TestInvariant = EulerCharacteristic ℕ
- data SourcePosition = SourcePosition Fastℕ Fastℕ FilePath
- type StateC a = ImplicitCadM ScadOpts [Message] CompState IO a
- data CompState = CompState {}
- newtype ImplicitCadM r w s m a = ImplicitCadM {
- unImplicitCadM :: ReaderT r (WriterT w (StateT s m)) a
- newtype VarLookup = VarLookup (Map Symbol OVal)
- data Message = Message MessageType SourcePosition Text
- data MessageType
- data ScadOpts = ScadOpts {}
- lookupVarIn :: Text -> VarLookup -> Maybe OVal
- varUnion :: VarLookup -> VarLookup -> VarLookup
- runImplicitCadM :: Monad m => r -> s -> ImplicitCadM r w s m a -> m (a, w, s)
- type CanCompState m = CanCompState' ScadOpts [Message] CompState m
- type CanCompState' r w s m = (MonadReader r m, MonadWriter w m, MonadState s m, MonadIO m)
Documentation
Handles parsing arguments to built-in modules
Constructors
| AP Symbol (Maybe OVal) Text (OVal -> ArgParser a) | For actual argument entries: |
| APTerminator a | For returns: |
| APFail Text | For failure: |
| APExample Text (ArgParser a) | An example, then next |
| APTest Text [TestInvariant] (ArgParser a) | A string to run as a test, then invariants for the results, then next |
| APBranch [ArgParser a] | A branch where there are a number of possibilities for the parser underneath |
data StatementI Source #
A statement, along with the line, column number, and file it is found at.
Constructors
| StatementI SourcePosition (Statement StatementI) |
Instances
| Show StatementI Source # | |
Defined in Graphics.Implicit.ExtOpenScad.Definitions Methods showsPrec :: Int -> StatementI -> ShowS # show :: StatementI -> String # showList :: [StatementI] -> ShowS # | |
| Eq StatementI Source # | |
Defined in Graphics.Implicit.ExtOpenScad.Definitions | |
Constructors
| Include Text Bool | |
| Pattern := Expr | |
| If Expr [st] [st] | |
| NewModule Symbol [(Symbol, Maybe Expr)] [st] | |
| ModuleCall Symbol [(Maybe Symbol, Expr)] [st] | |
| DoNothing |
Objects for our OpenSCAD-like language
Constructors
| OUndefined | |
| OError Text | |
| OBool Bool | |
| ONum ℝ | |
| OList [OVal] | |
| OString Text | |
| OFunc (OVal -> OVal) | |
| OIO (IO OVal) | |
| OUModule Symbol (Maybe [(Symbol, Bool)]) (VarLookup -> ArgParser (StateC [OVal])) | |
| ONModule Symbol (SourcePosition -> [OVal] -> ArgParser (StateC [OVal])) [([(Symbol, Bool)], Maybe Bool)] | |
| OVargsModule Symbol (Symbol -> SourcePosition -> [(Maybe Symbol, OVal)] -> [StatementI] -> ([StatementI] -> StateC ()) -> StateC ()) | |
| OObj3 SymbolicObj3 | |
| OObj2 SymbolicObj2 |
newtype TestInvariant Source #
Constructors
| EulerCharacteristic ℕ |
Instances
| Show TestInvariant Source # | |
Defined in Graphics.Implicit.ExtOpenScad.Definitions Methods showsPrec :: Int -> TestInvariant -> ShowS # show :: TestInvariant -> String # showList :: [TestInvariant] -> ShowS # | |
data SourcePosition Source #
In order to not propagate Parsec or other modules around, create our own source position type for the AST.
Constructors
| SourcePosition Fastℕ Fastℕ FilePath |
Instances
| Show SourcePosition Source # | |
Defined in Graphics.Implicit.ExtOpenScad.Definitions Methods showsPrec :: Int -> SourcePosition -> ShowS # show :: SourcePosition -> String # showList :: [SourcePosition] -> ShowS # | |
| Eq SourcePosition Source # | |
Defined in Graphics.Implicit.ExtOpenScad.Definitions Methods (==) :: SourcePosition -> SourcePosition -> Bool # (/=) :: SourcePosition -> SourcePosition -> Bool # | |
The state of computation.
Constructors
| CompState | |
newtype ImplicitCadM r w s m a Source #
Constructors
| ImplicitCadM | |
Fields
| |
Instances
An individual message.
Constructors
| Message MessageType SourcePosition Text |
data MessageType Source #
The types of messages the execution engine can send back to the application.
Constructors
| TextOut | |
| Warning | |
| Error | |
| SyntaxError | |
| Compatibility | |
| Unimplemented |
Instances
| Show MessageType Source # | |
Defined in Graphics.Implicit.ExtOpenScad.Definitions Methods showsPrec :: Int -> MessageType -> ShowS # show :: MessageType -> String # showList :: [MessageType] -> ShowS # | |
| Eq MessageType Source # | |
Defined in Graphics.Implicit.ExtOpenScad.Definitions | |
Options changing the behavior of the extended OpenScad engine.
Constructors
| ScadOpts | |
Fields | |
lookupVarIn :: Text -> VarLookup -> Maybe OVal Source #
For programs using this API to perform variable lookups, after execution of an escad has completed.
runImplicitCadM :: Monad m => r -> s -> ImplicitCadM r w s m a -> m (a, w, s) Source #
type CanCompState m = CanCompState' ScadOpts [Message] CompState m Source #
type CanCompState' r w s m = (MonadReader r m, MonadWriter w m, MonadState s m, MonadIO m) Source #