Skip to content

Instantly share code, notes, and snippets.

body {
-moz-animation-name: roll;
-moz-animation-duration: 4s;
-moz-animation-iteration-count: 1;
-o-animation-name: roll;
-o-animation-duration: 4s;
-o-animation-iteration-count: 1;
-webkit-animation-name: roll;
-webkit-animation-duration: 4s;
-webkit-animation-iteration-count: 1;
@jacobstanley
jacobstanley / 1-ieee754.hs
Created August 9, 2011 20:29
IEEE754 conversion comparison
{-# LANGUAGE FlexibleContexts #-}
import Data.Word (Word32, Word64)
import Data.Array.ST (newArray, castSTUArray, readArray, MArray, STUArray)
import GHC.ST (runST, ST)
import qualified Foreign as F
main :: IO ()
withPost :: Splice Application
withPost = callView [ ("title", titleSplice)
, ("date", dateSplice)
, ("body", bodySplice) ]
withPost :: Splice Application
withPost = viewWith [ ("title", titleSplice)
, ("date", dateSplice)
, ("body", bodySplice) ]
mapBind' :: (Monad m) => (a -> [(Text, Splice m)]) -> [a] -> Splice m
mapBind' f = liftM concat . mapM localSplices
where
localSplices v = localTS
(bindSplices $ f v)
(runNodeList =<< liftM X.childNodes getParamNode)
problem.hs:4:4:
Inferred type is less polymorphic than expected
Quantified type variable `a' is mentioned in the environment:
out :: Enumerator Builder IO a (bound at problem.hs:3:4)
In the first argument of `addToOutput', namely `out'
In the expression: addToOutput out
In the expression:
do { out <- runRequestBody mkOutput;
addToOutput out }
On Ubuntu 10.04:
> runghc HDBC-Ubuntu.hs
HDBC-Ubuntu.hs: Prelude.(!!): index too large
On Windows XP:
> runghc HDBC-Windows.hs
HDBC-Windows.hs: Prelude.(!!): index too large
site :: MVar SimState -> Snap ()
site sim = catch500 $
ifTop (fileServe "static/index.html")
<|> route [ ("vessel/speed/:speed", method PUT putSpeed sim)
, ("vessel", method GET getSim sim)
]
<|> fileServe "static"
diff --git a/src/Text/Templating/Heist/Internal.hs b/src/Text/Templating/Heist/Internal.hs
index 0a65b28..1ea4169 100644
--- a/src/Text/Templating/Heist/Internal.hs
+++ b/src/Text/Templating/Heist/Internal.hs
@@ -19,6 +19,7 @@ import Data.Map (Map)
import Data.Typeable
import Prelude hiding (catch)
import System.Directory.Tree hiding (name)
+import System.FilePath.Posix
import Text.XML.Expat.Format
Resolving dependencies...
Configuring snap-server-0.2.4...
Warning: 'hs-source-dirs: dist/build/autogen' directory does not exist.
Preprocessing library snap-server-0.2.4...
Building snap-server-0.2.4...
[1 of 8] Compiling Snap.Internal.Http.Parser ( src\Snap\Internal\Http\Parser.hs, dist\build\Snap\Int
ernal\Http\Parser.o )
src\Snap\Internal\Http\Parser.hs:114:4:
Couldn't match expected type `Iteratee IO a'
------------------------------------------------------------------------------
-- HTTP dates
-- | Converts a 'CTime' into an HTTP timestamp.
formatHttpTime :: CTime -> IO ByteString
-- | Converts an HTTP timestamp into a 'CTime'.
parseHttpTime :: ByteString -> IO CTime
#ifdef WIN32