Giter Club home page Giter Club logo

purescript's Introduction

PureScript

A small strongly typed programming language with expressive types that compiles to JavaScript, written in and inspired by Haskell.

Hackage Build Status

Language info

Resources

Help!

Community Spaces

The following spaces are governed by the PureScript Community Code of Conduct. The majority of PureScript users use these spaces to discuss and collaborate on PureScript-related topics:

Unaffiliated Spaces

Some PureScript users also collaborate in the below spaces. These do not fall under the code of conduct linked above. They may have no code of conduct or one very different than the one linked above.

purescript's People

Contributors

5outh avatar andyarvanitis avatar ardumont avatar bogdanp avatar brandonhamilton avatar dylex avatar erdeszt avatar garyb avatar hdgarrood avatar japesinator avatar joneshf avatar jordanmartinez avatar kl0tl avatar kritzcreek avatar liamgoodacre avatar matthewleon avatar michaelficarra avatar mjgpy3 avatar monoidmusician avatar natefaubion avatar nicodelpiano avatar nwolverson avatar paf31 avatar panhania avatar phadej avatar puffnfresh avatar purefunctor avatar rhendric avatar rndnoise avatar zudov 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

purescript's Issues

Else If

Currently there is support for if then else, but not else if

Date Library

Wrap the pure functions on the Javascript Date type

Modules

Implement a module system

Object/Array mutation can be witnessed outside block

E.g.

foo = \x -> do
  var copy = x
  copy.bar = 1
  return copy

mutates the argument x. Need to deep copy non-primitive values when mutation happens, or at the least, when an assignment happens at a non-primitive type.

For Each

foreach x in xs
    ... many statements

In the loop body, x will not be assignable

Allowing for impurity

Currently the only mutation allowed is restricted to variables brought into existence with a block, and blocks are fully escaped at the end of the function they appear in.

This means that DOM manipulation / querying is basically not possible to use.

One proposal is to introduce an IO :: * -> * type, and allow for expressions of type IO {} to be used as "statements" within do syntax (which would no longer allow that do block to be fully pure at the edge, and so it would have to have a type of IO returnType. The var syntax could be extended to allow for: var x <- something where something :: IO a and x :: a

This would compile to the same code you can currently get by lying to the type system and saying the items are pure.

Use a different file extension

.ps is widely recognised as PostScript.
I reccomend going for the whole thing and using .purescript, but others could be fine.

Object Update Syntax

o { key = value}

Need to address a problem in the typechecker where things like

\o -> case o of
  { foo = "Bar" } -> o { foo = "Foo" }

gets an inferred type

forall r. { foo :: String; foo :: String | r } -> { foo :: String; foo :: String | r }

When the row gets subtituted into the solution set, we need to be more careful about avoiding duplicate properties.

For now the workaround is

\o -> case o of
  { foo = "Bar" } -> do
    var copy = o
    o.foo = "Foo"
    return copy

Add more tests

I started working on some tests using shelltestrunner. It would be nice to have some more.

Example does not compile

The data Person = Person { example in README give me a syntax error, unexpected '{' when I try to compile it with psc.

Top level pattern matching

E.g.

test pattern1 = y
test pattern2 = z
...

would be desugared to

test = \x -> case x of { pattern1 -> y, pattern2 -> z ... }

Prelude

Write wrapper functions for standard Javascript methods.

Type Synonyms

Need to implement type synonyms before TypeScript integration can be implemented nicely.

Lightweight syntax for while/if/for

With whitespace sensitive syntax, we can ditch unnecessary braces and employ lightweight syntax for control flow, such as

while x > 1
     x = x / 2
     x = x - 1

if x % 2 == 0
    return x
else
    return y

Type Synonym Problem

Type synonyms don't get expanded when calling a function with a type synonym in its signature

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.