I hereby claim:
- I am luciferous on github.
- I am neuman (https://keybase.io/neuman) on keybase.
- I have a public key whose fingerprint is 56E1 0C04 5C9C 1FDD 5F33 67F8 C644 D3A1 F6BD EABD
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| Homebrew build logs for python@2 on macOS 10.11.6 | |
| Build date: 2018-03-08 20:42:24 |
| layout | title | date | comments | author | categories | commentIssueId |
|---|---|---|---|---|---|---|
post |
A comonad of graph decompositions |
2016-04-02 13:02:54 -0400 |
true |
Rúnar |
scala comonads |
22 |
Why does Bazel build the Python module under app? Is there a parameter to make it build foo so that I can write from foo import bar? (Note: if I change foo_test.py to use from app.foo import bar the command below succeeds.)
This is my directory structure.
$ find .
.
./app
./app/foo
./app/foo/__init__.py
| {-# LANGUAGE ScopedTypeVariables #-} | |
| module Main where | |
| import Network ( withSocketsDo, listenOn, PortID(..) ) | |
| import Network.Socket ( accept, close, recv, send, Socket ) | |
| import Control.Concurrent ( forkIO, threadDelay, ThreadId ) | |
| import Control.Concurrent.STM ( atomically | |
| , orElse | |
| , newTChan | |
| , readTChan |
| import com.twitter.finagle.Http | |
| import com.twitter.finagle.http.{Http => _, _} | |
| import com.twitter.io.{Buf, Reader} | |
| import com.twitter.util.Await | |
| val tls = Http.client.withStreaming(enabled=true).withTlsWithoutValidation.newService("localhost:4433") | |
| val plain = Http.client.withStreaming(enabled=true).newService("localhost:3000") | |
| val tlsReq = Request(Version.Http11, Method.Get, "/", Reader.writable()) | |
| val tlsRes = Await.result(tls(tlsReq).liftToTry) |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE DeriveGeneric #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| module Main where | |
| import Control.Monad.Trans.Either | |
| import Data.Aeson | |
| import GHC.Generics | |
| import Servant |
| import com.twitter.finagle.http | |
| import com.twitter.conversions.time._ | |
| import com.twitter.finagle.http.{Request, Response, Status} | |
| import com.twitter.finagle.{Http, Service} | |
| import com.twitter.io.{Buf, Reader, Writer} | |
| import com.twitter.util.{Await, Future, Base64StringEncoder} | |
| import sys.process._ | |
| object HttpStreamingServer extends App { |
| sealed trait Value | |
| sealed trait Prim[A] extends Value { | |
| def value: A | |
| } | |
| case class StringPrim(value: String) extends Prim[String] | |
| val x: Value = StringPrim("hi") | |
| def get[A](v: Value): Option[A] = v match { | |
| case p: Prim[A] => Some(p.value) | |
| case _ => None |