on f7c504d help sign in
4 files changed+6−61
since splitsnapshots
unifiedsplit
README.md−7 elm.json+2−11 src/Ur/Deconstructor.elm+3−42 src/Ur/Run.elm+1−1
README.md−7
@@ -8,15 +8,8 @@
88
99[![DEMO](https://img.youtube.com/vi/tynCzifvIzE/0.jpg)](https://www.youtube.com/watch?v=tynCzifvIzE)
1010
11−
12−## Getting started
13−
14−The easiest way of using this library is by using the [airlock template](https://github.com/ilyakooo0/airlock-template).
15−
1611### FFI
1712
18−This is for setting up this library from scratch.
19−
2013Urbit subscriptions require [server-side event (SSE)](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events).
2114Unfortunately, Elm does not provide a native implementation.
2215This means that we will need to use [JS FFI (aka ports)](https://guide.elm-lang.org/interop/ports.html).
elm.json+2−11
@@ -3,18 +3,9 @@
33 "name": "ilyakooo0/airlock",
44 "summary": "Urbit airlock",
55 "license": "MIT",
6− "version": "1.1.1",
6+ "version": "1.0.0",
77 "exposed-modules": [
8− "Ur",
9− "Ur.Cmd",
10− "Ur.Sub",
11− "Ur.Constructor",
12− "Ur.Deconstructor",
13− "Ur.Phonemic",
14− "Ur.Da",
15− "Ur.Uw",
16− "Ur.Run",
17− "Ur.Types"
8+ "Ur", "Ur.Cmd", "Ur.Sub", "Ur.Constructor", "Ur.Deconstructor", "Ur.Phonemic", "Ur.Da", "Ur.Uw", "Ur.Run", "Ur.Types"
189 ],
1910 "elm-version": "0.19.0 <= v < 0.20.0",
2011 "dependencies": {
src/Ur/Deconstructor.elm+3−42
@@ -6,7 +6,7 @@ module Ur.Deconstructor exposing
66 , int, signedInt, bigint
77 , float32, float64
88 , cord, tape
9− , bytes, sig, ignore, tar, lazy, debug
9+ , bytes, sig, ignore, tar, lazy
1010 )
1111
1212{-| This module provides an API to deconstruct `Noun`s into arbitrary Elm data structures.
@@ -55,7 +55,7 @@ You would parse a `[%edit @ cord]` like this:
5555
5656# Miscellaneous
5757
58−@docs bytes, sig, ignore, tar, lazy, debug
58+@docs bytes, sig, ignore, tar, lazy
5959
6060-}
6161
@@ -66,7 +66,7 @@ import Bytes exposing (Bytes, Endianness(..))
6666import Bytes.Decode as BD
6767import Bytes.Encode as BE
6868import Bytes.Extra
69−import Ur.Jam exposing (cue, isSig)
69+import Ur.Jam exposing (cue)
7070import Ur.Types exposing (..)
7171
7272
@@ -337,42 +337,3 @@ Always succeeds.
337337tar : Deconstructor Noun
338338tar =
339339 Just
340−
341−
342−{-| Debug a deconstructor.
343−If the deconstructor from the second argument fails then the failed nock will be printed to the console.
344−-}
345−debug : (String -> String) -> Deconstructor a -> Deconstructor a
346−debug log f noun =
347− case f noun of
348− Just x ->
349− Just x
350−
351− Nothing ->
352− let
353− _ =
354− log (prettyNoun noun)
355− in
356− Nothing
357−
358−
359−prettyNoun : Noun -> String
360−prettyNoun noun =
361− let
362− go isRhs n =
363− case n of
364− Atom a ->
365− if isSig a then
366− "~"
367−
368− else
369− "@"
370−
371− Cell ( lhs, rhs ) ->
372− if isRhs then
373− go False lhs ++ " " ++ go True rhs
374−
375− else
376− "[" ++ go False lhs ++ " " ++ go True rhs ++ "]"
377− in
378− go False noun
src/Ur/Run.elm+1−1
@@ -313,7 +313,7 @@ update inp msg model =
313313 NeedsActivation ->
314314 let
315315 ( eventId, reqs ) =
316− [ Poke { ship = "", agent = "hood", mark = "helm-hi", noun = C.cord "Opening airlock!" } ]
316+ [ Poke { ship = "~zod", agent = "hood", mark = "helm-hi", noun = C.cord "Opening airlock!" } ]
317317 |> tag model.eventId
318318 in
319319 ( { model | eventId = eventId }