Sandbox
From HaskellWiki
(Difference between revisions)
(→External) |
|||
| Line 2: | Line 2: | ||
==section== | ==section== | ||
[[Sandbox#secton]]<br> | [[Sandbox#secton]]<br> | ||
| + | [[#Links]]<br> | ||
Current revision
Feel free to edit as you wish on this page. It is here for you to experiment with WIKI edit syntax.
Contents |
1 section
--Lars 11:14, 27 July 2009 (UTC)
InsertformulahereMedia:Example.oggImage:Example.jpg
2 Headline text
Italic textBold text
| Pavillon | Uge | Uge |
Matrix:
Embedded matrix:
3 Links
An internal link.
3.1 External
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 описать диспозиции
4 Section
4.1 Subsection
4.1.1 Subsubsection
huhu
