@@ -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
@@ -113,8 +113,6 @@ const f value noun =
113113 Nothing
114114
115115
116−{-| Extracts a `BigInt`.
117−-}
118116bigint : Deconstructor BigInt
119117bigint x =
120118 case x of
@@ -274,8 +272,6 @@ lazy f noun =
274272 f () noun
275273
276274
277−{-| Maps over the result of the deconstructor.
278−-}
279275map : (a -> b) -> Deconstructor a -> Deconstructor b
280276map g f noun =
281277 f noun |> Maybe.map g
@@ -337,42 +333,3 @@ Always succeeds.
337333tar : Deconstructor Noun
338334tar =
339335 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