Skip to content

Instantly share code, notes, and snippets.

View darthdeus's full-sized avatar

Jakub Arnold darthdeus

View GitHub Profile
compileEntity (SASSNestedRuleset (SASSRuleset selector rules)) = do
c <- compileEntities rules
return . SASSNestedRuleset $ SASSRuleset selector c
{-# LANGUAGE BangPatterns #-}
module Main where
import Control.Applicative ((*>), (<*), (<$>))
import Control.Monad (void)
import Data.List
import Data.List.Split
import Text.ParserCombinators.Parsec
import Debug.Trace
{-# LANGUAGE OverloadedStrings, TypeFamilies, TemplateHaskell,
QuasiQuotes, MultiParamTypeClasses #-}
import Yesod
data App = App
mkYesod "App" [parseRoutes|
/ RootR GET
/setname SetNameR GET POST
Couldn't match type ‘Entity
(ProcessGeneric
(PersistMonadBackend (YesodPersistBackend App (HandlerT App IO))))’
with ‘KeyBackend
persistent-1.3.1.1:Database.Persist.Sql.Types.SqlBackend
(ProcessGeneric
persistent-1.3.1.1:Database.Persist.Sql.Types.SqlBackend)’
Expected type: HandlerT
App
IO
module Handler.Processes where
import qualified Data.Text as T
import Data.Time hiding (parseTime)
import Database.Persist.Sql
import Import
utctimeField :: Field Handler UTCTime
utctimeField = Field
{ fieldParse = parseUtcInput
module Phantoms where
data PrimaryKey a = PrimaryKey Int
data Entity a = Entity (PrimaryKey a) a
data User = User { name :: String }
data Post = Post { title :: String }
find :: PrimaryKey a -> a
f :: (a -> Int) -> Int
f = undefined
g :: (forall a. a -> Int) -> Int
g = undefined
a = f (+1) -- ok
b = g (+1) -- type error
c :: (a -> Int) -> Int
import Control.Concurrent
import Control.Concurrent.Async
import Data.List.Split
main = do
iter [0..1000000] (+1)
iter xs f = fmap concat $ c $ map (\x -> return $ map f x) $ chunksOf 15 xs
c = foldr conc (return [])
$(function() {
console.log(JSON.parse(#{json}));
});
$ make master@2b76377
[ 0%] Building CXX object example/CMakeFiles/example.type_list.type_list.dir/type_list/type_list.cpp.o
In file included from /Users/darth/projects/hana/include/boost/hana/core/typeclass.hpp:13:0,
from /Users/darth/projects/hana/include/boost/hana/constant/constant.hpp:13,
from /Users/darth/projects/hana/include/boost/hana/detail/assert.hpp:13,
from /Users/darth/projects/hana/example/type_list/type_list.cpp:7:
/Users/darth/projects/hana/include/boost/hana/core/datatype.hpp:48:20: error: template declaration of 'constexpr const bool boost::hana::is_valid'
constexpr bool is_valid = true;
^
In file included from /Users/darth/projects/hana/include/boost/hana/detail/integral_fwd.hpp:17:0,