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 GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
import Network.Wai | |
import Network.Wai.Enumerator | |
import Network.Wai.Handler.SimpleServer | |
import Data.Monoid | |
import qualified Data.ByteString.Char8 as S | |
import qualified Data.ByteString.Lazy.Char8 as L | |
import Data.List (intercalate) |
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 PackageImports #-} | |
module EasyPool | |
( EasyPool | |
, withEasyPool | |
, newEasyPool | |
) where | |
import Pool | |
import Control.Monad.STM |
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 TemplateHaskell #-} | |
import Language.Haskell.TH.Syntax | |
main = $(return $(return $ InfixE | |
(Just $ | |
(ConE $ mkName "VarE") `AppE` | |
((VarE $ mkName "mkName") `AppE` (LitE $ StringL "putStrLn"))) | |
(ConE $ mkName "AppE") | |
(Just $ | |
(ConE $ mkName "LitE") `AppE` |
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 QuasiQuotes, TypeFamilies #-} | |
import Yesod | |
data NewHamlet = NewHamlet | |
mkYesod "NewHamlet" [$parseRoutes|/ RootR GET|] | |
instance Yesod NewHamlet where approot _ = "" | |
myInnerWidget = do | |
addBody [$hamlet|#inner Inner widget|] | |
addStyle [$cassius| | |
#inner |
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 Prelude hiding (head) | |
import Data.Enumerator | |
import Control.Monad.IO.Class | |
sum1 :: [Int] -> Int | |
sum1 [] = 0 | |
sum1 (x:xs) = x + sum xs | |
getNumber :: IO (Maybe Int) | |
getNumber = do |
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 Prelude hiding (head) | |
import Data.Enumerator hiding (map) | |
import Control.Exception (SomeException) | |
import Control.Monad.IO.Class | |
sum6 :: Monad m => Iteratee Int m Int | |
sum6 = do | |
maybeNum <- head | |
case maybeNum of | |
Nothing -> return 0 |
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 ScopedTypeVariables #-} | |
import Prelude hiding (head, map) | |
import Data.Enumerator | |
import Control.Monad.IO.Class | |
import Control.Monad.Trans.Class | |
sumIter :: Monad m => Iteratee Int m Int | |
sumIter = do | |
maybeNum <- head | |
case maybeNum of |
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 TypeFamilies #-} | |
import Control.Monad.Trans.Identity | |
import Control.Monad.Trans.Reader | |
import Control.Monad.Trans.Writer | |
import Control.Monad.Trans.Error | |
import Control.Monad.Trans.State | |
import Control.Monad (liftM, join) | |
import qualified Control.Exception as E | |
import Control.Monad.IO.Class | |
import Control.Monad.Trans.Class |
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 Distribution.Package | |
import Distribution.PackageDescription | |
import Distribution.PackageDescription.Parse | |
import Distribution.Verbosity | |
import Distribution.Version | |
import System.Environment | |
import qualified Codec.Archive.Tar as Tar | |
import qualified Data.ByteString.Lazy as L | |
import qualified Data.Map as Map | |
import qualified Data.Text.Lazy as T |
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 #-} | |
-- | 'Enumeratee's to render XML 'Event's. Unlike libxml-enumerator and | |
-- expat-enumerator, this module does not provide IO and ST variants, since the | |
-- underlying rendering operations are pure functions. | |
module Text.XML.Render.Enumerator | |
( {-renderText | |
, renderTextLazy | |
, renderBytes | |
, renderBytesLazy | |
-} |
OlderNewer