Replies: 3 comments
-
Exciting! On my branch I have the following working: data Node = Node { i :: Main.Yarr, label :: [Text] }
data Yarr = Yes | No
main = [
Main.Node { i = Main.Yes, label = ["OK, go!", Error.error "Nooo", "Done." ] },
Main.Node { i = Main.Yes, label = ["OK, go!", Error.error "Nooo", "Done." ] }
] with ConsP
(RecordP
"Main.Node"
[ ("i", ConstructorP "Yes" Nothing)
, ( "label"
, ConsP
(TextP "OK, go!")
(ConsP
(ExceptionP
ErrorCall
(TextP
"Nooo\nCallStack (from HasCallStack):\n error, called at /home/chris/Work/chrisdone/hell/src/Hell.hs:1455:6 in main:Main"))
(ConsP (TextP "Done.") NilP)))
])
(ConsP
(RecordP
"Main.Node"
[ ("i", ConstructorP "Yes" Nothing)
, ( "label"
, ConsP
(TextP "OK, go!")
(ConsP
(ExceptionP
ErrorCall
(TextP
"Nooo\nCallStack (from HasCallStack):\n error, called at /home/chris/Work/chrisdone/hell/src/Hell.hs:1455:6 in main:Main"))
(ConsP (TextP "Done.") NilP)))
])
NilP) With this I can generate a pretty-printed text output, but also a vty-based lazily-browsable interface. When I add a presentation for |
Beta Was this translation helpful? Give feedback.
-
On my branch I've achieved the following things:
I would want to re-design slighly the Brick code to be better structured, and I think non-atomic or "non-small" objects should be folded into summaries e.g. "[ .. 5 items .. ]" or "{ 3 fields }", similar to modern Chrome/Firefox's lazy-ish handling of those. I'd also want smarter display of lists as a table, as in Nushell. But I'm mostly thinking about operational aspects/evaluation, rather than layout at the moment. Another idea was eager evaluation of atomic things, like ints, text, etc. to avoid having to delve just to see simple data. Here's a video showing what's possible: Screencast.from.11-05-25.21.46.57.webmBased on this file: data Person = Person { age :: Int, name :: Text }
data Node = Node { i :: Main.Yarr, label :: [Text], person :: Main.Person }
data Yarr = Yes | No
main = List.cycle [ -- note: infinite list
Main.Node { i = Main.Yes, label = ["OK, go!", Error.error "Nooo", "Done." ], person = Main.Person { name = "Chris", age = 23 } },
Main.Node { i = Main.Yes, label = ["Wibble" ], person = Main.Person { name = "Jerry", age = 32 } }
] |
Beta Was this translation helpful? Give feedback.
-
Checkout jless for inspiration. https://jless.io/ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It occurred to me recently that my adventures in present that I ultimately decided wasn’t tenable in Haskell, might actually be tenable for Hell:
—eval
type of function, to show any value that a Hell script can conceive of.Hell.debug :: a -> Text
(note, no type class constraint) is also viable, though would depart from Haskell, so I don’t like it. It would break parametricity which is ugly. Whereas a mere command line flag would be ok.I was watching a video about NuShell and thought, that kind of interactive display of data is actually quite viable for Hell if I combine the architectural designs from my present package and the helpful limitations of Hell.
Beta Was this translation helpful? Give feedback.
All reactions