Giter Site home page Giter Site logo

visualize-cbn's People

Contributors

adinapoli avatar andreasabel avatar andrewbutterfield avatar edsko avatar kderme avatar racko avatar vu3rdd avatar yigitozkavci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

visualize-cbn's Issues

Indirections

Indirections like on the left can be eliminated. However they can also have circles like on right, so not sure what should be done.
issue2

Confusing error message: "deref: invalid pointer"

$ cat t.hs
span = (\p -> \xs ->
  case xs of {
   Nil -> Pair xs xs ;
   Cons x xs' ->
     if p x then
      let res = @span p xs'
      in Pair (case @res of { Pair ys zs -> Cons x ys})
              (case @res of { Pair ys zs -> zs })
     else Pair Nil xs
  }
)

main = case (@span (\x -> True) (Cons 1 (Cons 2 (Cons 3 Nil)))) of {
  Pair ys zs -> case ys of {
    Cons y ys2 -> ys ;
    Nil -> ys
    }
  }
$ git log -1
commit d8a1ebc0a29d68b5dde8d8fbadd6c85bc47c6a7b
Author: Edsko de Vries <[email protected]>
Date:   Fri Sep 15 17:27:40 2017 +0200

    Add README
$ .cabal-sandbox/bin/visualize-cbn -i t.hs --show-trace --hide-prelude
...
visualize-cbn: deref: invalid pointer Ptr Nothing (Just "res")
CallStack (from HasCallStack):
  error, called at src/CBN/Heap.hs:78:26 in main:CBN.Heap

Show the rule/equation it will use for the next step

For example, in this example from the blog post

Prev Next (step 1, next step: apply enumFromTo)

case enumFromTo 1 3 of { 
      []    -> 0
      x:xs' -> length (1 + 0) xs'
}

It would be very neat to also see the definition of enumFromTo and a note of what the values are. Something like this:

Will apply enumFromTo, with n = 1 and m = 3:
enumFromTo = (\n -> \m ->
  if le n m then Cons n (@enumFromTo (add n 1) m)
            else Nil
)

This should probably be a separate feature request but it would also be very helpful to highlight the parts of the code where the rule will be applied. In particular when the next step is selecting a branch of a case expression. To be extra clear, we could highlight the parameters of the rule with different colours.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.