diff options
| author | Georg Brandl <georg@python.org> | 2021-01-18 21:24:00 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2021-01-18 22:08:36 +0100 |
| commit | 2a3d3a7d5b9c60dedf6638d876161d9563faebcf (patch) | |
| tree | 809c0b4a686db98f5954afa1944404cd9652c6b2 /tests/lexers/haskell | |
| parent | f0445be718da83541ea3401aad882f3937147263 (diff) | |
| download | pygments-git-examplefiles.tar.gz | |
Move test_examplefiles to new tests/lexers scheme.examplefiles
Diffstat (limited to 'tests/lexers/haskell')
| -rw-r--r-- | tests/lexers/haskell/example.txt | 2492 | ||||
| -rw-r--r-- | tests/lexers/haskell/example2.txt | 360 | ||||
| -rw-r--r-- | tests/lexers/haskell/example3.txt | 5019 |
3 files changed, 7871 insertions, 0 deletions
diff --git a/tests/lexers/haskell/example.txt b/tests/lexers/haskell/example.txt new file mode 100644 index 00000000..6e7a7ee9 --- /dev/null +++ b/tests/lexers/haskell/example.txt @@ -0,0 +1,2492 @@ +---input--- +{-# LANGUAGE DeriveDataTypeable, FlexibleContexts, GeneralizedNewtypeDeriving + , MultiParamTypeClasses, OverloadedStrings, ScopedTypeVariables, TemplateHaskell + , TypeFamilies, FlexibleInstances #-} +module Main where +import Control.Applicative (Applicative, Alternative, (<$>)) +import Control.Exception.Lifted (bracket) +import Control.Monad.Trans.Control (MonadBaseControl) +import Control.Monad (MonadPlus, mplus) +import Control.Monad.Reader (MonadReader, ReaderT(..), ask) +import Control.Monad.Trans (MonadIO(..)) +import Data.Acid ( AcidState(..), EventState(..), EventResult(..) + , Query(..), QueryEvent(..), Update(..), UpdateEvent(..) + , IsAcidic(..), makeAcidic, openLocalState + ) +import Data.Acid.Local ( createCheckpointAndClose + , openLocalStateFrom + ) +import Data.Acid.Advanced (query', update') +import Data.Maybe (fromMaybe) +import Data.SafeCopy (SafeCopy, base, deriveSafeCopy) +import Data.Data (Data, Typeable) +import Data.Lens ((%=), (!=)) +import Data.Lens.Template (makeLens) +import Data.Text.Lazy (Text) +import Happstack.Server ( Happstack, HasRqData, Method(GET, POST), Request(rqMethod) + , Response + , ServerPartT(..), WebMonad, FilterMonad, ServerMonad + , askRq, decodeBody, dir, defaultBodyPolicy, lookText + , mapServerPartT, nullConf, nullDir, ok, simpleHTTP + , toResponse + ) +import Prelude hiding (head, id) +import System.FilePath ((</>)) +import Text.Blaze ((!)) +import Text.Blaze.Html4.Strict (body, head, html, input, form, label, p, title, toHtml) +import Text.Blaze.Html4.Strict.Attributes (action, enctype, for, id, method, name, type_, value) +class HasAcidState m st where + getAcidState :: m (AcidState st) +query :: forall event m. + ( Functor m + , MonadIO m + , QueryEvent event + , HasAcidState m (EventState event) + ) => + event + -> m (EventResult event) +query event = + do as <- getAcidState + query' (as :: AcidState (EventState event)) event +update :: forall event m. + ( Functor m + , MonadIO m + , UpdateEvent event + , HasAcidState m (EventState event) + ) => + event + -> m (EventResult event) +update event = + do as <- getAcidState + update' (as :: AcidState (EventState event)) event +-- | bracket the opening and close of the `AcidState` handle. + +-- automatically creates a checkpoint on close +withLocalState :: (MonadBaseControl IO m, MonadIO m, IsAcidic st, Typeable st) => + Maybe FilePath -- ^ path to state directory + -> st -- ^ initial state value + -> (AcidState st -> m a) -- ^ function which uses the `AcidState` handle + -> m a +withLocalState mPath initialState = + bracket (liftIO $ (maybe openLocalState openLocalStateFrom mPath) initialState) + (liftIO . createCheckpointAndClose) +-- State that stores a hit count + +data CountState = CountState { _count :: Integer } + deriving (Eq, Ord, Data, Typeable, Show) + +$(deriveSafeCopy 0 'base ''CountState) +$(makeLens ''CountState) + +initialCountState :: CountState +initialCountState = CountState { _count = 0 } + +incCount :: Update CountState Integer +incCount = count %= succ + +$(makeAcidic ''CountState ['incCount]) +-- State that stores a greeting +data GreetingState = GreetingState { _greeting :: Text } + deriving (Eq, Ord, Data, Typeable, Show) + +$(deriveSafeCopy 0 'base ''GreetingState) +$(makeLens ''GreetingState) + +initialGreetingState :: GreetingState +initialGreetingState = GreetingState { _greeting = "Hello" } + +getGreeting :: Query GreetingState Text +getGreeting = _greeting <$> ask + +setGreeting :: Text -> Update GreetingState Text +setGreeting txt = greeting != txt + +$(makeAcidic ''GreetingState ['getGreeting, 'setGreeting]) +data Acid = Acid { acidCountState :: AcidState CountState + , acidGreetingState :: AcidState GreetingState + } + +withAcid :: Maybe FilePath -> (Acid -> IO a) -> IO a +withAcid mBasePath action = + let basePath = fromMaybe "_state" mBasePath + in withLocalState (Just $ basePath </> "count") initialCountState $ \c -> + withLocalState (Just $ basePath </> "greeting") initialGreetingState $ \g -> + action (Acid c g) +newtype App a = App { unApp :: ServerPartT (ReaderT Acid IO) a } + deriving ( Functor, Alternative, Applicative, Monad, MonadPlus, MonadIO + , HasRqData, ServerMonad ,WebMonad Response, FilterMonad Response + , Happstack, MonadReader Acid) + +runApp :: Acid -> App a -> ServerPartT IO a +runApp acid (App sp) = mapServerPartT (flip runReaderT acid) sp +instance HasAcidState App CountState where + getAcidState = acidCountState <$> ask + +instance HasAcidState App GreetingState where + getAcidState = acidGreetingState <$> ask +page :: App Response +page = + do nullDir + g <- greet + c <- update IncCount -- ^ a CountState event + ok $ toResponse $ + html $ do + head $ do + title "acid-state demo" + body $ do + form ! action "/" ! method "POST" ! enctype "multipart/form-data" $ do + label "new message: " ! for "msg" + input ! type_ "text" ! id "msg" ! name "greeting" + input ! type_ "submit" ! value "update message" + p $ toHtml g + p $ do "This page has been loaded " + toHtml c + " time(s)." + where + greet = + do m <- rqMethod <$> askRq + case m of + POST -> + do decodeBody (defaultBodyPolicy "/tmp/" 0 1000 1000) + newGreeting <- lookText "greeting" + update (SetGreeting newGreeting) -- ^ a GreetingState event + return newGreeting + GET -> + do query GetGreeting -- ^ a GreetingState event +main :: IO () +main = + withAcid Nothing $ \acid -> + simpleHTTP nullConf $ runApp acid page +newtype FooState = FooState { foo :: Text } + deriving (Eq, Ord, Data, Typeable, SafeCopy) + +initialFooState :: FooState +initialFooState = FooState { foo = "foo" } + +askFoo :: Query FooState Text +askFoo = foo <$> ask + +$(makeAcidic ''FooState ['askFoo]) +fooPlugin :: (Happstack m, HasAcidState m FooState) => m Response +fooPlugin = + dir "foo" $ do + txt <- query AskFoo + ok $ toResponse txt +data Acid' = Acid' { acidCountState' :: AcidState CountState + , acidGreetingState' :: AcidState GreetingState + , acidFooState' :: AcidState FooState + } +withAcid' :: Maybe FilePath -> (Acid' -> IO a) -> IO a +withAcid' mBasePath action = + let basePath = fromMaybe "_state" mBasePath + in withLocalState (Just $ basePath </> "count") initialCountState $ \c -> + withLocalState (Just $ basePath </> "greeting") initialGreetingState $ \g -> + withLocalState (Just $ basePath </> "foo") initialFooState $ \f -> + action (Acid' c g f) +newtype App' a = App' { unApp' :: ServerPartT (ReaderT Acid' IO) a } + deriving ( Functor, Alternative, Applicative, Monad, MonadPlus, MonadIO + , HasRqData, ServerMonad ,WebMonad Response, FilterMonad Response + , Happstack, MonadReader Acid') + +instance HasAcidState App' FooState where + getAcidState = acidFooState' <$> ask +fooAppPlugin :: App' Response +fooAppPlugin = fooPlugin +fooReaderPlugin :: ReaderT (AcidState FooState) (ServerPartT IO) Response +fooReaderPlugin = fooPlugin +instance HasAcidState (ReaderT (AcidState FooState) (ServerPartT IO)) FooState where + getAcidState = ask +withFooPlugin :: (MonadIO m, MonadBaseControl IO m) => + FilePath -- ^ path to state directory + -> (ServerPartT IO Response -> m a) -- ^ function that uses fooPlugin + -> m a +withFooPlugin basePath f = + do withLocalState (Just $ basePath </> "foo") initialFooState $ \fooState -> + f $ runReaderT fooReaderPlugin fooState +main' :: IO () +main' = + withFooPlugin "_state" $ \fooPlugin' -> + withAcid Nothing $ \acid -> + simpleHTTP nullConf $ fooPlugin' `mplus` runApp acid page + +---tokens--- +'{-' Comment.Multiline +'# LANGUAGE DeriveDataTypeable, FlexibleContexts, GeneralizedNewtypeDeriving\n , MultiParamTypeClasses, OverloadedStrings, ScopedTypeVariables, TemplateHaskell\n , TypeFamilies, FlexibleInstances #' Comment.Multiline +'-}' Comment.Multiline +'\n' Text + +'module' Keyword.Reserved +' ' Text +'Main' Name.Namespace +' ' Text +'where' Keyword.Reserved +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Control.Applicative' Name.Namespace +' ' Text +'(' Punctuation +'Applicative' Keyword.Type +',' Punctuation +' ' Text +'Alternative' Keyword.Type +',' Punctuation +' ' Text +'(' Punctuation +'<$>' Operator +')' Punctuation +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Control.Exception.Lifted' Name.Namespace +' ' Text +'(' Punctuation +'bracket' Name.Function +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Control.Monad.Trans.Control' Name.Namespace +' ' Text +'(' Punctuation +'MonadBaseControl' Keyword.Type +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Control.Monad' Name.Namespace +' ' Text +'(' Punctuation +'MonadPlus' Keyword.Type +',' Punctuation +' ' Text +'mplus' Name.Function +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Control.Monad.Reader' Name.Namespace +' ' Text +'(' Punctuation +'MonadReader' Keyword.Type +',' Punctuation +' ' Text +'ReaderT' Keyword.Type +'(' Punctuation +'..' Operator +')' Punctuation +',' Punctuation +' ' Text +'ask' Name.Function +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Control.Monad.Trans' Name.Namespace +' ' Text +'(' Punctuation +'MonadIO' Keyword.Type +'(' Punctuation +'..' Operator +')' Punctuation +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Data.Acid' Name.Namespace +' ' Text +'(' Punctuation +' ' Text +'AcidState' Keyword.Type +'(' Punctuation +'..' Operator +')' Punctuation +',' Punctuation +' ' Text +'EventState' Keyword.Type +'(' Punctuation +'..' Operator +')' Punctuation +',' Punctuation +' ' Text +'EventResult' Keyword.Type +'(' Punctuation +'..' Operator +')' Punctuation +'\n ' Text +',' Punctuation +' ' Text +'Query' Keyword.Type +'(' Punctuation +'..' Operator +')' Punctuation +',' Punctuation +' ' Text +'QueryEvent' Keyword.Type +'(' Punctuation +'..' Operator +')' Punctuation +',' Punctuation +' ' Text +'Update' Keyword.Type +'(' Punctuation +'..' Operator +')' Punctuation +',' Punctuation +' ' Text +'UpdateEvent' Keyword.Type +'(' Punctuation +'..' Operator +')' Punctuation +'\n ' Text +',' Punctuation +' ' Text +'IsAcidic' Keyword.Type +'(' Punctuation +'..' Operator +')' Punctuation +',' Punctuation +' ' Text +'makeAcidic' Name.Function +',' Punctuation +' ' Text +'openLocalState' Name.Function +'\n ' Text +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Data.Acid.Local' Name.Namespace +' ' Text +'(' Punctuation +' ' Text +'createCheckpointAndClose' Name.Function +'\n ' Text +',' Punctuation +' ' Text +'openLocalStateFrom' Name.Function +'\n ' Text +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Data.Acid.Advanced' Name.Namespace +' ' Text +'(' Punctuation +"query'" Name.Function +',' Punctuation +' ' Text +"update'" Name.Function +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Data.Maybe' Name.Namespace +' ' Text +'(' Punctuation +'fromMaybe' Name.Function +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Data.SafeCopy' Name.Namespace +' ' Text +'(' Punctuation +'SafeCopy' Keyword.Type +',' Punctuation +' ' Text +'base' Name.Function +',' Punctuation +' ' Text +'deriveSafeCopy' Name.Function +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Data.Data' Name.Namespace +' ' Text +'(' Punctuation +'Data' Keyword.Type +',' Punctuation +' ' Text +'Typeable' Keyword.Type +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Data.Lens' Name.Namespace +' ' Text +'(' Punctuation +'(' Punctuation +'%=' Operator +')' Punctuation +',' Punctuation +' ' Text +'(' Punctuation +'!=' Operator +')' Punctuation +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Data.Lens.Template' Name.Namespace +' ' Text +'(' Punctuation +'makeLens' Name.Function +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Data.Text.Lazy' Name.Namespace +' ' Text +'(' Punctuation +'Text' Keyword.Type +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Happstack.Server' Name.Namespace +' ' Text +'(' Punctuation +' ' Text +'Happstack' Keyword.Type +',' Punctuation +' ' Text +'HasRqData' Keyword.Type +',' Punctuation +' ' Text +'Method' Keyword.Type +'(' Punctuation +'GET' Keyword.Type +',' Punctuation +' ' Text +'POST' Keyword.Type +')' Punctuation +',' Punctuation +' ' Text +'Request' Keyword.Type +'(' Punctuation +'rqMethod' Name.Function +')' Punctuation +'\n ' Text +',' Punctuation +' ' Text +'Response' Keyword.Type +'\n ' Text +',' Punctuation +' ' Text +'ServerPartT' Keyword.Type +'(' Punctuation +'..' Operator +')' Punctuation +',' Punctuation +' ' Text +'WebMonad' Keyword.Type +',' Punctuation +' ' Text +'FilterMonad' Keyword.Type +',' Punctuation +' ' Text +'ServerMonad' Keyword.Type +'\n ' Text +',' Punctuation +' ' Text +'askRq' Name.Function +',' Punctuation +' ' Text +'decodeBody' Name.Function +',' Punctuation +' ' Text +'dir' Name.Function +',' Punctuation +' ' Text +'defaultBodyPolicy' Name.Function +',' Punctuation +' ' Text +'lookText' Name.Function +'\n ' Text +',' Punctuation +' ' Text +'mapServerPartT' Name.Function +',' Punctuation +' ' Text +'nullConf' Name.Function +',' Punctuation +' ' Text +'nullDir' Name.Function +',' Punctuation +' ' Text +'ok' Name.Function +',' Punctuation +' ' Text +'simpleHTTP' Name.Function +'\n ' Text +',' Punctuation +' ' Text +'toResponse' Name.Function +'\n ' Text +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Prelude' Name.Namespace +' ' Text +'hiding' Keyword +' ' Text +'(' Punctuation +'head' Name.Function +',' Punctuation +' ' Text +'id' Name.Function +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'System.FilePath' Name.Namespace +' ' Text +'(' Punctuation +'(' Punctuation +'</>' Operator +')' Punctuation +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Text.Blaze' Name.Namespace +' ' Text +'(' Punctuation +'(' Punctuation +'!' Operator +')' Punctuation +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Text.Blaze.Html4.Strict' Name.Namespace +' ' Text +'(' Punctuation +'body' Name.Function +',' Punctuation +' ' Text +'head' Name.Function +',' Punctuation +' ' Text +'html' Name.Function +',' Punctuation +' ' Text +'input' Name.Function +',' Punctuation +' ' Text +'form' Name.Function +',' Punctuation +' ' Text +'label' Name.Function +',' Punctuation +' ' Text +'p' Name.Function +',' Punctuation +' ' Text +'title' Name.Function +',' Punctuation +' ' Text +'toHtml' Name.Function +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Text.Blaze.Html4.Strict.Attributes' Name.Namespace +' ' Text +'(' Punctuation +'action' Name.Function +',' Punctuation +' ' Text +'enctype' Name.Function +',' Punctuation +' ' Text +'for' Name.Function +',' Punctuation +' ' Text +'id' Name.Function +',' Punctuation +' ' Text +'method' Name.Function +',' Punctuation +' ' Text +'name' Name.Function +',' Punctuation +' ' Text +'type_' Name.Function +',' Punctuation +' ' Text +'value' Name.Function +')' Punctuation +'\n' Text + +'class' Keyword.Reserved +' ' Text +'HasAcidState' Keyword.Type +' ' Text +'m' Name +' ' Text +'st' Name +' ' Text +'where' Keyword.Reserved +'\n ' Text +'getAcidState' Name +' ' Text +'::' Operator.Word +' ' Text +'m' Name +' ' Text +'(' Punctuation +'AcidState' Keyword.Type +' ' Text +'st' Name +')' Punctuation +'\n' Text + +'query' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'forall' Name +' ' Text +'event' Name +' ' Text +'m' Name +'.' Operator +' \n ' Text +'(' Punctuation +' ' Text +'Functor' Keyword.Type +' ' Text +'m' Name +'\n ' Text +',' Punctuation +' ' Text +'MonadIO' Keyword.Type +' ' Text +'m' Name +'\n ' Text +',' Punctuation +' ' Text +'QueryEvent' Keyword.Type +' ' Text +'event' Name +'\n ' Text +',' Punctuation +' ' Text +'HasAcidState' Keyword.Type +' ' Text +'m' Name +' ' Text +'(' Punctuation +'EventState' Keyword.Type +' ' Text +'event' Name +')' Punctuation +'\n ' Text +')' Punctuation +' ' Text +'=>' Operator.Word +' \n ' Text +'event' Name +'\n ' Text +'->' Operator.Word +' ' Text +'m' Name +' ' Text +'(' Punctuation +'EventResult' Keyword.Type +' ' Text +'event' Name +')' Punctuation +'\n' Text + +'query' Name.Function +' ' Text +'event' Name +' ' Text +'=' Operator.Word +'\n ' Text +'do' Keyword.Reserved +' ' Text +'as' Name +' ' Text +'<-' Operator.Word +' ' Text +'getAcidState' Name +'\n ' Text +"query'" Name +' ' Text +'(' Punctuation +'as' Name +' ' Text +'::' Operator.Word +' ' Text +'AcidState' Keyword.Type +' ' Text +'(' Punctuation +'EventState' Keyword.Type +' ' Text +'event' Name +')' Punctuation +')' Punctuation +' ' Text +'event' Name +'\n' Text + +'update' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'forall' Name +' ' Text +'event' Name +' ' Text +'m' Name +'.' Operator +' \n ' Text +'(' Punctuation +' ' Text +'Functor' Keyword.Type +' ' Text +'m' Name +'\n ' Text +',' Punctuation +' ' Text +'MonadIO' Keyword.Type +' ' Text +'m' Name +'\n ' Text +',' Punctuation +' ' Text +'UpdateEvent' Keyword.Type +' ' Text +'event' Name +'\n ' Text +',' Punctuation +' ' Text +'HasAcidState' Keyword.Type +' ' Text +'m' Name +' ' Text +'(' Punctuation +'EventState' Keyword.Type +' ' Text +'event' Name +')' Punctuation +'\n ' Text +')' Punctuation +' ' Text +'=>' Operator.Word +' \n ' Text +'event' Name +' \n ' Text +'->' Operator.Word +' ' Text +'m' Name +' ' Text +'(' Punctuation +'EventResult' Keyword.Type +' ' Text +'event' Name +')' Punctuation +'\n' Text + +'update' Name.Function +' ' Text +'event' Name +' ' Text +'=' Operator.Word +'\n ' Text +'do' Keyword.Reserved +' ' Text +'as' Name +' ' Text +'<-' Operator.Word +' ' Text +'getAcidState' Name +'\n ' Text +"update'" Name +' ' Text +'(' Punctuation +'as' Name +' ' Text +'::' Operator.Word +' ' Text +'AcidState' Keyword.Type +' ' Text +'(' Punctuation +'EventState' Keyword.Type +' ' Text +'event' Name +')' Punctuation +')' Punctuation +' ' Text +'event' Name +'\n' Text + +'-- | bracket the opening and close of the `AcidState` handle. ' Comment.Single +'\n\n' Text + +'-- automatically creates a checkpoint on close' Comment.Single +'\n' Text + +'withLocalState' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'(' Punctuation +'MonadBaseControl' Keyword.Type +' ' Text +'IO' Keyword.Type +' ' Text +'m' Name +',' Punctuation +' ' Text +'MonadIO' Keyword.Type +' ' Text +'m' Name +',' Punctuation +' ' Text +'IsAcidic' Keyword.Type +' ' Text +'st' Name +',' Punctuation +' ' Text +'Typeable' Keyword.Type +' ' Text +'st' Name +')' Punctuation +' ' Text +'=>' Operator.Word +' \n ' Text +'Maybe' Keyword.Type +' ' Text +'FilePath' Keyword.Type +' ' Text +'-- ^ path to state directory' Comment.Single +'\n ' Text +'->' Operator.Word +' ' Text +'st' Name +' ' Text +'-- ^ initial state value' Comment.Single +'\n ' Text +'->' Operator.Word +' ' Text +'(' Punctuation +'AcidState' Keyword.Type +' ' Text +'st' Name +' ' Text +'->' Operator.Word +' ' Text +'m' Name +' ' Text +'a' Name +')' Punctuation +' ' Text +'-- ^ function which uses the `AcidState` handle' Comment.Single +'\n ' Text +'->' Operator.Word +' ' Text +'m' Name +' ' Text +'a' Name +'\n' Text + +'withLocalState' Name.Function +' ' Text +'mPath' Name +' ' Text +'initialState' Name +' ' Text +'=' Operator.Word +'\n ' Text +'bracket' Name +' ' Text +'(' Punctuation +'liftIO' Name +' ' Text +'$' Operator +' ' Text +'(' Punctuation +'maybe' Name +' ' Text +'openLocalState' Name +' ' Text +'openLocalStateFrom' Name +' ' Text +'mPath' Name +')' Punctuation +' ' Text +'initialState' Name +')' Punctuation +'\n ' Text +'(' Punctuation +'liftIO' Name +' ' Text +'.' Operator +' ' Text +'createCheckpointAndClose' Name +')' Punctuation +'\n' Text + +'-- State that stores a hit count' Comment.Single +'\n\n' Text + +'data' Keyword.Reserved +' ' Text +'CountState' Keyword.Type +' ' Text +'=' Operator.Word +' ' Text +'CountState' Keyword.Type +' ' Text +'{' Punctuation +' ' Text +'_count' Name +' ' Text +'::' Operator.Word +' ' Text +'Integer' Keyword.Type +' ' Text +'}' Punctuation +'\n ' Text +'deriving' Keyword.Reserved +' ' Text +'(' Punctuation +'Eq' Keyword.Type +',' Punctuation +' ' Text +'Ord' Keyword.Type +',' Punctuation +' ' Text +'Data' Keyword.Type +',' Punctuation +' ' Text +'Typeable' Keyword.Type +',' Punctuation +' ' Text +'Show' Keyword.Type +')' Punctuation +'\n\n' Text + +'$' Operator +'(' Punctuation +'deriveSafeCopy' Name +' ' Text +'0' Literal.Number.Integer +' ' Text +"'base" Name +' ' Text +"''CountState" Keyword.Type +')' Punctuation +'\n' Text + +'$' Operator +'(' Punctuation +'makeLens' Name +' ' Text +"''CountState" Keyword.Type +')' Punctuation +'\n\n' Text + +'initialCountState' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'CountState' Keyword.Type +'\n' Text + +'initialCountState' Name.Function +' ' Text +'=' Operator.Word +' ' Text +'CountState' Keyword.Type +' ' Text +'{' Punctuation +' ' Text +'_count' Name +' ' Text +'=' Operator.Word +' ' Text +'0' Literal.Number.Integer +' ' Text +'}' Punctuation +'\n\n' Text + +'incCount' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Update' Keyword.Type +' ' Text +'CountState' Keyword.Type +' ' Text +'Integer' Keyword.Type +'\n' Text + +'incCount' Name.Function +' ' Text +'=' Operator.Word +' ' Text +'count' Name +' ' Text +'%=' Operator +' ' Text +'succ' Name +'\n\n' Text + +'$' Operator +'(' Punctuation +'makeAcidic' Name +' ' Text +"''CountState" Keyword.Type +' ' Text +'[' Punctuation +"'incCount" Name +']' Punctuation +')' Punctuation +'\n' Text + +'-- State that stores a greeting' Comment.Single +'\n' Text + +'data' Keyword.Reserved +' ' Text +'GreetingState' Keyword.Type +' ' Text +'=' Operator.Word +' ' Text +'GreetingState' Keyword.Type +' ' Text +'{' Punctuation +' ' Text +'_greeting' Name +' ' Text +'::' Operator.Word +' ' Text +'Text' Keyword.Type +' ' Text +'}' Punctuation +'\n ' Text +'deriving' Keyword.Reserved +' ' Text +'(' Punctuation +'Eq' Keyword.Type +',' Punctuation +' ' Text +'Ord' Keyword.Type +',' Punctuation +' ' Text +'Data' Keyword.Type +',' Punctuation +' ' Text +'Typeable' Keyword.Type +',' Punctuation +' ' Text +'Show' Keyword.Type +')' Punctuation +'\n\n' Text + +'$' Operator +'(' Punctuation +'deriveSafeCopy' Name +' ' Text +'0' Literal.Number.Integer +' ' Text +"'base" Name +' ' Text +"''GreetingState" Keyword.Type +')' Punctuation +'\n' Text + +'$' Operator +'(' Punctuation +'makeLens' Name +' ' Text +"''GreetingState" Keyword.Type +')' Punctuation +'\n\n' Text + +'initialGreetingState' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'GreetingState' Keyword.Type +'\n' Text + +'initialGreetingState' Name.Function +' ' Text +'=' Operator.Word +' ' Text +'GreetingState' Keyword.Type +' ' Text +'{' Punctuation +' ' Text +'_greeting' Name +' ' Text +'=' Operator.Word +' ' Text +'"' Literal.String +'Hello' Literal.String +'"' Literal.String +' ' Text +'}' Punctuation +'\n\n' Text + +'getGreeting' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Query' Keyword.Type +' ' Text +'GreetingState' Keyword.Type +' ' Text +'Text' Keyword.Type +'\n' Text + +'getGreeting' Name.Function +' ' Text +'=' Operator.Word +' ' Text +'_greeting' Name +' ' Text +'<$>' Operator +' ' Text +'ask' Name +'\n\n' Text + +'setGreeting' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Text' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'Update' Keyword.Type +' ' Text +'GreetingState' Keyword.Type +' ' Text +'Text' Keyword.Type +'\n' Text + +'setGreeting' Name.Function +' ' Text +'txt' Name +' ' Text +'=' Operator.Word +' ' Text +'greeting' Name +' ' Text +'!=' Operator +' ' Text +'txt' Name +'\n\n' Text + +'$' Operator +'(' Punctuation +'makeAcidic' Name +' ' Text +"''GreetingState" Keyword.Type +' ' Text +'[' Punctuation +"'getGreeting" Name +',' Punctuation +' ' Text +"'setGreeting" Name +']' Punctuation +')' Punctuation +'\n' Text + +'data' Keyword.Reserved +' ' Text +'Acid' Keyword.Type +' ' Text +'=' Operator.Word +' ' Text +'Acid' Keyword.Type +' ' Text +'{' Punctuation +' ' Text +'acidCountState' Name +' ' Text +'::' Operator.Word +' ' Text +'AcidState' Keyword.Type +' ' Text +'CountState' Keyword.Type +'\n ' Text +',' Punctuation +' ' Text +'acidGreetingState' Name +' ' Text +'::' Operator.Word +' ' Text +'AcidState' Keyword.Type +' ' Text +'GreetingState' Keyword.Type +'\n ' Text +'}' Punctuation +'\n\n' Text + +'withAcid' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Maybe' Keyword.Type +' ' Text +'FilePath' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'(' Punctuation +'Acid' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'IO' Keyword.Type +' ' Text +'a' Name +')' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'IO' Keyword.Type +' ' Text +'a' Name +'\n' Text + +'withAcid' Name.Function +' ' Text +'mBasePath' Name +' ' Text +'action' Name +' ' Text +'=' Operator.Word +'\n ' Text +'let' Keyword.Reserved +' ' Text +'basePath' Name +' ' Text +'=' Operator.Word +' ' Text +'fromMaybe' Name +' ' Text +'"' Literal.String +'_state' Literal.String +'"' Literal.String +' ' Text +'mBasePath' Name +'\n ' Text +'in' Keyword.Reserved +' ' Text +'withLocalState' Name +' ' Text +'(' Punctuation +'Just' Keyword.Type +' ' Text +'$' Operator +' ' Text +'basePath' Name +' ' Text +'</>' Operator +' ' Text +'"' Literal.String +'count' Literal.String +'"' Literal.String +')' Punctuation +' ' Text +'initialCountState' Name +' ' Text +'$' Operator +' ' Text +'\\' Name.Function +'c' Name +' ' Text +'->' Operator.Word +'\n ' Text +'withLocalState' Name +' ' Text +'(' Punctuation +'Just' Keyword.Type +' ' Text +'$' Operator +' ' Text +'basePath' Name +' ' Text +'</>' Operator +' ' Text +'"' Literal.String +'greeting' Literal.String +'"' Literal.String +')' Punctuation +' ' Text +'initialGreetingState' Name +' ' Text +'$' Operator +' ' Text +'\\' Name.Function +'g' Name +' ' Text +'->' Operator.Word +'\n ' Text +'action' Name +' ' Text +'(' Punctuation +'Acid' Keyword.Type +' ' Text +'c' Name +' ' Text +'g' Name +')' Punctuation +'\n' Text + +'newtype' Keyword.Reserved +' ' Text +'App' Keyword.Type +' ' Text +'a' Name +' ' Text +'=' Operator.Word +' ' Text +'App' Keyword.Type +' ' Text +'{' Punctuation +' ' Text +'unApp' Name +' ' Text +'::' Operator.Word +' ' Text +'ServerPartT' Keyword.Type +' ' Text +'(' Punctuation +'ReaderT' Keyword.Type +' ' Text +'Acid' Keyword.Type +' ' Text +'IO' Keyword.Type +')' Punctuation +' ' Text +'a' Name +' ' Text +'}' Punctuation +'\n ' Text +'deriving' Keyword.Reserved +' ' Text +'(' Punctuation +' ' Text +'Functor' Keyword.Type +',' Punctuation +' ' Text +'Alternative' Keyword.Type +',' Punctuation +' ' Text +'Applicative' Keyword.Type +',' Punctuation +' ' Text +'Monad' Keyword.Type +',' Punctuation +' ' Text +'MonadPlus' Keyword.Type +',' Punctuation +' ' Text +'MonadIO' Keyword.Type +'\n ' Text +',' Punctuation +' ' Text +'HasRqData' Keyword.Type +',' Punctuation +' ' Text +'ServerMonad' Keyword.Type +' ' Text +',' Punctuation +'WebMonad' Keyword.Type +' ' Text +'Response' Keyword.Type +',' Punctuation +' ' Text +'FilterMonad' Keyword.Type +' ' Text +'Response' Keyword.Type +'\n ' Text +',' Punctuation +' ' Text +'Happstack' Keyword.Type +',' Punctuation +' ' Text +'MonadReader' Keyword.Type +' ' Text +'Acid' Keyword.Type +')' Punctuation +'\n\n' Text + +'runApp' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Acid' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'App' Keyword.Type +' ' Text +'a' Name +' ' Text +'->' Operator.Word +' ' Text +'ServerPartT' Keyword.Type +' ' Text +'IO' Keyword.Type +' ' Text +'a' Name +'\n' Text + +'runApp' Name.Function +' ' Text +'acid' Name +' ' Text +'(' Punctuation +'App' Keyword.Type +' ' Text +'sp' Name +')' Punctuation +' ' Text +'=' Operator.Word +' ' Text +'mapServerPartT' Name +' ' Text +'(' Punctuation +'flip' Name +' ' Text +'runReaderT' Name +' ' Text +'acid' Name +')' Punctuation +' ' Text +'sp' Name +'\n' Text + +'instance' Keyword.Reserved +' ' Text +'HasAcidState' Keyword.Type +' ' Text +'App' Keyword.Type +' ' Text +'CountState' Keyword.Type +' ' Text +'where' Keyword.Reserved +'\n ' Text +'getAcidState' Name +' ' Text +'=' Operator.Word +' ' Text +'acidCountState' Name +' ' Text +'<$>' Operator +' ' Text +'ask' Name +' \n\n' Text + +'instance' Keyword.Reserved +' ' Text +'HasAcidState' Keyword.Type +' ' Text +'App' Keyword.Type +' ' Text +'GreetingState' Keyword.Type +' ' Text +'where' Keyword.Reserved +'\n ' Text +'getAcidState' Name +' ' Text +'=' Operator.Word +' ' Text +'acidGreetingState' Name +' ' Text +'<$>' Operator +' ' Text +'ask' Name +'\n' Text + +'page' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'App' Keyword.Type +' ' Text +'Response' Keyword.Type +'\n' Text + +'page' Name.Function +' ' Text +'=' Operator.Word +'\n ' Text +'do' Keyword.Reserved +' ' Text +'nullDir' Name +'\n ' Text +'g' Name +' ' Text +'<-' Operator.Word +' ' Text +'greet' Name +'\n ' Text +'c' Name +' ' Text +'<-' Operator.Word +' ' Text +'update' Name +' ' Text +'IncCount' Keyword.Type +' ' Text +'-- ^ a CountState event' Comment.Single +'\n ' Text +'ok' Name +' ' Text +'$' Operator +' ' Text +'toResponse' Name +' ' Text +'$' Operator +'\n ' Text +'html' Name +' ' Text +'$' Operator +' ' Text +'do' Keyword.Reserved +'\n ' Text +'head' Name +' ' Text +'$' Operator +' ' Text +'do' Keyword.Reserved +'\n ' Text +'title' Name +' ' Text +'"' Literal.String +'acid-state demo' Literal.String +'"' Literal.String +'\n ' Text +'body' Name +' ' Text +'$' Operator +' ' Text +'do' Keyword.Reserved +'\n ' Text +'form' Name +' ' Text +'!' Operator +' ' Text +'action' Name +' ' Text +'"' Literal.String +'/' Literal.String +'"' Literal.String +' ' Text +'!' Operator +' ' Text +'method' Name +' ' Text +'"' Literal.String +'POST' Literal.String +'"' Literal.String +' ' Text +'!' Operator +' ' Text +'enctype' Name +' ' Text +'"' Literal.String +'multipart/form-data' Literal.String +'"' Literal.String +' ' Text +'$' Operator +' ' Text +'do' Keyword.Reserved +'\n ' Text +'label' Name +' ' Text +'"' Literal.String +'new message: ' Literal.String +'"' Literal.String +' ' Text +'!' Operator +' ' Text +'for' Name +' ' Text +'"' Literal.String +'msg' Literal.String +'"' Literal.String +'\n ' Text +'input' Name +' ' Text +'!' Operator +' ' Text +'type_' Name +' ' Text +'"' Literal.String +'text' Literal.String +'"' Literal.String +' ' Text +'!' Operator +' ' Text +'id' Name +' ' Text +'"' Literal.String +'msg' Literal.String +'"' Literal.String +' ' Text +'!' Operator +' ' Text +'name' Name +' ' Text +'"' Literal.String +'greeting' Literal.String +'"' Literal.String +'\n ' Text +'input' Name +' ' Text +'!' Operator +' ' Text +'type_' Name +' ' Text +'"' Literal.String +'submit' Literal.String +'"' Literal.String +' ' Text +'!' Operator +' ' Text +'value' Name +' ' Text +'"' Literal.String +'update message' Literal.String +'"' Literal.String +'\n ' Text +'p' Name +' ' Text +'$' Operator +' ' Text +'toHtml' Name +' ' Text +'g' Name +'\n ' Text +'p' Name +' ' Text +'$' Operator +' ' Text +'do' Keyword.Reserved +' ' Text +'"' Literal.String +'This page has been loaded ' Literal.String +'"' Literal.String +' \n ' Text +'toHtml' Name +' ' Text +'c' Name +'\n ' Text +'"' Literal.String +' time(s).' Literal.String +'"' Literal.String +'\n ' Text +'where' Keyword.Reserved +'\n ' Text +'greet' Name +' ' Text +'=' Operator.Word +'\n ' Text +'do' Keyword.Reserved +' ' Text +'m' Name +' ' Text +'<-' Operator.Word +' ' Text +'rqMethod' Name +' ' Text +'<$>' Operator +' ' Text +'askRq' Name +'\n ' Text +'case' Keyword.Reserved +' ' Text +'m' Name +' ' Text +'of' Keyword.Reserved +'\n ' Text +'POST' Keyword.Type +' ' Text +'->' Operator.Word +' \n ' Text +'do' Keyword.Reserved +' ' Text +'decodeBody' Name +' ' Text +'(' Punctuation +'defaultBodyPolicy' Name +' ' Text +'"' Literal.String +'/tmp/' Literal.String +'"' Literal.String +' ' Text +'0' Literal.Number.Integer +' ' Text +'1000' Literal.Number.Integer +' ' Text +'1000' Literal.Number.Integer +')' Punctuation +'\n ' Text +'newGreeting' Name +' ' Text +'<-' Operator.Word +' ' Text +'lookText' Name +' ' Text +'"' Literal.String +'greeting' Literal.String +'"' Literal.String +'\n ' Text +'update' Name +' ' Text +'(' Punctuation +'SetGreeting' Keyword.Type +' ' Text +'newGreeting' Name +')' Punctuation +' ' Text +'-- ^ a GreetingState event' Comment.Single +'\n ' Text +'return' Name +' ' Text +'newGreeting' Name +'\n ' Text +'GET' Keyword.Type +' ' Text +'->' Operator.Word +' \n ' Text +'do' Keyword.Reserved +' ' Text +'query' Name +' ' Text +'GetGreeting' Keyword.Type +' ' Text +'-- ^ a GreetingState event' Comment.Single +'\n' Text + +'main' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'IO' Keyword.Type +' ' Text +'()' Name.Builtin +'\n' Text + +'main' Name.Function +' ' Text +'=' Operator.Word +'\n ' Text +'withAcid' Name +' ' Text +'Nothing' Keyword.Type +' ' Text +'$' Operator +' ' Text +'\\' Name.Function +'acid' Name +' ' Text +'->' Operator.Word +'\n ' Text +'simpleHTTP' Name +' ' Text +'nullConf' Name +' ' Text +'$' Operator +' ' Text +'runApp' Name +' ' Text +'acid' Name +' ' Text +'page' Name +'\n' Text + +'newtype' Keyword.Reserved +' ' Text +'FooState' Keyword.Type +' ' Text +'=' Operator.Word +' ' Text +'FooState' Keyword.Type +' ' Text +'{' Punctuation +' ' Text +'foo' Name +' ' Text +'::' Operator.Word +' ' Text +'Text' Keyword.Type +' ' Text +'}' Punctuation +'\n ' Text +'deriving' Keyword.Reserved +' ' Text +'(' Punctuation +'Eq' Keyword.Type +',' Punctuation +' ' Text +'Ord' Keyword.Type +',' Punctuation +' ' Text +'Data' Keyword.Type +',' Punctuation +' ' Text +'Typeable' Keyword.Type +',' Punctuation +' ' Text +'SafeCopy' Keyword.Type +')' Punctuation +'\n\n' Text + +'initialFooState' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'FooState' Keyword.Type +'\n' Text + +'initialFooState' Name.Function +' ' Text +'=' Operator.Word +' ' Text +'FooState' Keyword.Type +' ' Text +'{' Punctuation +' ' Text +'foo' Name +' ' Text +'=' Operator.Word +' ' Text +'"' Literal.String +'foo' Literal.String +'"' Literal.String +' ' Text +'}' Punctuation +'\n\n' Text + +'askFoo' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Query' Keyword.Type +' ' Text +'FooState' Keyword.Type +' ' Text +'Text' Keyword.Type +'\n' Text + +'askFoo' Name.Function +' ' Text +'=' Operator.Word +' ' Text +'foo' Name +' ' Text +'<$>' Operator +' ' Text +'ask' Name +'\n\n' Text + +'$' Operator +'(' Punctuation +'makeAcidic' Name +' ' Text +"''FooState" Keyword.Type +' ' Text +'[' Punctuation +"'askFoo" Name +']' Punctuation +')' Punctuation +'\n' Text + +'fooPlugin' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'(' Punctuation +'Happstack' Keyword.Type +' ' Text +'m' Name +',' Punctuation +' ' Text +'HasAcidState' Keyword.Type +' ' Text +'m' Name +' ' Text +'FooState' Keyword.Type +')' Punctuation +' ' Text +'=>' Operator.Word +' ' Text +'m' Name +' ' Text +'Response' Keyword.Type +'\n' Text + +'fooPlugin' Name.Function +' ' Text +'=' Operator.Word +'\n ' Text +'dir' Name +' ' Text +'"' Literal.String +'foo' Literal.String +'"' Literal.String +' ' Text +'$' Operator +' ' Text +'do' Keyword.Reserved +'\n ' Text +'txt' Name +' ' Text +'<-' Operator.Word +' ' Text +'query' Name +' ' Text +'AskFoo' Keyword.Type +'\n ' Text +'ok' Name +' ' Text +'$' Operator +' ' Text +'toResponse' Name +' ' Text +'txt' Name +'\n' Text + +'data' Keyword.Reserved +' ' Text +"Acid'" Keyword.Type +' ' Text +'=' Operator.Word +' ' Text +"Acid'" Keyword.Type +' ' Text +'{' Punctuation +' ' Text +"acidCountState'" Name +' ' Text +'::' Operator.Word +' ' Text +'AcidState' Keyword.Type +' ' Text +'CountState' Keyword.Type +'\n ' Text +',' Punctuation +' ' Text +"acidGreetingState'" Name +' ' Text +'::' Operator.Word +' ' Text +'AcidState' Keyword.Type +' ' Text +'GreetingState' Keyword.Type +'\n ' Text +',' Punctuation +' ' Text +"acidFooState'" Name +' ' Text +'::' Operator.Word +' ' Text +'AcidState' Keyword.Type +' ' Text +'FooState' Keyword.Type +'\n ' Text +'}' Punctuation +'\n' Text + +"withAcid'" Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Maybe' Keyword.Type +' ' Text +'FilePath' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'(' Punctuation +"Acid'" Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'IO' Keyword.Type +' ' Text +'a' Name +')' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'IO' Keyword.Type +' ' Text +'a' Name +'\n' Text + +"withAcid'" Name.Function +' ' Text +'mBasePath' Name +' ' Text +'action' Name +' ' Text +'=' Operator.Word +'\n ' Text +'let' Keyword.Reserved +' ' Text +'basePath' Name +' ' Text +'=' Operator.Word +' ' Text +'fromMaybe' Name +' ' Text +'"' Literal.String +'_state' Literal.String +'"' Literal.String +' ' Text +'mBasePath' Name +'\n ' Text +'in' Keyword.Reserved +' ' Text +'withLocalState' Name +' ' Text +'(' Punctuation +'Just' Keyword.Type +' ' Text +'$' Operator +' ' Text +'basePath' Name +' ' Text +'</>' Operator +' ' Text +'"' Literal.String +'count' Literal.String +'"' Literal.String +')' Punctuation +' ' Text +'initialCountState' Name +' ' Text +'$' Operator +' ' Text +'\\' Name.Function +'c' Name +' ' Text +'->' Operator.Word +'\n ' Text +'withLocalState' Name +' ' Text +'(' Punctuation +'Just' Keyword.Type +' ' Text +'$' Operator +' ' Text +'basePath' Name +' ' Text +'</>' Operator +' ' Text +'"' Literal.String +'greeting' Literal.String +'"' Literal.String +')' Punctuation +' ' Text +'initialGreetingState' Name +' ' Text +'$' Operator +' ' Text +'\\' Name.Function +'g' Name +' ' Text +'->' Operator.Word +'\n ' Text +'withLocalState' Name +' ' Text +'(' Punctuation +'Just' Keyword.Type +' ' Text +'$' Operator +' ' Text +'basePath' Name +' ' Text +'</>' Operator +' ' Text +'"' Literal.String +'foo' Literal.String +'"' Literal.String +')' Punctuation +' ' Text +'initialFooState' Name +' ' Text +'$' Operator +' ' Text +'\\' Name.Function +'f' Name +' ' Text +'->' Operator.Word +'\n ' Text +'action' Name +' ' Text +'(' Punctuation +"Acid'" Keyword.Type +' ' Text +'c' Name +' ' Text +'g' Name +' ' Text +'f' Name +')' Punctuation +'\n' Text + +'newtype' Keyword.Reserved +' ' Text +"App'" Keyword.Type +' ' Text +'a' Name +' ' Text +'=' Operator.Word +' ' Text +"App'" Keyword.Type +' ' Text +'{' Punctuation +' ' Text +"unApp'" Name +' ' Text +'::' Operator.Word +' ' Text +'ServerPartT' Keyword.Type +' ' Text +'(' Punctuation +'ReaderT' Keyword.Type +' ' Text +"Acid'" Keyword.Type +' ' Text +'IO' Keyword.Type +')' Punctuation +' ' Text +'a' Name +' ' Text +'}' Punctuation +'\n ' Text +'deriving' Keyword.Reserved +' ' Text +'(' Punctuation +' ' Text +'Functor' Keyword.Type +',' Punctuation +' ' Text +'Alternative' Keyword.Type +',' Punctuation +' ' Text +'Applicative' Keyword.Type +',' Punctuation +' ' Text +'Monad' Keyword.Type +',' Punctuation +' ' Text +'MonadPlus' Keyword.Type +',' Punctuation +' ' Text +'MonadIO' Keyword.Type +'\n ' Text +',' Punctuation +' ' Text +'HasRqData' Keyword.Type +',' Punctuation +' ' Text +'ServerMonad' Keyword.Type +' ' Text +',' Punctuation +'WebMonad' Keyword.Type +' ' Text +'Response' Keyword.Type +',' Punctuation +' ' Text +'FilterMonad' Keyword.Type +' ' Text +'Response' Keyword.Type +'\n ' Text +',' Punctuation +' ' Text +'Happstack' Keyword.Type +',' Punctuation +' ' Text +'MonadReader' Keyword.Type +' ' Text +"Acid'" Keyword.Type +')' Punctuation +'\n\n' Text + +'instance' Keyword.Reserved +' ' Text +'HasAcidState' Keyword.Type +' ' Text +"App'" Keyword.Type +' ' Text +'FooState' Keyword.Type +' ' Text +'where' Keyword.Reserved +'\n ' Text +'getAcidState' Name +' ' Text +'=' Operator.Word +' ' Text +"acidFooState'" Name +' ' Text +'<$>' Operator +' ' Text +'ask' Name +'\n' Text + +'fooAppPlugin' Name.Function +' ' Text +'::' Operator.Word +' ' Text +"App'" Keyword.Type +' ' Text +'Response' Keyword.Type +'\n' Text + +'fooAppPlugin' Name.Function +' ' Text +'=' Operator.Word +' ' Text +'fooPlugin' Name +'\n' Text + +'fooReaderPlugin' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'ReaderT' Keyword.Type +' ' Text +'(' Punctuation +'AcidState' Keyword.Type +' ' Text +'FooState' Keyword.Type +')' Punctuation +' ' Text +'(' Punctuation +'ServerPartT' Keyword.Type +' ' Text +'IO' Keyword.Type +')' Punctuation +' ' Text +'Response' Keyword.Type +'\n' Text + +'fooReaderPlugin' Name.Function +' ' Text +'=' Operator.Word +' ' Text +'fooPlugin' Name +'\n' Text + +'instance' Keyword.Reserved +' ' Text +'HasAcidState' Keyword.Type +' ' Text +'(' Punctuation +'ReaderT' Keyword.Type +' ' Text +'(' Punctuation +'AcidState' Keyword.Type +' ' Text +'FooState' Keyword.Type +')' Punctuation +' ' Text +'(' Punctuation +'ServerPartT' Keyword.Type +' ' Text +'IO' Keyword.Type +')' Punctuation +')' Punctuation +' ' Text +'FooState' Keyword.Type +' ' Text +'where' Keyword.Reserved +'\n ' Text +'getAcidState' Name +' ' Text +'=' Operator.Word +' ' Text +'ask' Name +'\n' Text + +'withFooPlugin' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'(' Punctuation +'MonadIO' Keyword.Type +' ' Text +'m' Name +',' Punctuation +' ' Text +'MonadBaseControl' Keyword.Type +' ' Text +'IO' Keyword.Type +' ' Text +'m' Name +')' Punctuation +' ' Text +'=>' Operator.Word +' \n ' Text +'FilePath' Keyword.Type +' ' Text +'-- ^ path to state directory' Comment.Single +'\n ' Text +'->' Operator.Word +' ' Text +'(' Punctuation +'ServerPartT' Keyword.Type +' ' Text +'IO' Keyword.Type +' ' Text +'Response' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'m' Name +' ' Text +'a' Name +')' Punctuation +' ' Text +'-- ^ function that uses fooPlugin' Comment.Single +'\n ' Text +'->' Operator.Word +' ' Text +'m' Name +' ' Text +'a' Name +'\n' Text + +'withFooPlugin' Name.Function +' ' Text +'basePath' Name +' ' Text +'f' Name +' ' Text +'=' Operator.Word +'\n ' Text +'do' Keyword.Reserved +' ' Text +'withLocalState' Name +' ' Text +'(' Punctuation +'Just' Keyword.Type +' ' Text +'$' Operator +' ' Text +'basePath' Name +' ' Text +'</>' Operator +' ' Text +'"' Literal.String +'foo' Literal.String +'"' Literal.String +')' Punctuation +' ' Text +'initialFooState' Name +' ' Text +'$' Operator +' ' Text +'\\' Name.Function +'fooState' Name +' ' Text +'->' Operator.Word +' \n ' Text +'f' Name +' ' Text +'$' Operator +' ' Text +'runReaderT' Name +' ' Text +'fooReaderPlugin' Name +' ' Text +'fooState' Name +'\n' Text + +"main'" Name.Function +' ' Text +'::' Operator.Word +' ' Text +'IO' Keyword.Type +' ' Text +'()' Name.Builtin +'\n' Text + +"main'" Name.Function +' ' Text +'=' Operator.Word +' \n ' Text +'withFooPlugin' Name +' ' Text +'"' Literal.String +'_state' Literal.String +'"' Literal.String +' ' Text +'$' Operator +' ' Text +'\\' Name.Function +"fooPlugin'" Name +' ' Text +'->' Operator.Word +'\n ' Text +'withAcid' Name +' ' Text +'Nothing' Keyword.Type +' ' Text +'$' Operator +' ' Text +'\\' Name.Function +'acid' Name +' ' Text +'->' Operator.Word +'\n ' Text +'simpleHTTP' Name +' ' Text +'nullConf' Name +' ' Text +'$' Operator +' ' Text +"fooPlugin'" Name +' ' Text +'`' Punctuation +'mplus' Name +'`' Punctuation +' ' Text +'runApp' Name +' ' Text +'acid' Name +' ' Text +'page' Name +'\n' Text diff --git a/tests/lexers/haskell/example2.txt b/tests/lexers/haskell/example2.txt new file mode 100644 index 00000000..c8024c37 --- /dev/null +++ b/tests/lexers/haskell/example2.txt @@ -0,0 +1,360 @@ +---input--- +module ĈrazyThings where + +import "base" Data.Char +import "base" Data.Char (isControl, isSpace) +import "base" Data.Char (isControl, --isSpace) + isSpace) +import "base" Data.Char (isControl, -- isSpace) + isSpace) + +(-->) :: Num a => a -- signature +(-->) = 2 -- >implementation + +--test comment +-- test comment + +main :: IO () +main = putStrLn "hello world" + +gádd x y = x + y +ádd x y = x + y + + +data ĈrazyThings = + Ĉar | + House | + Peár + deriving (Show, Eq) + +-- some char literals: + +charl = ['"', 'a', '\ESC', '\'', ' '] + +-- closed type families +type family Fam (a :: Type) = r :: Type where + Fam Int = True + Fam a = False + +-- type literals +type IntChar = '[Int, Char] +type Falsy = 'False +type Falsy = '(10, 20, 30) +type EmptyList = '[] +type TypeCons = 1 ': '[] +type Times = 1 '* 2 + +---tokens--- +'module' Keyword.Reserved +' ' Text +'ĈrazyThings' Name.Namespace +' ' Text +'where' Keyword.Reserved +'\n\n' Text + +'import' Keyword.Reserved +' ' Text +'"' Literal.String +'base' Literal.String +'"' Literal.String +' ' Text +'Data.Char' Name.Namespace +'\n' Text + +'import' Keyword.Reserved +' ' Text +'"' Literal.String +'base' Literal.String +'"' Literal.String +' ' Text +'Data.Char' Name.Namespace +' ' Text +'(' Punctuation +'isControl' Name.Function +',' Punctuation +' ' Text +'isSpace' Name.Function +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'"' Literal.String +'base' Literal.String +'"' Literal.String +' ' Text +'Data.Char' Name.Namespace +' ' Text +'(' Punctuation +'isControl' Name.Function +',' Punctuation +' ' Text +'--isSpace)' Comment.Single +'\n ' Text +'isSpace' Name.Function +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'"' Literal.String +'base' Literal.String +'"' Literal.String +' ' Text +'Data.Char' Name.Namespace +' ' Text +'(' Punctuation +'isControl' Name.Function +',' Punctuation +' ' Text +'-- isSpace)' Comment.Single +'\n ' Text +'isSpace' Name.Function +')' Punctuation +'\n\n' Text + +'(' Punctuation +'-->' Operator +')' Punctuation +' ' Text +'::' Operator.Word +' ' Text +'Num' Keyword.Type +' ' Text +'a' Name +' ' Text +'=>' Operator.Word +' ' Text +'a' Name +' ' Text +'-- signature' Comment.Single +'\n' Text + +'(' Punctuation +'-->' Operator +')' Punctuation +' ' Text +'=' Operator.Word +' ' Text +'2' Literal.Number.Integer +' ' Text +'-- >implementation' Comment.Single +'\n\n' Text + +'--test comment' Comment.Single +'\n' Text + +'-- test comment' Comment.Single +'\n\n' Text + +'main' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'IO' Keyword.Type +' ' Text +'()' Name.Builtin +'\n' Text + +'main' Name.Function +' ' Text +'=' Operator.Word +' ' Text +'putStrLn' Name +' ' Text +'"' Literal.String +'hello world' Literal.String +'"' Literal.String +'\n\n' Text + +'gádd' Name.Function +' ' Text +'x' Name +' ' Text +'y' Name +' ' Text +'=' Operator.Word +' ' Text +'x' Name +' ' Text +'+' Operator +' ' Text +'y' Name +'\n' Text + +'ádd' Name.Function +' ' Text +'x' Name +' ' Text +'y' Name +' ' Text +'=' Operator.Word +' ' Text +'x' Name +' ' Text +'+' Operator +' ' Text +'y' Name +'\n\n\n' Text + +'data' Keyword.Reserved +' ' Text +'ĈrazyThings' Keyword.Type +' ' Text +'=' Operator.Word +'\n ' Text +'Ĉar' Keyword.Type +' ' Text +'|' Operator +'\n ' Text +'House' Keyword.Type +' ' Text +'|' Operator +'\n ' Text +'Peár' Keyword.Type +'\n ' Text +'deriving' Keyword.Reserved +' ' Text +'(' Punctuation +'Show' Keyword.Type +',' Punctuation +' ' Text +'Eq' Keyword.Type +')' Punctuation +'\n\n' Text + +'-- some char literals:' Comment.Single +'\n\n' Text + +'charl' Name.Function +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +'\'"\'' Literal.String.Char +',' Punctuation +' ' Text +"'a'" Literal.String.Char +',' Punctuation +' ' Text +"'\\" Keyword.Type +"ESC'" Keyword.Type +',' Punctuation +' ' Text +"'\\" Keyword.Type +"'" Literal.String.Char +"'" Literal.String.Char +',' Punctuation +' ' Text +"' '" Literal.String.Char +']' Punctuation +'\n\n' Text + +'-- closed type families' Comment.Single +'\n' Text + +'type' Keyword.Reserved +' ' Text +'family' Keyword.Reserved +' ' Text +'Fam' Keyword.Type +' ' Text +'(' Punctuation +'a' Name +' ' Text +'::' Operator.Word +' ' Text +'Type' Keyword.Type +')' Punctuation +' ' Text +'=' Operator.Word +' ' Text +'r' Name +' ' Text +'::' Operator.Word +' ' Text +'Type' Keyword.Type +' ' Text +'where' Keyword.Reserved +'\n ' Text +'Fam' Keyword.Type +' ' Text +'Int' Keyword.Type +' ' Text +'=' Operator.Word +' ' Text +'True' Keyword.Type +'\n ' Text +'Fam' Keyword.Type +' ' Text +'a' Name +' ' Text +'=' Operator.Word +' ' Text +'False' Keyword.Type +'\n\n' Text + +'-- type literals' Comment.Single +'\n' Text + +'type' Keyword.Reserved +' ' Text +'IntChar' Keyword.Type +' ' Text +'=' Operator.Word +' ' Text +"'[Int, Char]" Keyword.Type +'\n' Text + +'type' Keyword.Reserved +' ' Text +'Falsy' Keyword.Type +' ' Text +'=' Operator.Word +' ' Text +"'False" Keyword.Type +'\n' Text + +'type' Keyword.Reserved +' ' Text +'Falsy' Keyword.Type +' ' Text +'=' Operator.Word +' ' Text +"'(10, 20, 30)" Keyword.Type +'\n' Text + +'type' Keyword.Reserved +' ' Text +'EmptyList' Keyword.Type +' ' Text +'=' Operator.Word +' ' Text +"'[]" Keyword.Type +'\n' Text + +'type' Keyword.Reserved +' ' Text +'TypeCons' Keyword.Type +' ' Text +'=' Operator.Word +' ' Text +'1' Literal.Number.Integer +' ' Text +"':" Keyword.Type +' ' Text +"'[]" Keyword.Type +'\n' Text + +'type' Keyword.Reserved +' ' Text +'Times' Keyword.Type +' ' Text +'=' Operator.Word +' ' Text +'1' Literal.Number.Integer +' ' Text +"'*" Keyword.Type +' ' Text +'2' Literal.Number.Integer +'\n' Text diff --git a/tests/lexers/haskell/example3.txt b/tests/lexers/haskell/example3.txt new file mode 100644 index 00000000..8246d11d --- /dev/null +++ b/tests/lexers/haskell/example3.txt @@ -0,0 +1,5019 @@ +---input--- +--------------------------------------------------------------------- +-- SmallCheck: another lightweight testing library. +-- Colin Runciman, August 2006 +-- Version 0.2 (November 2006) +-- +-- After QuickCheck, by Koen Claessen and John Hughes (2000-2004). +--------------------------------------------------------------------- + +module SmallCheck ( + smallCheck, depthCheck, + Property, Testable, + forAll, forAllElem, + exists, existsDeeperBy, thereExists, thereExistsElem, + (==>), + Series, Serial(..), + (\/), (><), two, three, four, + cons0, cons1, cons2, cons3, cons4, + alts0, alts1, alts2, alts3, alts4, + N(..), Nat, Natural, + depth, inc, dec + ) where + +import Data.List (intersperse) +import Control.Monad (when) +import System.IO (stdout, hFlush) + +------------------ <Series of depth-bounded values> ----------------- + +-- Series arguments should be interpreted as a depth bound (>=0) +-- Series results should have finite length + +type Series a = Int -> [a] + +-- sum +infixr 7 \/ +(\/) :: Series a -> Series a -> Series a +s1 \/ s2 = \d -> s1 d ++ s2 d + +-- product +infixr 8 >< +(><) :: Series a -> Series b -> Series (a,b) +s1 >< s2 = \d -> [(x,y) | x <- s1 d, y <- s2 d] + +------------------- <methods for type enumeration> ------------------ + +-- enumerated data values should be finite and fully defined +-- enumerated functional values should be total and strict + +-- bounds: +-- for data values, the depth of nested constructor applications +-- for functional values, both the depth of nested case analysis +-- and the depth of results + +class Serial a where + series :: Series a + coseries :: Serial b => Series (a->b) + +instance Serial () where + series _ = [()] + coseries d = [ \() -> b + | b <- series d ] + +instance Serial Int where + series d = [(-d)..d] + coseries d = [ \i -> if i > 0 then f (N (i - 1)) + else if i < 0 then g (N (abs i - 1)) + else z + | z <- alts0 d, f <- alts1 d, g <- alts1 d ] + +instance Serial Integer where + series d = [ toInteger (i :: Int) + | i <- series d ] + coseries d = [ f . (fromInteger :: Integer->Int) + | f <- series d ] + +newtype N a = N a + +instance Show a => Show (N a) where + show (N i) = show i + +instance (Integral a, Serial a) => Serial (N a) where + series d = map N [0..d'] + where + d' = fromInteger (toInteger d) + coseries d = [ \(N i) -> if i > 0 then f (N (i - 1)) + else z + | z <- alts0 d, f <- alts1 d ] + +type Nat = N Int +type Natural = N Integer + +instance Serial Float where + series d = [ encodeFloat sig exp + | (sig,exp) <- series d, + odd sig || sig==0 && exp==0 ] + coseries d = [ f . decodeFloat + | f <- series d ] + +instance Serial Double where + series d = [ frac (x :: Float) + | x <- series d ] + coseries d = [ f . (frac :: Double->Float) + | f <- series d ] + +frac :: (Real a, Fractional a, Real b, Fractional b) => a -> b +frac = fromRational . toRational + +instance Serial Char where + series d = take (d+1) ['a'..'z'] + coseries d = [ \c -> f (N (fromEnum c - fromEnum 'a')) + | f <- series d ] + +instance (Serial a, Serial b) => + Serial (a,b) where + series = series >< series + coseries = map uncurry . coseries + +instance (Serial a, Serial b, Serial c) => + Serial (a,b,c) where + series = \d -> [(a,b,c) | (a,(b,c)) <- series d] + coseries = map uncurry3 . coseries + +instance (Serial a, Serial b, Serial c, Serial d) => + Serial (a,b,c,d) where + series = \d -> [(a,b,c,d) | (a,(b,(c,d))) <- series d] + coseries = map uncurry4 . coseries + +uncurry3 :: (a->b->c->d) -> ((a,b,c)->d) +uncurry3 f (x,y,z) = f x y z + +uncurry4 :: (a->b->c->d->e) -> ((a,b,c,d)->e) +uncurry4 f (w,x,y,z) = f w x y z + +two :: Series a -> Series (a,a) +two s = s >< s + +three :: Series a -> Series (a,a,a) +three s = \d -> [(x,y,z) | (x,(y,z)) <- (s >< s >< s) d] + +four :: Series a -> Series (a,a,a,a) +four s = \d -> [(w,x,y,z) | (w,(x,(y,z))) <- (s >< s >< s >< s) d] + +cons0 :: + a -> Series a +cons0 c _ = [c] + +cons1 :: Serial a => + (a->b) -> Series b +cons1 c d = [c z | d > 0, z <- series (d-1)] + +cons2 :: (Serial a, Serial b) => + (a->b->c) -> Series c +cons2 c d = [c y z | d > 0, (y,z) <- series (d-1)] + +cons3 :: (Serial a, Serial b, Serial c) => + (a->b->c->d) -> Series d +cons3 c d = [c x y z | d > 0, (x,y,z) <- series (d-1)] + +cons4 :: (Serial a, Serial b, Serial c, Serial d) => + (a->b->c->d->e) -> Series e +cons4 c d = [c w x y z | d > 0, (w,x,y,z) <- series (d-1)] + +alts0 :: Serial a => + Series a +alts0 d = series d + +alts1 :: (Serial a, Serial b) => + Series (a->b) +alts1 d = if d > 0 then series (dec d) + else [\_ -> x | x <- series d] + +alts2 :: (Serial a, Serial b, Serial c) => + Series (a->b->c) +alts2 d = if d > 0 then series (dec d) + else [\_ _ -> x | x <- series d] + +alts3 :: (Serial a, Serial b, Serial c, Serial d) => + Series (a->b->c->d) +alts3 d = if d > 0 then series (dec d) + else [\_ _ _ -> x | x <- series d] + +alts4 :: (Serial a, Serial b, Serial c, Serial d, Serial e) => + Series (a->b->c->d->e) +alts4 d = if d > 0 then series (dec d) + else [\_ _ _ _ -> x | x <- series d] + +instance Serial Bool where + series = cons0 True \/ cons0 False + coseries d = [ \x -> if x then b1 else b2 + | (b1,b2) <- series d ] + +instance Serial a => Serial (Maybe a) where + series = cons0 Nothing \/ cons1 Just + coseries d = [ \m -> case m of + Nothing -> z + Just x -> f x + | z <- alts0 d , + f <- alts1 d ] + +instance (Serial a, Serial b) => Serial (Either a b) where + series = cons1 Left \/ cons1 Right + coseries d = [ \e -> case e of + Left x -> f x + Right y -> g y + | f <- alts1 d , + g <- alts1 d ] + +instance Serial a => Serial [a] where + series = cons0 [] \/ cons2 (:) + coseries d = [ \xs -> case xs of + [] -> y + (x:xs') -> f x xs' + | y <- alts0 d , + f <- alts2 d ] + +-- Warning: the coseries instance here may generate duplicates. +instance (Serial a, Serial b) => Serial (a->b) where + series = coseries + coseries d = [ \f -> g [f x | x <- series d] + | g <- series d ] + +-- For customising the depth measure. Use with care! + +depth :: Int -> Int -> Int +depth d d' | d >= 0 = d'+1-d + | otherwise = error "SmallCheck.depth: argument < 0" + +dec :: Int -> Int +dec d | d > 0 = d-1 + | otherwise = error "SmallCheck.dec: argument <= 0" + +inc :: Int -> Int +inc d = d+1 + +-- show the extension of a function (in part, bounded both by +-- the number and depth of arguments) +instance (Serial a, Show a, Show b) => Show (a->b) where + show f = + if maxarheight == 1 + && sumarwidth + length ars * length "->;" < widthLimit then + "{"++( + concat $ intersperse ";" $ [a++"->"++r | (a,r) <- ars] + )++"}" + else + concat $ [a++"->\n"++indent r | (a,r) <- ars] + where + ars = take lengthLimit [ (show x, show (f x)) + | x <- series depthLimit ] + maxarheight = maximum [ max (height a) (height r) + | (a,r) <- ars ] + sumarwidth = sum [ length a + length r + | (a,r) <- ars] + indent = unlines . map (" "++) . lines + height = length . lines + (widthLimit,lengthLimit,depthLimit) = (80,20,3)::(Int,Int,Int) + +---------------- <properties and their evaluation> ------------------ + +-- adapted from QuickCheck originals: here results come in lists, +-- properties have depth arguments, stamps (for classifying random +-- tests) are omitted, existentials are introduced + +newtype PR = Prop [Result] + +data Result = Result {ok :: Maybe Bool, arguments :: [String]} + +nothing :: Result +nothing = Result {ok = Nothing, arguments = []} + +result :: Result -> PR +result res = Prop [res] + +newtype Property = Property (Int -> PR) + +class Testable a where + property :: a -> Int -> PR + +instance Testable Bool where + property b _ = Prop [Result (Just b) []] + +instance Testable PR where + property prop _ = prop + +instance (Serial a, Show a, Testable b) => Testable (a->b) where + property f = f' where Property f' = forAll series f + +instance Testable Property where + property (Property f) d = f d + +evaluate :: Testable a => a -> Series Result +evaluate x d = rs where Prop rs = property x d + +forAll :: (Show a, Testable b) => Series a -> (a->b) -> Property +forAll xs f = Property $ \d -> Prop $ + [ r{arguments = show x : arguments r} + | x <- xs d, r <- evaluate (f x) d ] + +forAllElem :: (Show a, Testable b) => [a] -> (a->b) -> Property +forAllElem xs = forAll (const xs) + +thereExists :: Testable b => Series a -> (a->b) -> Property +thereExists xs f = Property $ \d -> Prop $ + [ Result + ( Just $ or [ all pass (evaluate (f x) d) + | x <- xs d ] ) + [] ] + where + pass (Result Nothing _) = True + pass (Result (Just b) _) = b + +thereExistsElem :: Testable b => [a] -> (a->b) -> Property +thereExistsElem xs = thereExists (const xs) + +exists :: (Serial a, Testable b) => + (a->b) -> Property +exists = thereExists series + +existsDeeperBy :: (Serial a, Testable b) => + (Int->Int) -> (a->b) -> Property +existsDeeperBy f = thereExists (series . f) + +infixr 0 ==> + +(==>) :: Testable a => Bool -> a -> Property +True ==> x = Property (property x) +False ==> x = Property (const (result nothing)) + +--------------------- <top-level test drivers> ---------------------- + +-- similar in spirit to QuickCheck but with iterative deepening + +-- test for values of depths 0..d stopping when a property +-- fails or when it has been checked for all these values +smallCheck :: Testable a => Int -> a -> IO String +smallCheck d = iterCheck 0 (Just d) + +depthCheck :: Testable a => Int -> a -> IO String +depthCheck d = iterCheck d (Just d) + +iterCheck :: Testable a => Int -> Maybe Int -> a -> IO String +iterCheck dFrom mdTo t = iter dFrom + where + iter :: Int -> IO String + iter d = do + let Prop results = property t d + (ok,s) <- check (mdTo==Nothing) 0 0 True results + maybe (iter (d+1)) + (\dTo -> if ok && d < dTo + then iter (d+1) + else return s) + mdTo + +check :: Bool -> Int -> Int -> Bool -> [Result] -> IO (Bool, String) +check i n x ok rs | null rs = do + let s = " Completed "++show n++" test(s)" + y = if i then "." else " without failure." + z | x > 0 = " But "++show x++" did not meet ==> condition." + | otherwise = "" + return (ok, s ++ y ++ z) + +check i n x ok (Result Nothing _ : rs) = do + progressReport i n x + check i (n+1) (x+1) ok rs + +check i n x f (Result (Just True) _ : rs) = do + progressReport i n x + check i (n+1) x f rs + +check i n x f (Result (Just False) args : rs) = do + let s = " Failed test no. "++show (n+1)++". Test values follow." + s' = s ++ ": " ++ concat (intersperse ", " args) + if i then + check i (n+1) x False rs + else + return (False, s') + +progressReport :: Bool -> Int -> Int -> IO () +progressReport _ _ _ = return () + +---tokens--- +'---------------------------------------------------------------------' Comment.Single +'\n' Text + +'-- SmallCheck: another lightweight testing library.' Comment.Single +'\n' Text + +'-- Colin Runciman, August 2006' Comment.Single +'\n' Text + +'-- Version 0.2 (November 2006)' Comment.Single +'\n' Text + +'--' Comment.Single +'\n' Text + +'-- After QuickCheck, by Koen Claessen and John Hughes (2000-2004).' Comment.Single +'\n' Text + +'---------------------------------------------------------------------' Comment.Single +'\n\n' Text + +'module' Keyword.Reserved +' ' Text +'SmallCheck' Name.Namespace +' ' Text +'(' Punctuation +'\n ' Text +'smallCheck' Name.Function +',' Punctuation +' ' Text +'depthCheck' Name.Function +',' Punctuation +'\n ' Text +'Property' Keyword.Type +',' Punctuation +' ' Text +'Testable' Keyword.Type +',' Punctuation +'\n ' Text +'forAll' Name.Function +',' Punctuation +' ' Text +'forAllElem' Name.Function +',' Punctuation +'\n ' Text +'exists' Name.Function +',' Punctuation +' ' Text +'existsDeeperBy' Name.Function +',' Punctuation +' ' Text +'thereExists' Name.Function +',' Punctuation +' ' Text +'thereExistsElem' Name.Function +',' Punctuation +'\n ' Text +'(' Punctuation +'==>' Operator +')' Punctuation +',' Punctuation +'\n ' Text +'Series' Keyword.Type +',' Punctuation +' ' Text +'Serial' Keyword.Type +'(' Punctuation +'..' Operator +')' Punctuation +',' Punctuation +'\n ' Text +'(' Punctuation +'\\/' Operator +')' Punctuation +',' Punctuation +' ' Text +'(' Punctuation +'><' Operator +')' Punctuation +',' Punctuation +' ' Text +'two' Name.Function +',' Punctuation +' ' Text +'three' Name.Function +',' Punctuation +' ' Text +'four' Name.Function +',' Punctuation +'\n ' Text +'cons0' Name.Function +',' Punctuation +' ' Text +'cons1' Name.Function +',' Punctuation +' ' Text +'cons2' Name.Function +',' Punctuation +' ' Text +'cons3' Name.Function +',' Punctuation +' ' Text +'cons4' Name.Function +',' Punctuation +'\n ' Text +'alts0' Name.Function +',' Punctuation +' ' Text +'alts1' Name.Function +',' Punctuation +' ' Text +'alts2' Name.Function +',' Punctuation +' ' Text +'alts3' Name.Function +',' Punctuation +' ' Text +'alts4' Name.Function +',' Punctuation +'\n ' Text +'N' Keyword.Type +'(' Punctuation +'..' Operator +')' Punctuation +',' Punctuation +' ' Text +'Nat' Keyword.Type +',' Punctuation +' ' Text +'Natural' Keyword.Type +',' Punctuation +'\n ' Text +'depth' Name.Function +',' Punctuation +' ' Text +'inc' Name.Function +',' Punctuation +' ' Text +'dec' Name.Function +'\n ' Text +')' Punctuation +' ' Text +'where' Keyword.Reserved +'\n\n' Text + +'import' Keyword.Reserved +' ' Text +'Data.List' Name.Namespace +' ' Text +'(' Punctuation +'intersperse' Name.Function +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'Control.Monad' Name.Namespace +' ' Text +'(' Punctuation +'when' Name.Function +')' Punctuation +'\n' Text + +'import' Keyword.Reserved +' ' Text +'System.IO' Name.Namespace +' ' Text +'(' Punctuation +'stdout' Name.Function +',' Punctuation +' ' Text +'hFlush' Name.Function +')' Punctuation +'\n\n' Text + +'------------------ <Series of depth-bounded values> -----------------' Comment.Single +'\n\n' Text + +'-- Series arguments should be interpreted as a depth bound (>=0)' Comment.Single +'\n' Text + +'-- Series results should have finite length' Comment.Single +'\n\n' Text + +'type' Keyword.Reserved +' ' Text +'Series' Keyword.Type +' ' Text +'a' Name +' ' Text +'=' Operator.Word +' ' Text +'Int' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'[' Punctuation +'a' Name +']' Punctuation +'\n\n' Text + +'-- sum' Comment.Single +'\n' Text + +'infixr' Keyword.Reserved +' ' Text +'7' Literal.Number.Integer +' ' Text +'\\/' Operator +'\n' Text + +'(' Punctuation +'\\/' Operator +')' Punctuation +' ' Text +'::' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'a' Name +' ' Text +'->' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'a' Name +' ' Text +'->' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'a' Name +'\n' Text + +'s1' Name.Function +' ' Text +'\\/' Operator +' ' Text +'s2' Name +' ' Text +'=' Operator.Word +' ' Text +'\\' Name.Function +'d' Name +' ' Text +'->' Operator.Word +' ' Text +'s1' Name +' ' Text +'d' Name +' ' Text +'++' Operator +' ' Text +'s2' Name +' ' Text +'d' Name +'\n\n' Text + +'-- product' Comment.Single +'\n' Text + +'infixr' Keyword.Reserved +' ' Text +'8' Literal.Number.Integer +' ' Text +'><' Operator +'\n' Text + +'(' Punctuation +'><' Operator +')' Punctuation +' ' Text +'::' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'a' Name +' ' Text +'->' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'b' Name +' ' Text +'->' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'(' Punctuation +'a' Name +',' Punctuation +'b' Name +')' Punctuation +'\n' Text + +'s1' Name.Function +' ' Text +'><' Operator +' ' Text +'s2' Name +' ' Text +'=' Operator.Word +' ' Text +'\\' Name.Function +'d' Name +' ' Text +'->' Operator.Word +' ' Text +'[' Punctuation +'(' Punctuation +'x' Name +',' Punctuation +'y' Name +')' Punctuation +' ' Text +'|' Operator +' ' Text +'x' Name +' ' Text +'<-' Operator.Word +' ' Text +'s1' Name +' ' Text +'d' Name +',' Punctuation +' ' Text +'y' Name +' ' Text +'<-' Operator.Word +' ' Text +'s2' Name +' ' Text +'d' Name +']' Punctuation +'\n\n' Text + +'------------------- <methods for type enumeration> ------------------' Comment.Single +'\n\n' Text + +'-- enumerated data values should be finite and fully defined' Comment.Single +'\n' Text + +'-- enumerated functional values should be total and strict' Comment.Single +'\n\n' Text + +'-- bounds:' Comment.Single +'\n' Text + +'-- for data values, the depth of nested constructor applications' Comment.Single +'\n' Text + +'-- for functional values, both the depth of nested case analysis' Comment.Single +'\n' Text + +'-- and the depth of results' Comment.Single +'\n \n' Text + +'class' Keyword.Reserved +' ' Text +'Serial' Keyword.Type +' ' Text +'a' Name +' ' Text +'where' Keyword.Reserved +'\n ' Text +'series' Name +' ' Text +'::' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'a' Name +'\n ' Text +'coseries' Name +' ' Text +'::' Operator.Word +' ' Text +'Serial' Keyword.Type +' ' Text +'b' Name +' ' Text +'=>' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +')' Punctuation +'\n\n' Text + +'instance' Keyword.Reserved +' ' Text +'Serial' Keyword.Type +' ' Text +'()' Name.Builtin +' ' Text +'where' Keyword.Reserved +'\n ' Text +'series' Name +' ' Text +'_' Keyword.Reserved +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +'()' Name.Builtin +']' Punctuation +'\n ' Text +'coseries' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +' ' Text +'\\' Name.Function +'()' Name.Builtin +' ' Text +'->' Operator.Word +' ' Text +'b' Name +'\n ' Text +'|' Operator +' ' Text +'b' Name +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'d' Name +' ' Text +']' Punctuation +'\n\n' Text + +'instance' Keyword.Reserved +' ' Text +'Serial' Keyword.Type +' ' Text +'Int' Keyword.Type +' ' Text +'where' Keyword.Reserved +'\n ' Text +'series' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +'(' Punctuation +'-' Operator +'d' Name +')' Punctuation +'..' Operator +'d' Name +']' Punctuation +'\n ' Text +'coseries' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +' ' Text +'\\' Name.Function +'i' Name +' ' Text +'->' Operator.Word +' ' Text +'if' Keyword.Reserved +' ' Text +'i' Name +' ' Text +'>' Operator +' ' Text +'0' Literal.Number.Integer +' ' Text +'then' Keyword.Reserved +' ' Text +'f' Name +' ' Text +'(' Punctuation +'N' Keyword.Type +' ' Text +'(' Punctuation +'i' Name +' ' Text +'-' Operator +' ' Text +'1' Literal.Number.Integer +')' Punctuation +')' Punctuation +'\n ' Text +'else' Keyword.Reserved +' ' Text +'if' Keyword.Reserved +' ' Text +'i' Name +' ' Text +'<' Operator +' ' Text +'0' Literal.Number.Integer +' ' Text +'then' Keyword.Reserved +' ' Text +'g' Name +' ' Text +'(' Punctuation +'N' Keyword.Type +' ' Text +'(' Punctuation +'abs' Name +' ' Text +'i' Name +' ' Text +'-' Operator +' ' Text +'1' Literal.Number.Integer +')' Punctuation +')' Punctuation +'\n ' Text +'else' Keyword.Reserved +' ' Text +'z' Name +'\n ' Text +'|' Operator +' ' Text +'z' Name +' ' Text +'<-' Operator.Word +' ' Text +'alts0' Name +' ' Text +'d' Name +',' Punctuation +' ' Text +'f' Name +' ' Text +'<-' Operator.Word +' ' Text +'alts1' Name +' ' Text +'d' Name +',' Punctuation +' ' Text +'g' Name +' ' Text +'<-' Operator.Word +' ' Text +'alts1' Name +' ' Text +'d' Name +' ' Text +']' Punctuation +'\n\n' Text + +'instance' Keyword.Reserved +' ' Text +'Serial' Keyword.Type +' ' Text +'Integer' Keyword.Type +' ' Text +'where' Keyword.Reserved +'\n ' Text +'series' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +' ' Text +'toInteger' Name +' ' Text +'(' Punctuation +'i' Name +' ' Text +'::' Operator.Word +' ' Text +'Int' Keyword.Type +')' Punctuation +'\n ' Text +'|' Operator +' ' Text +'i' Name +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'d' Name +' ' Text +']' Punctuation +'\n ' Text +'coseries' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +' ' Text +'f' Name +' ' Text +'.' Operator +' ' Text +'(' Punctuation +'fromInteger' Name +' ' Text +'::' Operator.Word +' ' Text +'Integer' Keyword.Type +'->' Operator.Word +'Int' Keyword.Type +')' Punctuation +'\n ' Text +'|' Operator +' ' Text +'f' Name +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'d' Name +' ' Text +']' Punctuation +'\n\n' Text + +'newtype' Keyword.Reserved +' ' Text +'N' Keyword.Type +' ' Text +'a' Name +' ' Text +'=' Operator.Word +' ' Text +'N' Keyword.Type +' ' Text +'a' Name +'\n\n' Text + +'instance' Keyword.Reserved +' ' Text +'Show' Keyword.Type +' ' Text +'a' Name +' ' Text +'=>' Operator.Word +' ' Text +'Show' Keyword.Type +' ' Text +'(' Punctuation +'N' Keyword.Type +' ' Text +'a' Name +')' Punctuation +' ' Text +'where' Keyword.Reserved +'\n ' Text +'show' Name +' ' Text +'(' Punctuation +'N' Keyword.Type +' ' Text +'i' Name +')' Punctuation +' ' Text +'=' Operator.Word +' ' Text +'show' Name +' ' Text +'i' Name +'\n\n' Text + +'instance' Keyword.Reserved +' ' Text +'(' Punctuation +'Integral' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'a' Name +')' Punctuation +' ' Text +'=>' Operator.Word +' ' Text +'Serial' Keyword.Type +' ' Text +'(' Punctuation +'N' Keyword.Type +' ' Text +'a' Name +')' Punctuation +' ' Text +'where' Keyword.Reserved +'\n ' Text +'series' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'map' Name +' ' Text +'N' Keyword.Type +' ' Text +'[' Punctuation +'0' Literal.Number.Integer +'..' Operator +"d'" Name +']' Punctuation +'\n ' Text +'where' Keyword.Reserved +'\n ' Text +"d'" Name +' ' Text +'=' Operator.Word +' ' Text +'fromInteger' Name +' ' Text +'(' Punctuation +'toInteger' Name +' ' Text +'d' Name +')' Punctuation +'\n ' Text +'coseries' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +' ' Text +'\\' Name.Function +'(' Punctuation +'N' Keyword.Type +' ' Text +'i' Name +')' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'if' Keyword.Reserved +' ' Text +'i' Name +' ' Text +'>' Operator +' ' Text +'0' Literal.Number.Integer +' ' Text +'then' Keyword.Reserved +' ' Text +'f' Name +' ' Text +'(' Punctuation +'N' Keyword.Type +' ' Text +'(' Punctuation +'i' Name +' ' Text +'-' Operator +' ' Text +'1' Literal.Number.Integer +')' Punctuation +')' Punctuation +'\n ' Text +'else' Keyword.Reserved +' ' Text +'z' Name +'\n ' Text +'|' Operator +' ' Text +'z' Name +' ' Text +'<-' Operator.Word +' ' Text +'alts0' Name +' ' Text +'d' Name +',' Punctuation +' ' Text +'f' Name +' ' Text +'<-' Operator.Word +' ' Text +'alts1' Name +' ' Text +'d' Name +' ' Text +']' Punctuation +'\n\n' Text + +'type' Keyword.Reserved +' ' Text +'Nat' Keyword.Type +' ' Text +'=' Operator.Word +' ' Text +'N' Keyword.Type +' ' Text +'Int' Keyword.Type +'\n' Text + +'type' Keyword.Reserved +' ' Text +'Natural' Keyword.Type +' ' Text +'=' Operator.Word +' ' Text +'N' Keyword.Type +' ' Text +'Integer' Keyword.Type +'\n\n' Text + +'instance' Keyword.Reserved +' ' Text +'Serial' Keyword.Type +' ' Text +'Float' Keyword.Type +' ' Text +'where' Keyword.Reserved +'\n ' Text +'series' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +' ' Text +'encodeFloat' Name +' ' Text +'sig' Name +' ' Text +'exp' Name +'\n ' Text +'|' Operator +' ' Text +'(' Punctuation +'sig' Name +',' Punctuation +'exp' Name +')' Punctuation +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'d' Name +',' Punctuation +'\n ' Text +'odd' Name +' ' Text +'sig' Name +' ' Text +'||' Operator +' ' Text +'sig' Name +'==' Operator +'0' Literal.Number.Integer +' ' Text +'&&' Operator +' ' Text +'exp' Name +'==' Operator +'0' Literal.Number.Integer +' ' Text +']' Punctuation +'\n ' Text +'coseries' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +' ' Text +'f' Name +' ' Text +'.' Operator +' ' Text +'decodeFloat' Name +'\n ' Text +'|' Operator +' ' Text +'f' Name +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'d' Name +' ' Text +']' Punctuation +'\n \n' Text + +'instance' Keyword.Reserved +' ' Text +'Serial' Keyword.Type +' ' Text +'Double' Keyword.Type +' ' Text +'where' Keyword.Reserved +'\n ' Text +'series' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +' ' Text +'frac' Name +' ' Text +'(' Punctuation +'x' Name +' ' Text +'::' Operator.Word +' ' Text +'Float' Keyword.Type +')' Punctuation +'\n ' Text +'|' Operator +' ' Text +'x' Name +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'d' Name +' ' Text +']' Punctuation +'\n ' Text +'coseries' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +' ' Text +'f' Name +' ' Text +'.' Operator +' ' Text +'(' Punctuation +'frac' Name +' ' Text +'::' Operator.Word +' ' Text +'Double' Keyword.Type +'->' Operator.Word +'Float' Keyword.Type +')' Punctuation +'\n ' Text +'|' Operator +' ' Text +'f' Name +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'d' Name +' ' Text +']' Punctuation +'\n\n' Text + +'frac' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'(' Punctuation +'Real' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Fractional' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Real' Keyword.Type +' ' Text +'b' Name +',' Punctuation +' ' Text +'Fractional' Keyword.Type +' ' Text +'b' Name +')' Punctuation +' ' Text +'=>' Operator.Word +' ' Text +'a' Name +' ' Text +'->' Operator.Word +' ' Text +'b' Name +'\n' Text + +'frac' Name.Function +' ' Text +'=' Operator.Word +' ' Text +'fromRational' Name +' ' Text +'.' Operator +' ' Text +'toRational' Name +'\n\n' Text + +'instance' Keyword.Reserved +' ' Text +'Serial' Keyword.Type +' ' Text +'Char' Keyword.Type +' ' Text +'where' Keyword.Reserved +'\n ' Text +'series' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'take' Name +' ' Text +'(' Punctuation +'d' Name +'+' Operator +'1' Literal.Number.Integer +')' Punctuation +' ' Text +'[' Punctuation +"'a'" Literal.String.Char +'..' Operator +"'z'" Literal.String.Char +']' Punctuation +'\n ' Text +'coseries' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +' ' Text +'\\' Name.Function +'c' Name +' ' Text +'->' Operator.Word +' ' Text +'f' Name +' ' Text +'(' Punctuation +'N' Keyword.Type +' ' Text +'(' Punctuation +'fromEnum' Name +' ' Text +'c' Name +' ' Text +'-' Operator +' ' Text +'fromEnum' Name +' ' Text +"'a'" Literal.String.Char +')' Punctuation +')' Punctuation +'\n ' Text +'|' Operator +' ' Text +'f' Name +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'d' Name +' ' Text +']' Punctuation +'\n\n' Text + +'instance' Keyword.Reserved +' ' Text +'(' Punctuation +'Serial' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'b' Name +')' Punctuation +' ' Text +'=>' Operator.Word +'\n ' Text +'Serial' Keyword.Type +' ' Text +'(' Punctuation +'a' Name +',' Punctuation +'b' Name +')' Punctuation +' ' Text +'where' Keyword.Reserved +'\n ' Text +'series' Name +' ' Text +'=' Operator.Word +' ' Text +'series' Name +' ' Text +'><' Operator +' ' Text +'series' Name +'\n ' Text +'coseries' Name +' ' Text +'=' Operator.Word +' ' Text +'map' Name +' ' Text +'uncurry' Name +' ' Text +'.' Operator +' ' Text +'coseries' Name +'\n\n' Text + +'instance' Keyword.Reserved +' ' Text +'(' Punctuation +'Serial' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'b' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'c' Name +')' Punctuation +' ' Text +'=>' Operator.Word +'\n ' Text +'Serial' Keyword.Type +' ' Text +'(' Punctuation +'a' Name +',' Punctuation +'b' Name +',' Punctuation +'c' Name +')' Punctuation +' ' Text +'where' Keyword.Reserved +'\n ' Text +'series' Name +' ' Text +'=' Operator.Word +' ' Text +'\\' Name.Function +'d' Name +' ' Text +'->' Operator.Word +' ' Text +'[' Punctuation +'(' Punctuation +'a' Name +',' Punctuation +'b' Name +',' Punctuation +'c' Name +')' Punctuation +' ' Text +'|' Operator +' ' Text +'(' Punctuation +'a' Name +',' Punctuation +'(' Punctuation +'b' Name +',' Punctuation +'c' Name +')' Punctuation +')' Punctuation +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'d' Name +']' Punctuation +'\n ' Text +'coseries' Name +' ' Text +'=' Operator.Word +' ' Text +'map' Name +' ' Text +'uncurry3' Name +' ' Text +'.' Operator +' ' Text +'coseries' Name +'\n\n' Text + +'instance' Keyword.Reserved +' ' Text +'(' Punctuation +'Serial' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'b' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'c' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'d' Name +')' Punctuation +' ' Text +'=>' Operator.Word +'\n ' Text +'Serial' Keyword.Type +' ' Text +'(' Punctuation +'a' Name +',' Punctuation +'b' Name +',' Punctuation +'c' Name +',' Punctuation +'d' Name +')' Punctuation +' ' Text +'where' Keyword.Reserved +'\n ' Text +'series' Name +' ' Text +'=' Operator.Word +' ' Text +'\\' Name.Function +'d' Name +' ' Text +'->' Operator.Word +' ' Text +'[' Punctuation +'(' Punctuation +'a' Name +',' Punctuation +'b' Name +',' Punctuation +'c' Name +',' Punctuation +'d' Name +')' Punctuation +' ' Text +'|' Operator +' ' Text +'(' Punctuation +'a' Name +',' Punctuation +'(' Punctuation +'b' Name +',' Punctuation +'(' Punctuation +'c' Name +',' Punctuation +'d' Name +')' Punctuation +')' Punctuation +')' Punctuation +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'d' Name +']' Punctuation +'\n ' Text +'coseries' Name +' ' Text +'=' Operator.Word +' ' Text +'map' Name +' ' Text +'uncurry4' Name +' ' Text +'.' Operator +' ' Text +'coseries' Name +'\n\n' Text + +'uncurry3' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +'->' Operator.Word +'c' Name +'->' Operator.Word +'d' Name +')' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'(' Punctuation +'(' Punctuation +'a' Name +',' Punctuation +'b' Name +',' Punctuation +'c' Name +')' Punctuation +'->' Operator.Word +'d' Name +')' Punctuation +'\n' Text + +'uncurry3' Name.Function +' ' Text +'f' Name +' ' Text +'(' Punctuation +'x' Name +',' Punctuation +'y' Name +',' Punctuation +'z' Name +')' Punctuation +' ' Text +'=' Operator.Word +' ' Text +'f' Name +' ' Text +'x' Name +' ' Text +'y' Name +' ' Text +'z' Name +'\n\n' Text + +'uncurry4' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +'->' Operator.Word +'c' Name +'->' Operator.Word +'d' Name +'->' Operator.Word +'e' Name +')' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'(' Punctuation +'(' Punctuation +'a' Name +',' Punctuation +'b' Name +',' Punctuation +'c' Name +',' Punctuation +'d' Name +')' Punctuation +'->' Operator.Word +'e' Name +')' Punctuation +'\n' Text + +'uncurry4' Name.Function +' ' Text +'f' Name +' ' Text +'(' Punctuation +'w' Name +',' Punctuation +'x' Name +',' Punctuation +'y' Name +',' Punctuation +'z' Name +')' Punctuation +' ' Text +'=' Operator.Word +' ' Text +'f' Name +' ' Text +'w' Name +' ' Text +'x' Name +' ' Text +'y' Name +' ' Text +'z' Name +'\n\n' Text + +'two' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'a' Name +' ' Text +'->' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'(' Punctuation +'a' Name +',' Punctuation +'a' Name +')' Punctuation +'\n' Text + +'two' Name.Function +' ' Text +'s' Name +' ' Text +'=' Operator.Word +' ' Text +'s' Name +' ' Text +'><' Operator +' ' Text +'s' Name +'\n\n' Text + +'three' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'a' Name +' ' Text +'->' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'(' Punctuation +'a' Name +',' Punctuation +'a' Name +',' Punctuation +'a' Name +')' Punctuation +'\n' Text + +'three' Name.Function +' ' Text +'s' Name +' ' Text +'=' Operator.Word +' ' Text +'\\' Name.Function +'d' Name +' ' Text +'->' Operator.Word +' ' Text +'[' Punctuation +'(' Punctuation +'x' Name +',' Punctuation +'y' Name +',' Punctuation +'z' Name +')' Punctuation +' ' Text +'|' Operator +' ' Text +'(' Punctuation +'x' Name +',' Punctuation +'(' Punctuation +'y' Name +',' Punctuation +'z' Name +')' Punctuation +')' Punctuation +' ' Text +'<-' Operator.Word +' ' Text +'(' Punctuation +'s' Name +' ' Text +'><' Operator +' ' Text +'s' Name +' ' Text +'><' Operator +' ' Text +'s' Name +')' Punctuation +' ' Text +'d' Name +']' Punctuation +'\n\n' Text + +'four' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'a' Name +' ' Text +'->' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'(' Punctuation +'a' Name +',' Punctuation +'a' Name +',' Punctuation +'a' Name +',' Punctuation +'a' Name +')' Punctuation +'\n' Text + +'four' Name.Function +' ' Text +'s' Name +' ' Text +'=' Operator.Word +' ' Text +'\\' Name.Function +'d' Name +' ' Text +'->' Operator.Word +' ' Text +'[' Punctuation +'(' Punctuation +'w' Name +',' Punctuation +'x' Name +',' Punctuation +'y' Name +',' Punctuation +'z' Name +')' Punctuation +' ' Text +'|' Operator +' ' Text +'(' Punctuation +'w' Name +',' Punctuation +'(' Punctuation +'x' Name +',' Punctuation +'(' Punctuation +'y' Name +',' Punctuation +'z' Name +')' Punctuation +')' Punctuation +')' Punctuation +' ' Text +'<-' Operator.Word +' ' Text +'(' Punctuation +'s' Name +' ' Text +'><' Operator +' ' Text +'s' Name +' ' Text +'><' Operator +' ' Text +'s' Name +' ' Text +'><' Operator +' ' Text +'s' Name +')' Punctuation +' ' Text +'d' Name +']' Punctuation +'\n\n' Text + +'cons0' Name.Function +' ' Text +'::' Operator.Word +' \n ' Text +'a' Name +' ' Text +'->' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'a' Name +'\n' Text + +'cons0' Name.Function +' ' Text +'c' Name +' ' Text +'_' Keyword.Reserved +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +'c' Name +']' Punctuation +'\n\n' Text + +'cons1' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Serial' Keyword.Type +' ' Text +'a' Name +' ' Text +'=>' Operator.Word +'\n ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +')' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'b' Name +'\n' Text + +'cons1' Name.Function +' ' Text +'c' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +'c' Name +' ' Text +'z' Name +' ' Text +'|' Operator +' ' Text +'d' Name +' ' Text +'>' Operator +' ' Text +'0' Literal.Number.Integer +',' Punctuation +' ' Text +'z' Name +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'(' Punctuation +'d' Name +'-' Operator +'1' Literal.Number.Integer +')' Punctuation +']' Punctuation +'\n\n' Text + +'cons2' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'(' Punctuation +'Serial' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'b' Name +')' Punctuation +' ' Text +'=>' Operator.Word +'\n ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +'->' Operator.Word +'c' Name +')' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'c' Name +'\n' Text + +'cons2' Name.Function +' ' Text +'c' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +'c' Name +' ' Text +'y' Name +' ' Text +'z' Name +' ' Text +'|' Operator +' ' Text +'d' Name +' ' Text +'>' Operator +' ' Text +'0' Literal.Number.Integer +',' Punctuation +' ' Text +'(' Punctuation +'y' Name +',' Punctuation +'z' Name +')' Punctuation +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'(' Punctuation +'d' Name +'-' Operator +'1' Literal.Number.Integer +')' Punctuation +']' Punctuation +'\n\n' Text + +'cons3' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'(' Punctuation +'Serial' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'b' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'c' Name +')' Punctuation +' ' Text +'=>' Operator.Word +'\n ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +'->' Operator.Word +'c' Name +'->' Operator.Word +'d' Name +')' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'d' Name +'\n' Text + +'cons3' Name.Function +' ' Text +'c' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +'c' Name +' ' Text +'x' Name +' ' Text +'y' Name +' ' Text +'z' Name +' ' Text +'|' Operator +' ' Text +'d' Name +' ' Text +'>' Operator +' ' Text +'0' Literal.Number.Integer +',' Punctuation +' ' Text +'(' Punctuation +'x' Name +',' Punctuation +'y' Name +',' Punctuation +'z' Name +')' Punctuation +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'(' Punctuation +'d' Name +'-' Operator +'1' Literal.Number.Integer +')' Punctuation +']' Punctuation +'\n\n' Text + +'cons4' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'(' Punctuation +'Serial' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'b' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'c' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'d' Name +')' Punctuation +' ' Text +'=>' Operator.Word +'\n ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +'->' Operator.Word +'c' Name +'->' Operator.Word +'d' Name +'->' Operator.Word +'e' Name +')' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'e' Name +'\n' Text + +'cons4' Name.Function +' ' Text +'c' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +'c' Name +' ' Text +'w' Name +' ' Text +'x' Name +' ' Text +'y' Name +' ' Text +'z' Name +' ' Text +'|' Operator +' ' Text +'d' Name +' ' Text +'>' Operator +' ' Text +'0' Literal.Number.Integer +',' Punctuation +' ' Text +'(' Punctuation +'w' Name +',' Punctuation +'x' Name +',' Punctuation +'y' Name +',' Punctuation +'z' Name +')' Punctuation +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'(' Punctuation +'d' Name +'-' Operator +'1' Literal.Number.Integer +')' Punctuation +']' Punctuation +'\n\n' Text + +'alts0' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Serial' Keyword.Type +' ' Text +'a' Name +' ' Text +'=>' Operator.Word +'\n ' Text +'Series' Keyword.Type +' ' Text +'a' Name +'\n' Text + +'alts0' Name.Function +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'series' Name +' ' Text +'d' Name +'\n\n' Text + +'alts1' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'(' Punctuation +'Serial' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'b' Name +')' Punctuation +' ' Text +'=>' Operator.Word +'\n ' Text +'Series' Keyword.Type +' ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +')' Punctuation +'\n' Text + +'alts1' Name.Function +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'if' Keyword.Reserved +' ' Text +'d' Name +' ' Text +'>' Operator +' ' Text +'0' Literal.Number.Integer +' ' Text +'then' Keyword.Reserved +' ' Text +'series' Name +' ' Text +'(' Punctuation +'dec' Name +' ' Text +'d' Name +')' Punctuation +'\n ' Text +'else' Keyword.Reserved +' ' Text +'[' Punctuation +'\\' Name.Function +'_' Keyword.Reserved +' ' Text +'->' Operator.Word +' ' Text +'x' Name +' ' Text +'|' Operator +' ' Text +'x' Name +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'d' Name +']' Punctuation +'\n\n' Text + +'alts2' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'(' Punctuation +'Serial' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'b' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'c' Name +')' Punctuation +' ' Text +'=>' Operator.Word +'\n ' Text +'Series' Keyword.Type +' ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +'->' Operator.Word +'c' Name +')' Punctuation +'\n' Text + +'alts2' Name.Function +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'if' Keyword.Reserved +' ' Text +'d' Name +' ' Text +'>' Operator +' ' Text +'0' Literal.Number.Integer +' ' Text +'then' Keyword.Reserved +' ' Text +'series' Name +' ' Text +'(' Punctuation +'dec' Name +' ' Text +'d' Name +')' Punctuation +'\n ' Text +'else' Keyword.Reserved +' ' Text +'[' Punctuation +'\\' Name.Function +'_' Keyword.Reserved +' ' Text +'_' Keyword.Reserved +' ' Text +'->' Operator.Word +' ' Text +'x' Name +' ' Text +'|' Operator +' ' Text +'x' Name +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'d' Name +']' Punctuation +'\n\n' Text + +'alts3' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'(' Punctuation +'Serial' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'b' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'c' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'d' Name +')' Punctuation +' ' Text +'=>' Operator.Word +'\n ' Text +'Series' Keyword.Type +' ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +'->' Operator.Word +'c' Name +'->' Operator.Word +'d' Name +')' Punctuation +'\n' Text + +'alts3' Name.Function +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'if' Keyword.Reserved +' ' Text +'d' Name +' ' Text +'>' Operator +' ' Text +'0' Literal.Number.Integer +' ' Text +'then' Keyword.Reserved +' ' Text +'series' Name +' ' Text +'(' Punctuation +'dec' Name +' ' Text +'d' Name +')' Punctuation +'\n ' Text +'else' Keyword.Reserved +' ' Text +'[' Punctuation +'\\' Name.Function +'_' Keyword.Reserved +' ' Text +'_' Keyword.Reserved +' ' Text +'_' Keyword.Reserved +' ' Text +'->' Operator.Word +' ' Text +'x' Name +' ' Text +'|' Operator +' ' Text +'x' Name +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'d' Name +']' Punctuation +'\n\n' Text + +'alts4' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'(' Punctuation +'Serial' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'b' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'c' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'d' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'e' Name +')' Punctuation +' ' Text +'=>' Operator.Word +'\n ' Text +'Series' Keyword.Type +' ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +'->' Operator.Word +'c' Name +'->' Operator.Word +'d' Name +'->' Operator.Word +'e' Name +')' Punctuation +'\n' Text + +'alts4' Name.Function +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'if' Keyword.Reserved +' ' Text +'d' Name +' ' Text +'>' Operator +' ' Text +'0' Literal.Number.Integer +' ' Text +'then' Keyword.Reserved +' ' Text +'series' Name +' ' Text +'(' Punctuation +'dec' Name +' ' Text +'d' Name +')' Punctuation +'\n ' Text +'else' Keyword.Reserved +' ' Text +'[' Punctuation +'\\' Name.Function +'_' Keyword.Reserved +' ' Text +'_' Keyword.Reserved +' ' Text +'_' Keyword.Reserved +' ' Text +'_' Keyword.Reserved +' ' Text +'->' Operator.Word +' ' Text +'x' Name +' ' Text +'|' Operator +' ' Text +'x' Name +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'d' Name +']' Punctuation +'\n\n' Text + +'instance' Keyword.Reserved +' ' Text +'Serial' Keyword.Type +' ' Text +'Bool' Keyword.Type +' ' Text +'where' Keyword.Reserved +'\n ' Text +'series' Name +' ' Text +'=' Operator.Word +' ' Text +'cons0' Name +' ' Text +'True' Keyword.Type +' ' Text +'\\/' Operator +' ' Text +'cons0' Name +' ' Text +'False' Keyword.Type +'\n ' Text +'coseries' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +' ' Text +'\\' Name.Function +'x' Name +' ' Text +'->' Operator.Word +' ' Text +'if' Keyword.Reserved +' ' Text +'x' Name +' ' Text +'then' Keyword.Reserved +' ' Text +'b1' Name +' ' Text +'else' Keyword.Reserved +' ' Text +'b2' Name +'\n ' Text +'|' Operator +' ' Text +'(' Punctuation +'b1' Name +',' Punctuation +'b2' Name +')' Punctuation +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'d' Name +' ' Text +']' Punctuation +'\n\n' Text + +'instance' Keyword.Reserved +' ' Text +'Serial' Keyword.Type +' ' Text +'a' Name +' ' Text +'=>' Operator.Word +' ' Text +'Serial' Keyword.Type +' ' Text +'(' Punctuation +'Maybe' Keyword.Type +' ' Text +'a' Name +')' Punctuation +' ' Text +'where' Keyword.Reserved +'\n ' Text +'series' Name +' ' Text +'=' Operator.Word +' ' Text +'cons0' Name +' ' Text +'Nothing' Keyword.Type +' ' Text +'\\/' Operator +' ' Text +'cons1' Name +' ' Text +'Just' Keyword.Type +'\n ' Text +'coseries' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +' ' Text +'\\' Name.Function +'m' Name +' ' Text +'->' Operator.Word +' ' Text +'case' Keyword.Reserved +' ' Text +'m' Name +' ' Text +'of' Keyword.Reserved +'\n ' Text +'Nothing' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'z' Name +'\n ' Text +'Just' Keyword.Type +' ' Text +'x' Name +' ' Text +'->' Operator.Word +' ' Text +'f' Name +' ' Text +'x' Name +'\n ' Text +'|' Operator +' ' Text +'z' Name +' ' Text +'<-' Operator.Word +' ' Text +'alts0' Name +' ' Text +'d' Name +' ' Text +',' Punctuation +'\n ' Text +'f' Name +' ' Text +'<-' Operator.Word +' ' Text +'alts1' Name +' ' Text +'d' Name +' ' Text +']' Punctuation +'\n\n' Text + +'instance' Keyword.Reserved +' ' Text +'(' Punctuation +'Serial' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'b' Name +')' Punctuation +' ' Text +'=>' Operator.Word +' ' Text +'Serial' Keyword.Type +' ' Text +'(' Punctuation +'Either' Keyword.Type +' ' Text +'a' Name +' ' Text +'b' Name +')' Punctuation +' ' Text +'where' Keyword.Reserved +'\n ' Text +'series' Name +' ' Text +'=' Operator.Word +' ' Text +'cons1' Name +' ' Text +'Left' Keyword.Type +' ' Text +'\\/' Operator +' ' Text +'cons1' Name +' ' Text +'Right' Keyword.Type +'\n ' Text +'coseries' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +' ' Text +'\\' Name.Function +'e' Name +' ' Text +'->' Operator.Word +' ' Text +'case' Keyword.Reserved +' ' Text +'e' Name +' ' Text +'of' Keyword.Reserved +'\n ' Text +'Left' Keyword.Type +' ' Text +'x' Name +' ' Text +'->' Operator.Word +' ' Text +'f' Name +' ' Text +'x' Name +'\n ' Text +'Right' Keyword.Type +' ' Text +'y' Name +' ' Text +'->' Operator.Word +' ' Text +'g' Name +' ' Text +'y' Name +'\n ' Text +'|' Operator +' ' Text +'f' Name +' ' Text +'<-' Operator.Word +' ' Text +'alts1' Name +' ' Text +'d' Name +' ' Text +',' Punctuation +'\n ' Text +'g' Name +' ' Text +'<-' Operator.Word +' ' Text +'alts1' Name +' ' Text +'d' Name +' ' Text +']' Punctuation +'\n\n' Text + +'instance' Keyword.Reserved +' ' Text +'Serial' Keyword.Type +' ' Text +'a' Name +' ' Text +'=>' Operator.Word +' ' Text +'Serial' Keyword.Type +' ' Text +'[' Punctuation +'a' Name +']' Punctuation +' ' Text +'where' Keyword.Reserved +'\n ' Text +'series' Name +' ' Text +'=' Operator.Word +' ' Text +'cons0' Name +' ' Text +'[]' Keyword.Type +' ' Text +'\\/' Operator +' ' Text +'cons2' Name +' ' Text +'(' Punctuation +':' Keyword.Type +')' Punctuation +'\n ' Text +'coseries' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +' ' Text +'\\' Name.Function +'xs' Name +' ' Text +'->' Operator.Word +' ' Text +'case' Keyword.Reserved +' ' Text +'xs' Name +' ' Text +'of' Keyword.Reserved +'\n ' Text +'[]' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'y' Name +'\n ' Text +'(' Punctuation +'x' Name +':' Keyword.Type +"xs'" Name +')' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'f' Name +' ' Text +'x' Name +' ' Text +"xs'" Name +'\n ' Text +'|' Operator +' ' Text +'y' Name +' ' Text +'<-' Operator.Word +' ' Text +'alts0' Name +' ' Text +'d' Name +' ' Text +',' Punctuation +'\n ' Text +'f' Name +' ' Text +'<-' Operator.Word +' ' Text +'alts2' Name +' ' Text +'d' Name +' ' Text +']' Punctuation +'\n\n' Text + +'-- Warning: the coseries instance here may generate duplicates.' Comment.Single +'\n' Text + +'instance' Keyword.Reserved +' ' Text +'(' Punctuation +'Serial' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Serial' Keyword.Type +' ' Text +'b' Name +')' Punctuation +' ' Text +'=>' Operator.Word +' ' Text +'Serial' Keyword.Type +' ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +')' Punctuation +' ' Text +'where' Keyword.Reserved +'\n ' Text +'series' Name +' ' Text +'=' Operator.Word +' ' Text +'coseries' Name +'\n ' Text +'coseries' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'[' Punctuation +' ' Text +'\\' Name.Function +'f' Name +' ' Text +'->' Operator.Word +' ' Text +'g' Name +' ' Text +'[' Punctuation +'f' Name +' ' Text +'x' Name +' ' Text +'|' Operator +' ' Text +'x' Name +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'d' Name +']' Punctuation +'\n ' Text +'|' Operator +' ' Text +'g' Name +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'d' Name +' ' Text +']' Punctuation +' \n\n' Text + +'-- For customising the depth measure. Use with care!' Comment.Single +'\n\n' Text + +'depth' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Int' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'Int' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'Int' Keyword.Type +'\n' Text + +'depth' Name.Function +' ' Text +'d' Name +' ' Text +"d'" Name +' ' Text +'|' Operator +' ' Text +'d' Name +' ' Text +'>=' Operator +' ' Text +'0' Literal.Number.Integer +' ' Text +'=' Operator.Word +' ' Text +"d'" Name +'+' Operator +'1' Literal.Number.Integer +'-' Operator +'d' Name +'\n ' Text +'|' Operator +' ' Text +'otherwise' Name +' ' Text +'=' Operator.Word +' ' Text +'error' Name.Exception +' ' Text +'"' Literal.String +'SmallCheck.depth: argument < 0' Literal.String +'"' Literal.String +'\n\n' Text + +'dec' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Int' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'Int' Keyword.Type +'\n' Text + +'dec' Name.Function +' ' Text +'d' Name +' ' Text +'|' Operator +' ' Text +'d' Name +' ' Text +'>' Operator +' ' Text +'0' Literal.Number.Integer +' ' Text +'=' Operator.Word +' ' Text +'d' Name +'-' Operator +'1' Literal.Number.Integer +'\n ' Text +'|' Operator +' ' Text +'otherwise' Name +' ' Text +'=' Operator.Word +' ' Text +'error' Name.Exception +' ' Text +'"' Literal.String +'SmallCheck.dec: argument <= 0' Literal.String +'"' Literal.String +'\n\n' Text + +'inc' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Int' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'Int' Keyword.Type +'\n' Text + +'inc' Name.Function +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'d' Name +'+' Operator +'1' Literal.Number.Integer +'\n\n' Text + +'-- show the extension of a function (in part, bounded both by' Comment.Single +'\n' Text + +'-- the number and depth of arguments)' Comment.Single +'\n' Text + +'instance' Keyword.Reserved +' ' Text +'(' Punctuation +'Serial' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Show' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Show' Keyword.Type +' ' Text +'b' Name +')' Punctuation +' ' Text +'=>' Operator.Word +' ' Text +'Show' Keyword.Type +' ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +')' Punctuation +' ' Text +'where' Keyword.Reserved +'\n ' Text +'show' Name +' ' Text +'f' Name +' ' Text +'=' Operator.Word +' \n ' Text +'if' Keyword.Reserved +' ' Text +'maxarheight' Name +' ' Text +'==' Operator +' ' Text +'1' Literal.Number.Integer +'\n ' Text +'&&' Operator +' ' Text +'sumarwidth' Name +' ' Text +'+' Operator +' ' Text +'length' Name +' ' Text +'ars' Name +' ' Text +'*' Operator +' ' Text +'length' Name +' ' Text +'"' Literal.String +'->;' Literal.String +'"' Literal.String +' ' Text +'<' Operator +' ' Text +'widthLimit' Name +' ' Text +'then' Keyword.Reserved +'\n ' Text +'"' Literal.String +'{' Literal.String +'"' Literal.String +'++' Operator +'(' Punctuation +'\n ' Text +'concat' Name +' ' Text +'$' Operator +' ' Text +'intersperse' Name +' ' Text +'"' Literal.String +';' Literal.String +'"' Literal.String +' ' Text +'$' Operator +' ' Text +'[' Punctuation +'a' Name +'++' Operator +'"' Literal.String +'->' Literal.String +'"' Literal.String +'++' Operator +'r' Name +' ' Text +'|' Operator +' ' Text +'(' Punctuation +'a' Name +',' Punctuation +'r' Name +')' Punctuation +' ' Text +'<-' Operator.Word +' ' Text +'ars' Name +']' Punctuation +'\n ' Text +')' Punctuation +'++' Operator +'"' Literal.String +'}' Literal.String +'"' Literal.String +'\n ' Text +'else' Keyword.Reserved +'\n ' Text +'concat' Name +' ' Text +'$' Operator +' ' Text +'[' Punctuation +'a' Name +'++' Operator +'"' Literal.String +'->' Literal.String +'\\' Literal.String.Escape +'n' Literal.String.Escape +'"' Literal.String +'++' Operator +'indent' Name +' ' Text +'r' Name +' ' Text +'|' Operator +' ' Text +'(' Punctuation +'a' Name +',' Punctuation +'r' Name +')' Punctuation +' ' Text +'<-' Operator.Word +' ' Text +'ars' Name +']' Punctuation +'\n ' Text +'where' Keyword.Reserved +'\n ' Text +'ars' Name +' ' Text +'=' Operator.Word +' ' Text +'take' Name +' ' Text +'lengthLimit' Name +' ' Text +'[' Punctuation +' ' Text +'(' Punctuation +'show' Name +' ' Text +'x' Name +',' Punctuation +' ' Text +'show' Name +' ' Text +'(' Punctuation +'f' Name +' ' Text +'x' Name +')' Punctuation +')' Punctuation +'\n ' Text +'|' Operator +' ' Text +'x' Name +' ' Text +'<-' Operator.Word +' ' Text +'series' Name +' ' Text +'depthLimit' Name +' ' Text +']' Punctuation +'\n ' Text +'maxarheight' Name +' ' Text +'=' Operator.Word +' ' Text +'maximum' Name +' ' Text +'[' Punctuation +' ' Text +'max' Name +' ' Text +'(' Punctuation +'height' Name +' ' Text +'a' Name +')' Punctuation +' ' Text +'(' Punctuation +'height' Name +' ' Text +'r' Name +')' Punctuation +'\n ' Text +'|' Operator +' ' Text +'(' Punctuation +'a' Name +',' Punctuation +'r' Name +')' Punctuation +' ' Text +'<-' Operator.Word +' ' Text +'ars' Name +' ' Text +']' Punctuation +'\n ' Text +'sumarwidth' Name +' ' Text +'=' Operator.Word +' ' Text +'sum' Name +' ' Text +'[' Punctuation +' ' Text +'length' Name +' ' Text +'a' Name +' ' Text +'+' Operator +' ' Text +'length' Name +' ' Text +'r' Name +' \n ' Text +'|' Operator +' ' Text +'(' Punctuation +'a' Name +',' Punctuation +'r' Name +')' Punctuation +' ' Text +'<-' Operator.Word +' ' Text +'ars' Name +']' Punctuation +'\n ' Text +'indent' Name +' ' Text +'=' Operator.Word +' ' Text +'unlines' Name +' ' Text +'.' Operator +' ' Text +'map' Name +' ' Text +'(' Punctuation +'"' Literal.String +' ' Literal.String +'"' Literal.String +'++' Operator +')' Punctuation +' ' Text +'.' Operator +' ' Text +'lines' Name +'\n ' Text +'height' Name +' ' Text +'=' Operator.Word +' ' Text +'length' Name +' ' Text +'.' Operator +' ' Text +'lines' Name +'\n ' Text +'(' Punctuation +'widthLimit' Name +',' Punctuation +'lengthLimit' Name +',' Punctuation +'depthLimit' Name +')' Punctuation +' ' Text +'=' Operator.Word +' ' Text +'(' Punctuation +'80' Literal.Number.Integer +',' Punctuation +'20' Literal.Number.Integer +',' Punctuation +'3' Literal.Number.Integer +')' Punctuation +'::' Operator.Word +'(' Punctuation +'Int' Keyword.Type +',' Punctuation +'Int' Keyword.Type +',' Punctuation +'Int' Keyword.Type +')' Punctuation +'\n\n' Text + +'---------------- <properties and their evaluation> ------------------' Comment.Single +'\n\n' Text + +'-- adapted from QuickCheck originals: here results come in lists,' Comment.Single +'\n' Text + +'-- properties have depth arguments, stamps (for classifying random' Comment.Single +'\n' Text + +'-- tests) are omitted, existentials are introduced' Comment.Single +'\n\n' Text + +'newtype' Keyword.Reserved +' ' Text +'PR' Keyword.Type +' ' Text +'=' Operator.Word +' ' Text +'Prop' Keyword.Type +' ' Text +'[' Punctuation +'Result' Keyword.Type +']' Punctuation +'\n\n' Text + +'data' Keyword.Reserved +' ' Text +'Result' Keyword.Type +' ' Text +'=' Operator.Word +' ' Text +'Result' Keyword.Type +' ' Text +'{' Punctuation +'ok' Name +' ' Text +'::' Operator.Word +' ' Text +'Maybe' Keyword.Type +' ' Text +'Bool' Keyword.Type +',' Punctuation +' ' Text +'arguments' Name +' ' Text +'::' Operator.Word +' ' Text +'[' Punctuation +'String' Keyword.Type +']' Punctuation +'}' Punctuation +'\n\n' Text + +'nothing' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Result' Keyword.Type +'\n' Text + +'nothing' Name.Function +' ' Text +'=' Operator.Word +' ' Text +'Result' Keyword.Type +' ' Text +'{' Punctuation +'ok' Name +' ' Text +'=' Operator.Word +' ' Text +'Nothing' Keyword.Type +',' Punctuation +' ' Text +'arguments' Name +' ' Text +'=' Operator.Word +' ' Text +'[]' Keyword.Type +'}' Punctuation +'\n\n' Text + +'result' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Result' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'PR' Keyword.Type +'\n' Text + +'result' Name.Function +' ' Text +'res' Name +' ' Text +'=' Operator.Word +' ' Text +'Prop' Keyword.Type +' ' Text +'[' Punctuation +'res' Name +']' Punctuation +'\n\n' Text + +'newtype' Keyword.Reserved +' ' Text +'Property' Keyword.Type +' ' Text +'=' Operator.Word +' ' Text +'Property' Keyword.Type +' ' Text +'(' Punctuation +'Int' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'PR' Keyword.Type +')' Punctuation +'\n\n' Text + +'class' Keyword.Reserved +' ' Text +'Testable' Keyword.Type +' ' Text +'a' Name +' ' Text +'where' Keyword.Reserved +'\n ' Text +'property' Name +' ' Text +'::' Operator.Word +' ' Text +'a' Name +' ' Text +'->' Operator.Word +' ' Text +'Int' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'PR' Keyword.Type +'\n\n' Text + +'instance' Keyword.Reserved +' ' Text +'Testable' Keyword.Type +' ' Text +'Bool' Keyword.Type +' ' Text +'where' Keyword.Reserved +'\n ' Text +'property' Name +' ' Text +'b' Name +' ' Text +'_' Keyword.Reserved +' ' Text +'=' Operator.Word +' ' Text +'Prop' Keyword.Type +' ' Text +'[' Punctuation +'Result' Keyword.Type +' ' Text +'(' Punctuation +'Just' Keyword.Type +' ' Text +'b' Name +')' Punctuation +' ' Text +'[]' Keyword.Type +']' Punctuation +'\n\n' Text + +'instance' Keyword.Reserved +' ' Text +'Testable' Keyword.Type +' ' Text +'PR' Keyword.Type +' ' Text +'where' Keyword.Reserved +'\n ' Text +'property' Name +' ' Text +'prop' Name +' ' Text +'_' Keyword.Reserved +' ' Text +'=' Operator.Word +' ' Text +'prop' Name +'\n\n' Text + +'instance' Keyword.Reserved +' ' Text +'(' Punctuation +'Serial' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Show' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Testable' Keyword.Type +' ' Text +'b' Name +')' Punctuation +' ' Text +'=>' Operator.Word +' ' Text +'Testable' Keyword.Type +' ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +')' Punctuation +' ' Text +'where' Keyword.Reserved +'\n ' Text +'property' Name +' ' Text +'f' Name +' ' Text +'=' Operator.Word +' ' Text +"f'" Name +' ' Text +'where' Keyword.Reserved +' ' Text +'Property' Keyword.Type +' ' Text +"f'" Name +' ' Text +'=' Operator.Word +' ' Text +'forAll' Name +' ' Text +'series' Name +' ' Text +'f' Name +'\n\n' Text + +'instance' Keyword.Reserved +' ' Text +'Testable' Keyword.Type +' ' Text +'Property' Keyword.Type +' ' Text +'where' Keyword.Reserved +'\n ' Text +'property' Name +' ' Text +'(' Punctuation +'Property' Keyword.Type +' ' Text +'f' Name +')' Punctuation +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'f' Name +' ' Text +'d' Name +'\n\n' Text + +'evaluate' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Testable' Keyword.Type +' ' Text +'a' Name +' ' Text +'=>' Operator.Word +' ' Text +'a' Name +' ' Text +'->' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'Result' Keyword.Type +'\n' Text + +'evaluate' Name.Function +' ' Text +'x' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'rs' Name +' ' Text +'where' Keyword.Reserved +' ' Text +'Prop' Keyword.Type +' ' Text +'rs' Name +' ' Text +'=' Operator.Word +' ' Text +'property' Name +' ' Text +'x' Name +' ' Text +'d' Name +'\n\n' Text + +'forAll' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'(' Punctuation +'Show' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Testable' Keyword.Type +' ' Text +'b' Name +')' Punctuation +' ' Text +'=>' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'a' Name +' ' Text +'->' Operator.Word +' ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +')' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'Property' Keyword.Type +'\n' Text + +'forAll' Name.Function +' ' Text +'xs' Name +' ' Text +'f' Name +' ' Text +'=' Operator.Word +' ' Text +'Property' Keyword.Type +' ' Text +'$' Operator +' ' Text +'\\' Name.Function +'d' Name +' ' Text +'->' Operator.Word +' ' Text +'Prop' Keyword.Type +' ' Text +'$' Operator +'\n ' Text +'[' Punctuation +' ' Text +'r' Name +'{' Punctuation +'arguments' Name +' ' Text +'=' Operator.Word +' ' Text +'show' Name +' ' Text +'x' Name +' ' Text +':' Keyword.Type +' ' Text +'arguments' Name +' ' Text +'r' Name +'}' Punctuation +'\n ' Text +'|' Operator +' ' Text +'x' Name +' ' Text +'<-' Operator.Word +' ' Text +'xs' Name +' ' Text +'d' Name +',' Punctuation +' ' Text +'r' Name +' ' Text +'<-' Operator.Word +' ' Text +'evaluate' Name +' ' Text +'(' Punctuation +'f' Name +' ' Text +'x' Name +')' Punctuation +' ' Text +'d' Name +' ' Text +']' Punctuation +'\n\n' Text + +'forAllElem' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'(' Punctuation +'Show' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Testable' Keyword.Type +' ' Text +'b' Name +')' Punctuation +' ' Text +'=>' Operator.Word +' ' Text +'[' Punctuation +'a' Name +']' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +')' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'Property' Keyword.Type +'\n' Text + +'forAllElem' Name.Function +' ' Text +'xs' Name +' ' Text +'=' Operator.Word +' ' Text +'forAll' Name +' ' Text +'(' Punctuation +'const' Name +' ' Text +'xs' Name +')' Punctuation +'\n\n' Text + +'thereExists' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Testable' Keyword.Type +' ' Text +'b' Name +' ' Text +'=>' Operator.Word +' ' Text +'Series' Keyword.Type +' ' Text +'a' Name +' ' Text +'->' Operator.Word +' ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +')' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'Property' Keyword.Type +'\n' Text + +'thereExists' Name.Function +' ' Text +'xs' Name +' ' Text +'f' Name +' ' Text +'=' Operator.Word +' ' Text +'Property' Keyword.Type +' ' Text +'$' Operator +' ' Text +'\\' Name.Function +'d' Name +' ' Text +'->' Operator.Word +' ' Text +'Prop' Keyword.Type +' ' Text +'$' Operator +'\n ' Text +'[' Punctuation +' ' Text +'Result' Keyword.Type +'\n ' Text +'(' Punctuation +' ' Text +'Just' Keyword.Type +' ' Text +'$' Operator +' ' Text +'or' Name +' ' Text +'[' Punctuation +' ' Text +'all' Name +' ' Text +'pass' Name +' ' Text +'(' Punctuation +'evaluate' Name +' ' Text +'(' Punctuation +'f' Name +' ' Text +'x' Name +')' Punctuation +' ' Text +'d' Name +')' Punctuation +'\n ' Text +'|' Operator +' ' Text +'x' Name +' ' Text +'<-' Operator.Word +' ' Text +'xs' Name +' ' Text +'d' Name +' ' Text +']' Punctuation +' ' Text +')' Punctuation +'\n ' Text +'[]' Keyword.Type +' ' Text +']' Punctuation +' \n ' Text +'where' Keyword.Reserved +'\n ' Text +'pass' Name +' ' Text +'(' Punctuation +'Result' Keyword.Type +' ' Text +'Nothing' Keyword.Type +' ' Text +'_' Keyword.Reserved +')' Punctuation +' ' Text +'=' Operator.Word +' ' Text +'True' Keyword.Type +'\n ' Text +'pass' Name +' ' Text +'(' Punctuation +'Result' Keyword.Type +' ' Text +'(' Punctuation +'Just' Keyword.Type +' ' Text +'b' Name +')' Punctuation +' ' Text +'_' Keyword.Reserved +')' Punctuation +' ' Text +'=' Operator.Word +' ' Text +'b' Name +'\n\n' Text + +'thereExistsElem' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Testable' Keyword.Type +' ' Text +'b' Name +' ' Text +'=>' Operator.Word +' ' Text +'[' Punctuation +'a' Name +']' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +')' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'Property' Keyword.Type +'\n' Text + +'thereExistsElem' Name.Function +' ' Text +'xs' Name +' ' Text +'=' Operator.Word +' ' Text +'thereExists' Name +' ' Text +'(' Punctuation +'const' Name +' ' Text +'xs' Name +')' Punctuation +'\n\n' Text + +'exists' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'(' Punctuation +'Serial' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Testable' Keyword.Type +' ' Text +'b' Name +')' Punctuation +' ' Text +'=>' Operator.Word +'\n ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +')' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'Property' Keyword.Type +'\n' Text + +'exists' Name.Function +' ' Text +'=' Operator.Word +' ' Text +'thereExists' Name +' ' Text +'series' Name +'\n\n' Text + +'existsDeeperBy' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'(' Punctuation +'Serial' Keyword.Type +' ' Text +'a' Name +',' Punctuation +' ' Text +'Testable' Keyword.Type +' ' Text +'b' Name +')' Punctuation +' ' Text +'=>' Operator.Word +'\n ' Text +'(' Punctuation +'Int' Keyword.Type +'->' Operator.Word +'Int' Keyword.Type +')' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'(' Punctuation +'a' Name +'->' Operator.Word +'b' Name +')' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'Property' Keyword.Type +'\n' Text + +'existsDeeperBy' Name.Function +' ' Text +'f' Name +' ' Text +'=' Operator.Word +' ' Text +'thereExists' Name +' ' Text +'(' Punctuation +'series' Name +' ' Text +'.' Operator +' ' Text +'f' Name +')' Punctuation +'\n \n' Text + +'infixr' Keyword.Reserved +' ' Text +'0' Literal.Number.Integer +' ' Text +'==>' Operator +'\n\n' Text + +'(' Punctuation +'==>' Operator +')' Punctuation +' ' Text +'::' Operator.Word +' ' Text +'Testable' Keyword.Type +' ' Text +'a' Name +' ' Text +'=>' Operator.Word +' ' Text +'Bool' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'a' Name +' ' Text +'->' Operator.Word +' ' Text +'Property' Keyword.Type +'\n' Text + +'True' Keyword.Type +' ' Text +'==>' Operator +' ' Text +'x' Name +' ' Text +'=' Operator.Word +' ' Text +'Property' Keyword.Type +' ' Text +'(' Punctuation +'property' Name +' ' Text +'x' Name +')' Punctuation +'\n' Text + +'False' Keyword.Type +' ' Text +'==>' Operator +' ' Text +'x' Name +' ' Text +'=' Operator.Word +' ' Text +'Property' Keyword.Type +' ' Text +'(' Punctuation +'const' Name +' ' Text +'(' Punctuation +'result' Name +' ' Text +'nothing' Name +')' Punctuation +')' Punctuation +'\n\n' Text + +'--------------------- <top-level test drivers> ----------------------' Comment.Single +'\n\n' Text + +'-- similar in spirit to QuickCheck but with iterative deepening' Comment.Single +'\n\n' Text + +'-- test for values of depths 0..d stopping when a property' Comment.Single +'\n' Text + +'-- fails or when it has been checked for all these values' Comment.Single +'\n' Text + +'smallCheck' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Testable' Keyword.Type +' ' Text +'a' Name +' ' Text +'=>' Operator.Word +' ' Text +'Int' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'a' Name +' ' Text +'->' Operator.Word +' ' Text +'IO' Keyword.Type +' ' Text +'String' Keyword.Type +'\n' Text + +'smallCheck' Name.Function +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'iterCheck' Name +' ' Text +'0' Literal.Number.Integer +' ' Text +'(' Punctuation +'Just' Keyword.Type +' ' Text +'d' Name +')' Punctuation +'\n\n' Text + +'depthCheck' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Testable' Keyword.Type +' ' Text +'a' Name +' ' Text +'=>' Operator.Word +' ' Text +'Int' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'a' Name +' ' Text +'->' Operator.Word +' ' Text +'IO' Keyword.Type +' ' Text +'String' Keyword.Type +'\n' Text + +'depthCheck' Name.Function +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'iterCheck' Name +' ' Text +'d' Name +' ' Text +'(' Punctuation +'Just' Keyword.Type +' ' Text +'d' Name +')' Punctuation +'\n\n' Text + +'iterCheck' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Testable' Keyword.Type +' ' Text +'a' Name +' ' Text +'=>' Operator.Word +' ' Text +'Int' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'Maybe' Keyword.Type +' ' Text +'Int' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'a' Name +' ' Text +'->' Operator.Word +' ' Text +'IO' Keyword.Type +' ' Text +'String' Keyword.Type +'\n' Text + +'iterCheck' Name.Function +' ' Text +'dFrom' Name +' ' Text +'mdTo' Name +' ' Text +'t' Name +' ' Text +'=' Operator.Word +' ' Text +'iter' Name +' ' Text +'dFrom' Name +'\n ' Text +'where' Keyword.Reserved +'\n ' Text +'iter' Name +' ' Text +'::' Operator.Word +' ' Text +'Int' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'IO' Keyword.Type +' ' Text +'String' Keyword.Type +'\n ' Text +'iter' Name +' ' Text +'d' Name +' ' Text +'=' Operator.Word +' ' Text +'do' Keyword.Reserved +'\n ' Text +'let' Keyword.Reserved +' ' Text +'Prop' Keyword.Type +' ' Text +'results' Name +' ' Text +'=' Operator.Word +' ' Text +'property' Name +' ' Text +'t' Name +' ' Text +'d' Name +'\n ' Text +'(' Punctuation +'ok' Name +',' Punctuation +'s' Name +')' Punctuation +' ' Text +'<-' Operator.Word +' ' Text +'check' Name +' ' Text +'(' Punctuation +'mdTo' Name +'==' Operator +'Nothing' Keyword.Type +')' Punctuation +' ' Text +'0' Literal.Number.Integer +' ' Text +'0' Literal.Number.Integer +' ' Text +'True' Keyword.Type +' ' Text +'results' Name +'\n ' Text +'maybe' Name +' ' Text +'(' Punctuation +'iter' Name +' ' Text +'(' Punctuation +'d' Name +'+' Operator +'1' Literal.Number.Integer +')' Punctuation +')' Punctuation +'\n ' Text +'(' Punctuation +'\\' Name.Function +'dTo' Name +' ' Text +'->' Operator.Word +' ' Text +'if' Keyword.Reserved +' ' Text +'ok' Name +' ' Text +'&&' Operator +' ' Text +'d' Name +' ' Text +'<' Operator +' ' Text +'dTo' Name +'\n ' Text +'then' Keyword.Reserved +' ' Text +'iter' Name +' ' Text +'(' Punctuation +'d' Name +'+' Operator +'1' Literal.Number.Integer +')' Punctuation +'\n ' Text +'else' Keyword.Reserved +' ' Text +'return' Name +' ' Text +'s' Name +')' Punctuation +'\n ' Text +'mdTo' Name +'\n\n' Text + +'check' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Bool' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'Int' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'Int' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'Bool' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'[' Punctuation +'Result' Keyword.Type +']' Punctuation +' ' Text +'->' Operator.Word +' ' Text +'IO' Keyword.Type +' ' Text +'(' Punctuation +'Bool' Keyword.Type +',' Punctuation +' ' Text +'String' Keyword.Type +')' Punctuation +'\n' Text + +'check' Name.Function +' ' Text +'i' Name +' ' Text +'n' Name +' ' Text +'x' Name +' ' Text +'ok' Name +' ' Text +'rs' Name +' ' Text +'|' Operator +' ' Text +'null' Name +' ' Text +'rs' Name +' ' Text +'=' Operator.Word +' ' Text +'do' Keyword.Reserved +'\n ' Text +'let' Keyword.Reserved +' ' Text +'s' Name +' ' Text +'=' Operator.Word +' ' Text +'"' Literal.String +' Completed ' Literal.String +'"' Literal.String +'++' Operator +'show' Name +' ' Text +'n' Name +'++' Operator +'"' Literal.String +' test(s)' Literal.String +'"' Literal.String +'\n ' Text +'y' Name +' ' Text +'=' Operator.Word +' ' Text +'if' Keyword.Reserved +' ' Text +'i' Name +' ' Text +'then' Keyword.Reserved +' ' Text +'"' Literal.String +'.' Literal.String +'"' Literal.String +' ' Text +'else' Keyword.Reserved +' ' Text +'"' Literal.String +' without failure.' Literal.String +'"' Literal.String +'\n ' Text +'z' Name +' ' Text +'|' Operator +' ' Text +'x' Name +' ' Text +'>' Operator +' ' Text +'0' Literal.Number.Integer +' ' Text +'=' Operator.Word +' ' Text +'"' Literal.String +' But ' Literal.String +'"' Literal.String +'++' Operator +'show' Name +' ' Text +'x' Name +'++' Operator +'"' Literal.String +' did not meet ==> condition.' Literal.String +'"' Literal.String +'\n ' Text +'|' Operator +' ' Text +'otherwise' Name +' ' Text +'=' Operator.Word +' ' Text +'"' Literal.String +'"' Literal.String +'\n ' Text +'return' Name +' ' Text +'(' Punctuation +'ok' Name +',' Punctuation +' ' Text +'s' Name +' ' Text +'++' Operator +' ' Text +'y' Name +' ' Text +'++' Operator +' ' Text +'z' Name +')' Punctuation +'\n\n' Text + +'check' Name.Function +' ' Text +'i' Name +' ' Text +'n' Name +' ' Text +'x' Name +' ' Text +'ok' Name +' ' Text +'(' Punctuation +'Result' Keyword.Type +' ' Text +'Nothing' Keyword.Type +' ' Text +'_' Keyword.Reserved +' ' Text +':' Keyword.Type +' ' Text +'rs' Name +')' Punctuation +' ' Text +'=' Operator.Word +' ' Text +'do' Keyword.Reserved +'\n ' Text +'progressReport' Name +' ' Text +'i' Name +' ' Text +'n' Name +' ' Text +'x' Name +'\n ' Text +'check' Name +' ' Text +'i' Name +' ' Text +'(' Punctuation +'n' Name +'+' Operator +'1' Literal.Number.Integer +')' Punctuation +' ' Text +'(' Punctuation +'x' Name +'+' Operator +'1' Literal.Number.Integer +')' Punctuation +' ' Text +'ok' Name +' ' Text +'rs' Name +'\n\n' Text + +'check' Name.Function +' ' Text +'i' Name +' ' Text +'n' Name +' ' Text +'x' Name +' ' Text +'f' Name +' ' Text +'(' Punctuation +'Result' Keyword.Type +' ' Text +'(' Punctuation +'Just' Keyword.Type +' ' Text +'True' Keyword.Type +')' Punctuation +' ' Text +'_' Keyword.Reserved +' ' Text +':' Keyword.Type +' ' Text +'rs' Name +')' Punctuation +' ' Text +'=' Operator.Word +' ' Text +'do' Keyword.Reserved +'\n ' Text +'progressReport' Name +' ' Text +'i' Name +' ' Text +'n' Name +' ' Text +'x' Name +'\n ' Text +'check' Name +' ' Text +'i' Name +' ' Text +'(' Punctuation +'n' Name +'+' Operator +'1' Literal.Number.Integer +')' Punctuation +' ' Text +'x' Name +' ' Text +'f' Name +' ' Text +'rs' Name +'\n\n' Text + +'check' Name.Function +' ' Text +'i' Name +' ' Text +'n' Name +' ' Text +'x' Name +' ' Text +'f' Name +' ' Text +'(' Punctuation +'Result' Keyword.Type +' ' Text +'(' Punctuation +'Just' Keyword.Type +' ' Text +'False' Keyword.Type +')' Punctuation +' ' Text +'args' Name +' ' Text +':' Keyword.Type +' ' Text +'rs' Name +')' Punctuation +' ' Text +'=' Operator.Word +' ' Text +'do' Keyword.Reserved +'\n ' Text +'let' Keyword.Reserved +' ' Text +'s' Name +' ' Text +'=' Operator.Word +' ' Text +'"' Literal.String +' Failed test no. ' Literal.String +'"' Literal.String +'++' Operator +'show' Name +' ' Text +'(' Punctuation +'n' Name +'+' Operator +'1' Literal.Number.Integer +')' Punctuation +'++' Operator +'"' Literal.String +'. Test values follow.' Literal.String +'"' Literal.String +'\n ' Text +"s'" Name +' ' Text +'=' Operator.Word +' ' Text +'s' Name +' ' Text +'++' Operator +' ' Text +'"' Literal.String +': ' Literal.String +'"' Literal.String +' ' Text +'++' Operator +' ' Text +'concat' Name +' ' Text +'(' Punctuation +'intersperse' Name +' ' Text +'"' Literal.String +', ' Literal.String +'"' Literal.String +' ' Text +'args' Name +')' Punctuation +'\n ' Text +'if' Keyword.Reserved +' ' Text +'i' Name +' ' Text +'then' Keyword.Reserved +'\n ' Text +'check' Name +' ' Text +'i' Name +' ' Text +'(' Punctuation +'n' Name +'+' Operator +'1' Literal.Number.Integer +')' Punctuation +' ' Text +'x' Name +' ' Text +'False' Keyword.Type +' ' Text +'rs' Name +'\n ' Text +'else' Keyword.Reserved +'\n ' Text +'return' Name +' ' Text +'(' Punctuation +'False' Keyword.Type +',' Punctuation +' ' Text +"s'" Name +')' Punctuation +'\n\n' Text + +'progressReport' Name.Function +' ' Text +'::' Operator.Word +' ' Text +'Bool' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'Int' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'Int' Keyword.Type +' ' Text +'->' Operator.Word +' ' Text +'IO' Keyword.Type +' ' Text +'()' Name.Builtin +'\n' Text + +'progressReport' Name.Function +' ' Text +'_' Keyword.Reserved +' ' Text +'_' Keyword.Reserved +' ' Text +'_' Keyword.Reserved +' ' Text +'=' Operator.Word +' ' Text +'return' Name +' ' Text +'()' Name.Builtin +'\n' Text |
