Code Monkey home page Code Monkey logo

juniornative's People

Contributors

holoed avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

juniornative's Issues

Optimize Resolved TypeClasses in Generated JS Code

Transform this:

const anf_17 = applyClosure(__eqeq, getEnv("eqInt", _env));
const anf_20 = applyClosure(anf_17, getEnv("i", _env));
const anf_18 = applyClosure(fromInteger, getEnv("numInt", _env));
const anf_19 = 65;
const anf_21 = applyClosure(anf_18, anf_19);
const anf_22 = applyClosure(anf_20, anf_21);

into this:

const anf_19 = 65;
const anf_22 = getEnv("i", _env) == anf_19;

Closure Conversion Non-exhaustive Pattern

Bug repro
let add (z1, z2) = 
  let (a, b) = z1 in
  let (c, d) = z2 in
  (a + c, b + d)
  
let main = add ((2, 3), (4, 5)) 

src/compiler/ClosureConversion.hs:80:17-47: Non-exhaustive patterns in In (Ann _ (VarPat name))

Type Checker Unification bug

val f :: (a -> b) -> Maybe (List a) -> Maybe (List b)
let f = fmap . fmap

should compile but it doesn't, it gives instead the error:
"Unable to unify List with Maybe"

Pattern Matching Syntax

Example:

data Option a = None | Some a

let foo x = match x with
               | Some x -> x
               | None -> 0

should translate to:

data Option a = None | Some a

let foo x = if (isSome x) then (extractSome x)
            else if (isNone x) then 0
            else undefined

Inspired by Ocaml syntax:
https://v2.ocaml.org/manual/expr.html

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.