Giter Site home page Giter Site logo

blgol60's People

Contributors

ailrk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

hermetique

blgol60's Issues

Use unsafePerformIO for symbol cache

The symbol lookup and temporary name generators are memoized: they will only compute the key once, then the result will be stored in a memoization table. The problem is to use what for storing these states. To avoid unsafePerformIO, I need to wrap all operations in a state monad, and the entire computation also needs to be in the state monad to remember the change. This introduces two problems: 1. there will be an extra layer of monad, and that clutter the code. 2. Memoization table only serves the purpose of speeding up lookup, the side effect isn't really observable at all. Extra work is really not necessary.

I think a global memoization table is a legit use for the global mutable state. The goal is to have something like unsafePerformIO (newIORef HM.mepty) for recording the state and insertions will be in IO monad.

Wrong precedent when parsing if expression

from Test.hs, with runAll exprTest

=== 5 ================                                                                
  "if true and false then 1 + 3 * 2 else 4 < 10"
                                           
Left "-"
    ( line 1          
    , column 3                         
    ) :
  unexpected reserved word "if" expecting simple expression
                  
=== 8 ================
  "if not b > 3 then c >= 2 else c < 4"

Left "-"
    ( line 1
    , column 3
    ) :
  unexpected reserved word "if" expecting simple expression

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.