Skip to content

Instantly share code, notes, and snippets.

View lorenzo's full-sized avatar

José Lorenzo Rodríguez lorenzo

View GitHub Profile
@lorenzo
lorenzo / Dockerfile
Created April 30, 2018 08:42
Fast multi-stage docker builds for haskell
FROM base-haskell:lts-11.7 AS builder
# Copy all local files and build the app
COPY . .
RUN stack install
FROM debian:stretch-slim AS distro
ENV LC_ALL=C.UTF-8
# Copy the executable from the builder stage
<?php
/**
* Configuration options
*
*/
$iterations = 1000000;
info();
/**
* Actual Benchmarks to run
FROM fpco/stack-build:latest as haskell-build
ADD .
RUN stack install
FROM ubuntu:16
COPY --from=haskell-build /path/to/install/folder/my-binary /usr/local/bin
CMD ["my-binary"]
import qualified Control.Distributed.Process as Process
data Config = Config
{ uiPort :: Int
, dbType :: DbBackend
, folder :: String
, testsList :: Scheduler.RunSchedule
}
newtype App a = App
share
[mkPersist sqlSettings, mkMigrate "migrateAll"]
[persistLowerCase|
Run
match Text
groupName Text
concurrency Int
created UTCTime
deriving Eq Show Generic

Keybase proof

I hereby claim:

  • I am lorenzo on github.
  • I am joselorenzo (https://keybase.io/joselorenzo) on keybase.
  • I have a public key whose fingerprint is F06B 66D2 BC5F 2312 47D5 674E DFC6 2718 69B3 3267

To claim this, I am signing this object:

• Couldn't match type ‘Element
(f0 User)’
with ‘User’
Expected type: [User]
Actual type: [Element (f0 User)]
The type variable ‘f0’ is ambiguous
• In the second argument of ‘(.~)’, namely
‘(toList makeRows :: [User])’
port module Main exposing (..)
port requestAddOne : Int -> Cmd Msg
port receiveAddOne : (Int -> Msg) -> Sub Msg
subscriptions model = Sub.batch [ receiveAddOnce GetAddOneResult]
update msg model =
(model, requestAddOne 1)
@lorenzo
lorenzo / Main.hs
Last active October 27, 2016 10:33
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad (void)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Resource
import qualified Conduit as C
import Data.Conduit (($$), (=$), (.|), (=$=))
import qualified Data.Conduit.Combinators as CC
def is_mate?(conn) do
current_user(conn)
|> Maybe.and_then(fn (user) -> Tripmate.Repo.get_by(Tripmate.Mate, user_id: user.id) end)
|> Maybe.map(fn _ -> true end)
|> Maybe.with_default(false)
end