Open tranma opened 8 years ago
I think this is a bit more readable, and the indentation is more predictable too without soft breaks. it's not great but it's better
> feature salary ~> group value ~> count value
- Core:
Program (conv$0 : (Sum Error Int), conv$1 : FactIdentifier, conv$2 : Time, conv$3 : SNAPSHOT_TIME)
Precomputations:
Streams:
STREAM_FOLD (conv$4 : Map (Sum Error Int) ((Sum Error Int), (Sum Error Int)))
INIT:
Map []@{Map (Sum Error Int) ((Sum Error Int), (Sum Error Int))}
KONS:
let simp$3 = fst#@{(Sum Error Int), Time} conv$0
let simp$5 = Sum_fold#@{(Error,Int)}@{(Sum Error Int)}
(\reify$2$conv$8@{Error} left#@{Error Int} reify$2$conv$8)
(\reify$3$conv$9@{Int} Right 1@{(Sum Error Int)}) simp$3
let simp$7 = simp$5
let simp$8 = pair#@{(Sum Error Int) (Sum Error Int)} simp$3 simp$7
let simp$9 = fst#@{(Sum Error Int), Time} conv$0
in Map_insertOrUpdate#@{((Sum Error Int),((Sum Error Int), (Sum Error Int)))}
(\conv$22@{((Sum Error Int), (Sum Error Int))}
let conv$24 = snd#@{(Sum Error Int), (Sum Error Int)} conv$22
let simp$4 = fst#@{(Sum Error Int), Time} conv$0
in pair#@{(Sum Error Int) (Sum Error Int)} simp$4 (
let simp$6 = Sum_fold#@{(Error,Int)}@{(Sum Error Int)}
(\reify$2$conv$8@{Error} left#@{Error Int} reify$2$conv$8)
(\reify$3$conv$9@{Int} Sum_fold#@{(Error,Int)}@{(Sum Error Int)}
(\reify$4$conv$13@{Error} left#@{Error Int} reify$4$conv$13)
(\reify$5$conv$14@{Int} right#@{Error Int} reify$5$conv$14) (Sum_fold#@{(Error,Int)}@{(Sum Error Int)}
(\reify$0$conv$10@{Error} left#@{Error Int} reify$0$conv$10)
(\reify$1$conv$11@{Int} right#@{Error Int} (add#@{Int} reify$1$conv$11 (1@{Int}))) conv$24)) simp$4
in simp$6)) simp$8 simp$9 conv$4
Postcomputations:
conv$36 = Map_fold#@{((Sum Error Int),((Sum Error Int), (Sum Error Int)))}@{(Sum Error (Map Int Int))}
(\conv$33@{(Sum Error (Map Int Int))} \conv$28@{(Sum Error Int)} \conv$30@{((Sum Error Int), (Sum Error Int))} Sum_fold#@{(Error,Map Int Int)}@{(Sum Error (Map Int Int))}
(\conv$35@{Error} left#@{Error Map Int Int} conv$35)
(\conv$34@{Map Int Int} Sum_fold#@{(Error,Int)}@{(Sum Error (Map Int Int))}
(\conv$35@{Error} left#@{Error Map Int Int} conv$35)
(\conv$29@{Int} Sum_fold#@{(Error,Int)}@{(Sum Error (Map Int Int))}
(\conv$35@{Error} left#@{Error Map Int Int} conv$35)
(\conv$31@{Int} right#@{Error Map Int Int} (Map_insertOrUpdate#@{(Int,Int)}
(\conv$32@{Int} conv$32) conv$31 conv$29 conv$34)) (
let conv$27 = snd#@{(Sum Error Int), (Sum Error Int)} conv$30
in conv$27)) conv$28) conv$33) (Right Map []@{(Sum Error (Map Int Int))}) conv$4
Returning:
repl = conv$36
yeah this is much better at least indentation-wise.
There are still problems like unclear distinction of annotations, e.g. Map_fold#@{((Sum Error Int),((Sum Error Int), (Sum Error Int)))}@{(Sum Error (Map Int Int))}
, one is the arguments the other is the return type but it's kinda hard to see. And sometimes the annotations are separated by spaces sometimes by comma (e.g. Sum_fold#@{(Error,Int)}@{(Sum Error Int)}
). These things can be solved later though, this is a good start :rocket: :moon:
The Core pretty printer is a bit savage:
e.g.