Here's a few things I tried to write output to a python subprocess pipe.
from subprocess import Popen, PIPE
p = Popen('less', stdin=PIPE)
for x in xrange(100):
p.communicate('Line number %d.\n' % x)
import Effects | |
import Html exposing (Html) | |
import Mouse | |
import StartApp exposing (start) | |
import Svg exposing (..) | |
import Svg.Attributes exposing (..) |
import Task | |
import PostgRest exposing (..) | |
trainerResource = | |
resource "trainer" | |
{ id = int "id" | |
, name = string "name" | |
} |
import PostgRest exposing (..) | |
type Relation schema | |
= Relation String schema | |
-- subQuery based on query6 api | |
{-| -} | |
subQuery : (schema1 -> Relation schema2) -> (a -> b) -> Query schema1 c -> Query schema2 (a -> b) | |
subQuery getRelation recordCtor (Query name schema params decoder) = | |
case getRelation schema of |
[{name="john", age=100}, {name="jessta", age=100}, {name="mixed", age=100}] | |
|> List.map (\u -> {u | name = toUpper u.name}) | |
[{name="john", age=100}, {name="jessta", age=100}, {name="mixed", age=100}] | |
|> List.map {u | name = toUpper u.name} | |
[{name="john", age=100}, {name="jessta", age=100}, {name="mixed", age=100}] | |
|> List.map (\u -> !name (toUpper u.name) u) | |
[{name="john", age=100}, {name="jessta", age=100}, {name="mixed", age=100}] |
module Main exposing (..) | |
import Color | |
import Element exposing (..) | |
import Element.Background as Background | |
import Element.Border as Border | |
import Element.Events as Events | |
import Element.Font as Font | |
import Html exposing (Html) |
module Schema exposing (school) | |
import PostgRest exposing (Attribute, Schema, schema, string) | |
type School | |
= School School | |
school : |
import turtle | |
__turtle = turtle.Turtle() | |
__turtle.shape("turtle") | |
def degrees(n=None): | |
return __turtle.degrees(n) | |
def radians(): | |
return __turtle.radians() |
Here's a few things I tried to write output to a python subprocess pipe.
from subprocess import Popen, PIPE
p = Popen('less', stdin=PIPE)
for x in xrange(100):
p.communicate('Line number %d.\n' % x)
import json | |
import operator | |
class expect(object): | |
"""Represents a logical expectation. | |
""" | |
# a static class variable for storing all expectations |
This post is about the core abstractions found in the elm-postgrest package and how those abstractions may be relevant to similar packages.
In Elm, the design space of remote data request APIs has seen its fair share of work. We have APIs like lukewestby/elm-http-builder
which provide a thin convenience layer over elm-lang/http
.
addItem : String -> Cmd Msg