Personal tools

Sandbox

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
m (fooling around)
(fooling around)
 
Line 4: Line 4:
 
{{Standard class|State|module=Control.Monad.State.Lazy|module-doc=Control.Monad.State.Lazy|package=test}}
 
{{Standard class|State|module=Control.Monad.State.Lazy|module-doc=Control.Monad.State.Lazy|package=test}}
   
<tt>TADA! [http://google.com this is a link to google, surprisingly]</tt>
+
{| border=0 align=right cellpadding=4 cellspacing=0 style="border:1px #aaa solid"
  +
| <TT>import [http://www.haskell.org/ghc/docs/latest/html/testp/testmd.html testm]</TT>
  +
|}
  +
TADA! [http://google.com this is a link to google, surprisingly]
   
 
[[User:Siers|Siers]] Fri Jun 27 02:36:37 EEST 2014
 
[[User:Siers|Siers]] Fri Jun 27 02:36:37 EEST 2014

Latest revision as of 00:22, 27 June 2014

Feel free to edit as you wish on this page. It is here for you to experiment with WIKI edit syntax.

Contents

[edit] 1 fooling around

State class (test)
import Control.Monad.State.Lazy
import testm

TADA! this is a link to google, surprisingly

Siers Fri Jun 27 02:36:37 EEST 2014

[edit] 2 section

Sandbox#secton
#Links


--Lars 11:14, 27 July 2009 (UTC)


InsertformulahereMedia:Example.oggFile:Example.jpg

[edit] 3 Headline text

Italic textBold text

Pavillon Uge Uge

Matrix:

\left[ \begin{matrix}1 & 2 \\ 3 & 4\end{matrix} \right]

Embedded matrix:

\left[ \begin{matrix}1 & 2 \\ 3 & \left[ \begin{matrix}5 & 6 \\ 7 & 8\end{matrix}\right] \end{matrix} \right]

[edit] 4 Links

An internal link.

[edit] 4.1 External

http://cs.pdx.edu/

http://cs.pdx.edu/~dick/HaskellSemantics/jpf05.pdf

http://cs.pdx.edu/~dick/HaskellSemantics/Haskell98.pdf

Text taken from http://hpaste.org/3881: this wiki's syntax highlight at least does not garble the source, unlike hpaste's highlight.

An external link using text instead of the raw link address.

module Main where
 
import Prelude hiding (putStrLn, print)
import System.IO.UTF8
import Data.List (intersperse, find)
 
type Персонаж = String
type Персонажи = [Персонаж]
 
едоки :: Персонажи
едоки = [ "дедка", "бабка", "внучка", "жучка", "кошка", "мышка" ]
 
подходы :: [ Персонажи ]
подходы = scanl позвать [] едоки
  where позвать тянущие подмога = подмога:тянущие
 
построились :: Персонажи -> [ (Персонаж, Персонаж) ]
построились едоки = zip едоки ("репка":едоки)
 
диспозиции = map (построились.reverse) подходы
 
описать [] = "Посадил дед репку ..."
описать диспозиция = 
  unwords ["Взялись:"
          , concat $ intersperse ", " $ map за диспозиция
          , ". Тянут-потянут -- " ++ result
          ]
  where 
    за (кто,кого) = кто ++ " за " ++ винительный_падеж кого
    винительный_падеж ы = init ы ++ "у"
    result = case find ((=="мышка").fst) диспозиция of
                  Just _  -> "вытянули репку!"
                  Nothing -> "вытянуть не могут!"
 
main = mapM_ putStrLn $ map описать диспозиции

[edit] 5 Section

[edit] 5.1 Subsection

[edit] 5.1.1 Subsubsection

huhu

[edit] 5.1.1.1 Subsubsubsection