Safe Haskell | None |
---|
This module contains type definitions of Egison Data.
- data EgisonTopExpr
- = Define String EgisonExpr
- | Test EgisonExpr
- | Execute EgisonExpr
- | LoadFile String
- | Load String
- data EgisonExpr
- = CharExpr Char
- | StringExpr String
- | BoolExpr Bool
- | RationalExpr Rational
- | IntegerExpr Integer
- | FloatExpr Double
- | VarExpr String
- | IndexedExpr EgisonExpr [EgisonExpr]
- | InductiveDataExpr String [EgisonExpr]
- | TupleExpr [EgisonExpr]
- | CollectionExpr [InnerExpr]
- | ArrayExpr [EgisonExpr]
- | HashExpr [(EgisonExpr, EgisonExpr)]
- | LambdaExpr [String] EgisonExpr
- | PatternFunctionExpr [String] EgisonPattern
- | IfExpr EgisonExpr EgisonExpr EgisonExpr
- | LetExpr [BindingExpr] EgisonExpr
- | LetRecExpr [BindingExpr] EgisonExpr
- | MatchExpr EgisonExpr EgisonExpr [MatchClause]
- | MatchAllExpr EgisonExpr EgisonExpr MatchClause
- | MatchLambdaExpr EgisonExpr [MatchClause]
- | MatchAllLambdaExpr EgisonExpr MatchClause
- | NextMatchExpr EgisonExpr EgisonExpr [MatchClause]
- | NextMatchAllExpr EgisonExpr EgisonExpr MatchClause
- | NextMatchLambdaExpr EgisonExpr [MatchClause]
- | NextMatchAllLambdaExpr EgisonExpr MatchClause
- | MatcherBFSExpr MatcherInfo
- | MatcherDFSExpr MatcherInfo
- | DoExpr [BindingExpr] EgisonExpr
- | IoExpr EgisonExpr
- | ApplyExpr EgisonExpr EgisonExpr
- | AlgebraicDataMatcherExpr [(String, [EgisonExpr])]
- | GenerateArrayExpr [String] EgisonExpr EgisonExpr
- | ArraySizeExpr EgisonExpr
- | ArrayRefExpr EgisonExpr EgisonExpr
- | SomethingExpr
- | UndefinedExpr
- data EgisonPattern
- = WildCard
- | PatVar String
- | ValuePat EgisonExpr
- | PredPat EgisonExpr
- | IndexedPat EgisonPattern [EgisonExpr]
- | LetPat [BindingExpr] EgisonPattern
- | NotPat EgisonPattern
- | AndPat [EgisonPattern]
- | OrPat [EgisonPattern]
- | TuplePat [EgisonPattern]
- | InductivePat String [EgisonPattern]
- | LoopPat LoopMode String LoopRange EgisonPattern EgisonPattern
- | ContPat
- | ApplyPat EgisonExpr [EgisonPattern]
- | VarPat String
- data InnerExpr
- type BindingExpr = ([String], EgisonExpr)
- type MatchClause = (EgisonPattern, EgisonExpr)
- type MatcherInfo = [(PrimitivePatPattern, EgisonExpr, [(PrimitiveDataPattern, EgisonExpr)])]
- data LoopMode
- data LoopRange = LoopRange EgisonExpr EgisonPattern
- data PrimitivePatPattern
- data PrimitiveDataPattern
- data EgisonValue
- = World
- | Char Char
- | Bool Bool
- | Rational Rational
- | Integer Integer
- | Float Double
- | InductiveData String [EgisonValue]
- | Tuple [EgisonValue]
- | Collection (Seq EgisonValue)
- | Array (IntMap EgisonValue)
- | IntHash (HashMap Integer EgisonValue)
- | StrHash (HashMap ByteString EgisonValue)
- | UserMatcher Env PMMode MatcherInfo
- | Func Env [String] EgisonExpr
- | PatternFunc Env [String] EgisonPattern
- | PrimitiveFunc PrimitiveFunc
- | IOFunc (EgisonM WHNFData)
- | Port Handle
- | Something
- | Undefined
- | EOF
- type Matcher = EgisonValue
- type PrimitiveFunc = WHNFData -> EgisonM WHNFData
- class Egison a where
- toEgison :: a -> EgisonValue
- fromEgison :: EgisonValue -> EgisonM a
- data Object
- type ObjectRef = IORef Object
- data WHNFData
- data Intermediate
- data Inner
- class Egison a => EgisonWHNF a where
- type Env = [HashMap Var ObjectRef]
- type Var = String
- type Binding = (Var, ObjectRef)
- nullEnv :: Env
- extendEnv :: Env -> [Binding] -> Env
- refVar :: Env -> Var -> EgisonM ObjectRef
- type Match = [Binding]
- data PMMode
- pmMode :: Matcher -> PMMode
- data MatchingState = MState Env [LoopContext] [Binding] [MatchingTree]
- data MatchingTree
- type PatternBinding = (Var, EgisonPattern)
- data LoopContext = LoopContext LoopMode Binding (Bool, EgisonPattern) EgisonPattern EgisonPattern
- data EgisonError
- liftError :: MonadError e m => Either e a -> m a
- newtype EgisonM a = EgisonM {
- unEgisonM :: ErrorT EgisonError (FreshT IO) a
- runEgisonM :: EgisonM a -> FreshT IO (Either EgisonError a)
- liftEgisonM :: Fresh (Either EgisonError a) -> EgisonM a
- fromEgisonM :: EgisonM a -> IO (Either EgisonError a)
- newtype FreshT m a = FreshT {}
- type Fresh = FreshT Identity
- class (Applicative m, Monad m) => MonadFresh m where
- runFreshT :: Monad m => Int -> FreshT m a -> m (a, Int)
- type MatchM = MaybeT EgisonM
- matchFail :: MatchM a
- data MList m a
- fromList :: Monad m => [a] -> MList m a
- fromSeq :: Monad m => Seq a -> MList m a
- fromMList :: Monad m => MList m a -> m [a]
- msingleton :: Monad m => a -> MList m a
- mfoldr :: Monad m => (a -> m b -> m b) -> m b -> MList m a -> m b
- mappend :: Monad m => MList m a -> m (MList m a) -> m (MList m a)
- mconcat :: Monad m => MList m (MList m a) -> m (MList m a)
- mmap :: Monad m => (a -> m b) -> MList m a -> m (MList m b)
- mfor :: Monad m => MList m a -> (a -> m b) -> m (MList m b)
Egison expressions
data EgisonTopExpr Source
data EgisonExpr Source
data EgisonPattern Source
type BindingExpr = ([String], EgisonExpr)Source
type MatchClause = (EgisonPattern, EgisonExpr)Source
type MatcherInfo = [(PrimitivePatPattern, EgisonExpr, [(PrimitiveDataPattern, EgisonExpr)])]Source
Egison values
data EgisonValue Source
type Matcher = EgisonValueSource
type PrimitiveFunc = WHNFData -> EgisonM WHNFDataSource
toEgison :: a -> EgisonValueSource
fromEgison :: EgisonValue -> EgisonM aSource
Internal data
data Intermediate Source
class Egison a => EgisonWHNF a whereSource
Environment
Pattern matching
data MatchingTree Source
type PatternBinding = (Var, EgisonPattern)Source
data LoopContext Source
Errors
data EgisonError Source
liftError :: MonadError e m => Either e a -> m aSource
Monads
runEgisonM :: EgisonM a -> FreshT IO (Either EgisonError a)Source
liftEgisonM :: Fresh (Either EgisonError a) -> EgisonM aSource
fromEgisonM :: EgisonM a -> IO (Either EgisonError a)Source
MonadTrans FreshT | |
MonadError e m => MonadError e (FreshT m) | |
Monad m => MonadState Int (FreshT m) | |
MonadState s m => MonadState s (FreshT m) | |
Monad m => Monad (FreshT m) | |
Functor m => Functor (FreshT m) | |
(Monad m, Functor m) => Applicative (FreshT m) | |
MonadIO (FreshT IO) | |
(Applicative m, Monad m) => MonadFresh (FreshT m) |
class (Applicative m, Monad m) => MonadFresh m whereSource
MonadFresh EgisonM | |
MonadFresh DesugarM | |
(Applicative m, Monad m) => MonadFresh (FreshT m) | |
(MonadFresh m, Monoid e) => MonadFresh (ReaderT e m) | |
(MonadFresh m, Error e) => MonadFresh (ErrorT e m) | |
MonadFresh m => MonadFresh (StateT s m) | |
(MonadFresh m, Monoid e) => MonadFresh (WriterT e m) |
msingleton :: Monad m => a -> MList m aSource