Portability | unportable |
---|---|
Stability | unstable |
Maintainer | Martin Avanzini <martin.avanzini@uibk.ac.at> |
Safe Haskell | None |
Tct.Processor.Args.Instances
Contents
Description
This module defines various instances of processor arguments.
- data Proc a = Proc a
- type Processor = Proc AnyProcessor
- newtype Assoc a = Assoc a
- class AssocArgument a where
- newtype EnumOf a = EnumOf a
- newtype Nat = Nat Int
- nat :: Int -> Nat
- natToInt :: Nat -> Int
- naturalArg :: Arg Nat
- boolArg :: Arg Bool
- maybeArg :: Arg a -> Arg (Maybe a)
- listArg :: Arg a -> Arg [a]
- processorArg :: Arg Processor
- type EnumArg a = Arg (EnumOf a)
- type AssocArg a = Arg (Assoc a)
Documentation
type Processor = Proc AnyProcessor
newtype Assoc a
Constructors
Assoc a |
Instances
(Show a, AssocArgument a) => ParsableArgument (Assoc a) | |
(Show a, AssocArgument a) => Argument (Assoc a) |
class AssocArgument a where
Instances of this class can be parsed by means of the
defined method assoc
.
newtype Nat
Constructors for Arguments
naturalArg :: Arg Nat
Natural argument
Processor argument
type AssocArg a = Arg (Assoc a)
Construct an argument from an associated list, by declaring
a datatype an instance of AssocArgument
.
Use as follows:
>>>
instance AssocArgument MyType where
assoc _ = [("nameA", valueA), ("nameB", valueB)...]
Then one can use a declaration
>>>
arg :: AssocArg MyType
which will parse valueA as nameA, valueB as nameB, and so on.