- telegrafieren telegrafiert
- gratulieren gratuliert
- wuenschen wuenscht
- schicken schickt
- gefallen gefaellt
- bringen bringt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// HASKELL FTW | |
// | |
typedef const int Int; | |
typedef const int Bool; | |
// data List a = Cons a (List a) | Nil | |
typedef const enum ListType { Nil, Cons } ListType; | |
typedef const struct List { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Monad (mapM_) | |
import System.Random | |
import System.Cmd | |
import System.Environment (getArgs) | |
import Data.List (intercalate, nub) | |
type Size = Int | |
type Constraint = (Variable, Variable) | |
data Variable = Variable Int deriving (Eq) | |
data Map = Map Size Size [Constraint] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Tree a = Nil | Node a (Tree a) (Tree a) deriving (Eq) | |
data Inbalance = Balanced | LL | RR | LR | RL deriving (Show, Eq) | |
(+++) :: (Eq a, Ord a) => Tree a -> a -> Tree a | |
(+++) = insert | |
instance (Show a, Eq a) => Show (Tree a) where | |
show tree = draw tree (height tree) ++ "\n pre: " ++ show (preorder tree) ++ "\n in: " ++ show (inorder tree) | |
where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
import Network.Wai | |
import Network.Wai.Handler.Warp (run) | |
import Network.HTTP.Types (status200) | |
cedartrunk request = do | |
case referer of | |
Nothing -> return $ ResponseFile status200 [("Content-Type", "text/html")] "index.html" Nothing | |
Just _ -> return $ ResponseFile status200 [] path Nothing | |
where path = tail . tail . init . show . rawPathInfo $ request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
import Web.Scotty | |
import Network.Wai (requestHeaders, pathInfo) | |
import Data.Text (intercalate, unpack) | |
import Data.Text.Encoding (decodeUtf8) | |
import Data.Text.Lazy (fromStrict) | |
import Network.Mime (defaultMimeLookup) | |
import Control.Applicative ((<$>)) | |
import Control.Monad.Trans (liftIO) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Catamorphism where | |
import Prelude hiding (sum) | |
data Mu f = InF { outF :: f (Mu f) } | |
catamorphism :: Functor f => (f a -> a) -> Mu f -> a | |
catamorphism f = f . fmap (catamorphism f) . outF | |
-------------------------------------------------- |