I have been working on a compact visual representa...
# share-your-work
r
I have been working on a compact visual representation for Haskell (part of the Glance project https://github.com/rgleichman/glance/). I'll be doing an in-depth video presentation soon, so as a sneak-peak, here's what FizzBuzz (https://wiki.haskell.org/Fizzbuzz) looks like. This is the equivalent textual code: `fizz x | x
mod
15 == 0 = "FizzBuzz"` `| x
mod
3 == 0 = "Fizz"` `| x
mod
5 == 0 = "Buzz"`
| otherwise        = show x
main = traverse_ putStrLn (fmap fizz (enumFromTo 1 100))
Thanks for the feedback. Here's a version with darker colors and thinner borders.
j
Mathematicians have a notation for case-by-case analysis. See attached image as a random example. Note that it doesn't use colors, borders, or extraneous symbols (other than a bracket and a few "if"s). I think it is extremely legible! Is there a reason not to follow a path closer to this?
y
For reference here’s how it looks like in Lamdu. It looks pretty much just like text because it’s quite useful for the user to know what to type (but it’s always a structured valid AST)