Yogurt is a small MUD client library written in Haskell. It can be [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Yogurt downloaded from hackage]. Yogurt is a DSL embedded in Haskell. Unlike other MUD clients out there, it doesn't offer its own syntax; instead, it relies on Haskell and naturally offers all Haskell's features. This means full control over what messages are sent, variables with any valid Haskell type, no ambiguity about whether a variable is expanded at hook define time or hook trigger time, no clumsy syntax, et cetera. On the other hand, this means you do not get the ability to change the installed hooks at runtime for free.

+

Yogurt is a small [http://en.wikipedia.org/wiki/MUD MUD] client library written in Haskell. It can be [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Yogurt downloaded from hackage]. Yogurt is a [[Embedded domain specific language | DSL]] embedded in Haskell. Unlike other MUD clients out there, it doesn't offer its own syntax; instead, it relies on Haskell and naturally offers all Haskell's features. This means full control over what messages are sent, variables with any valid Haskell type, no ambiguity about whether a variable is expanded at hook define time or hook trigger time, no clumsy syntax, et cetera. On the other hand, this means you do not get the ability to change the installed hooks at runtime for free.

Yogurt is best explained by an example:

Yogurt is best explained by an example:

Line 12:

Line 12:

import Network.Yogurt.Utils

import Network.Yogurt.Utils

import Data.Char

import Data.Char

+

import Control.Monad (replicateM)

main :: IO ()

main :: IO ()

Line 56:

Line 57:

mkHook Remote "^[0-9]+[neswud]$" $ do

mkHook Remote "^[0-9]+[neswud]$" $ do

(n, dir) <- fmap (span isDigit) (group 0)

(n, dir) <- fmap (span isDigit) (group 0)

−

sequence $ replicate (read n) (sendln dir)

+

replicateM (read n) (sendln dir)

return ()

return ()

Line 63:

Line 64:

[[Category:Libraries]]

[[Category:Libraries]]

+

[[Category:Games]]

+

[[Category:Tutorials]]

Latest revision as of 09:34, 25 March 2012

Yogurt is a small MUD client library written in Haskell. It can be downloaded from hackage. Yogurt is a DSL embedded in Haskell. Unlike other MUD clients out there, it doesn't offer its own syntax; instead, it relies on Haskell and naturally offers all Haskell's features. This means full control over what messages are sent, variables with any valid Haskell type, no ambiguity about whether a variable is expanded at hook define time or hook trigger time, no clumsy syntax, et cetera. On the other hand, this means you do not get the ability to change the installed hooks at runtime for free.