for your convinience these instuction is available as:
gist
git repo
ubuntu prerequisites
// Free monad based thread simulation and FRP constructs written in JavaScript | |
// First, we need some way to express lazy values and actions. | |
// We can use zero-argument functions for this purpose: call the function and | |
// you get the value. We also need to compose lazy values/actions. For that | |
// we have bindLazy function. Lazy values are not expected to be pure | |
// in this program: evaluating a lazy value/action at different times can produce | |
// a different value. |
Хм... Сложно согласиться с | |
> в Haskell монады -- это способ записать _императивный_ код в полностью декларативном языке. | |
Наверное если смотреть технически - то это верное высказывание. | |
Но оно скрывает суть. Скрывает смысл "пользы от монад". | |
Насколько я помню... | |
Монады - они и в Африке монады. В независимости от того какой язык - чисто декларативный/функциональный или нет. |
lazy val scalaJson = ProjectRef(uri("git://github.com/mdedetrich/scala-json-ast.git#c5ee84"), "scalaJsonASTJVM") | |
lazy val root = (project in file(".")). | |
dependsOn(scalaJson). | |
settings(inThisBuild(List( | |
organization := "com.example", | |
scalaVersion := "2.11.8" | |
)), | |
name := "sourceDeps" | |
) |
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-} | |
import Control.Monad | |
import Control.Monad.Free | |
class (Functor f, Functor g, Functor h) => Compose f g h | f g -> h where | |
compose :: f x -> g y -> Free h (Free f x, Free g y) | |
compose f g = return (liftF f, liftF g) | |
composeF :: Compose f g h => Free f x -> Free g x -> Free h x |
trait Module { | |
type shape | |
} |
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Control.Lens -- lens | |
import Control.Monad.IO.Class -- transformers | |
import Control.Monad.Trans.AWS -- amazonka | |
import Network.AWS.EC2 -- amazonka-ec2 | |
main :: IO () |
package com.vertigo.service.rest.search; | |
import java.util.EnumSet; | |
import org.eclipse.jetty.server.Server; | |
import org.eclipse.jetty.servlet.DefaultServlet; | |
import org.eclipse.jetty.servlet.ServletContextHandler; | |
import com.vertigo.service.rest.search.filter.GuiceFilter; | |
import com.vertigo.service.rest.search.listener.GuiceServletContextListener; |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
module RedBlackTree where | |
data Zero | |
data Succ n | |
type One = Succ Zero | |
data Black |
# Installing graphite dependencies | |
apt-get install -y python2.6 python-pip python-cairo python-django python-django-tagging | |
apt-get install -y libapache2-mod-wsgi python-twisted python-memcache python-pysqlite2 python-simplejson | |
pip install whisper | |
pip install carbon | |
pip install graphite-web | |
# Setup a vhost by grabbing the example the graphite team released on their repo. | |
# In this file, you'll provide the url used to access to your Graphite dashboard | |
wget https://raw.github.com/tmm1/graphite/master/examples/example-graphite-vhost.conf -O /etc/apache2/sites-available/graphite |