antisplice-0.17.0.3: An engine for text-based dungeons.

Safe HaskellSafe-Inferred
LanguageHaskell2010

Game.Antisplice.Monad.Vocab

Description

Provides a monad that collects vocab during dungeon construction and reproduces it later.

Synopsis

Documentation

data Token Source

Algebraic type for primitive and complex tokens.

Constructors

Unintellegible String 
Verb String 
Prep String 
Noun String 
Adj String 
Ordn Int String 
Fixe String 
Skilln String 
Nounc [String] (Maybe Int) String

Complex noun, with attributes and maybe ordinal index.

newtype VocabT m a Source

The vocab monad. Carries the currently noun vocab as its state.

Constructors

Vocab 

Fields

runVocabT :: TST Token -> m (a, TST Token)
 

class Monad m => MonadVocab m where Source

Tyepclass for all vocab-memorizing monads.

Methods

lookupVocab :: String -> m Token Source

Lookup a word and return its token.

insertVocab :: String -> (String -> Token) -> m () Source

Learn a new word.

vocabKnown :: String -> m Bool Source

Check if a word is already known.