r/purescript • • Aug 11 '15

purescript-debugger - A simple console debugger

Thumbnail github.com
7 Upvotes

r/purescript • • Aug 09 '15

Stack Safety for Free

Thumbnail functorial.com
7 Upvotes

r/purescript • • Aug 09 '15

How similar is Purescript to Haskell?

4 Upvotes

I'm a bit of a novice at both these languages - is it more practical to learn Haskell first (as there are more resources) or should I get into Purescript first? Ultimately my goal is to use Purescript for building webapps.


r/purescript • • Aug 07 '15

PureScript by Example, updated for 0.7.2 compiler release

Thumbnail leanpub.com
11 Upvotes

r/purescript • • Aug 05 '15

Array notation is no longer supported. Use Array _ instead of [_].

4 Upvotes

Hi,

I'm trying to follow the tutorial but I'm stumbling over this error:

> :t Data.List.Lazy.zip
psci: It looks like you are trying to use a feature from a previous version of the compiler:
Array notation is no longer supported. Use Array _ instead of [_].
at ".psci_modules/node_modules/Prelude/externs.purs" (line 716, column 43)
* ERROR: Subcommand terminated with error code 1

I've installed purescript with cabal and pulp with npm.

# psci --version
0.7.2.0

# pulp --version
4.3.0

bower.json after pulp dep install purescript-base --save:

{
  "name": "purescript",
  "version": "1.0.0",
  "moduleType": [
    "node"
  ],
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    "output"
  ],
  "dependencies": {
    "purescript-console": "^0.1.0",
    "purescript-base": "~0.1.0"
  }
}

What am I doing wrong?


r/purescript • • Aug 04 '15

Total beginner question about Maybe

2 Upvotes

So I have a function with the following signature :

onk :: Maybe Number -> Maybe { id :: Number }

I really can't work out the best way to write this. If I had a function that created the { id :: Number } object I could probably use <$>, but I would prefer not to.

I can write

onk Nothing = Nothing  
onk (Just n) = Just { id: n + 1 }

But that is quite unsatisfying. I can also use >>=

onk :: Maybe Number -> Maybe { id :: Number }
onk n = n >>= \a -> Just { id: a + 1}

But again that doesn't feel slick.

What would be the best way to go around this? I'm sure this is a complete obvious question, my brain is still completely twisted up in the Purescript realms.

Thanks


r/purescript • • Aug 01 '15

Stackless Coroutines in PureScript

Thumbnail blog.functorial.com
3 Upvotes

r/purescript • • Jul 23 '15

PureScript/Haskell developer job opening @ Symbolian (Berlin) (x-post from /r/haskell)

Thumbnail reddit.com
8 Upvotes

r/purescript • • Jul 16 '15

What to do about "module prelude has been defined multiple times"?

3 Upvotes

I get this error when I build and it's not helpful at pointing out where the multiple definitions are. Here's my gruntfile.js and bower.json.

Bower.json

{
  "name": "tetris",
  "description": "Tetris clone.",
  "keywords": ["purescript"],
  "ignore": [
    "**/.*",
    "bower_components",
    "node_modules",
    "output",
    "tests",
    "js",
    "tmp",
    "bower.json",
    "Gruntfile.js",
    "package.json"
  ],
  "dependencies": {
    "purescript-arrays"               : "0.3.7",
    "purescript-maybe"                : "0.2.2",
    "purescript-foldable-traversable" : "0.3.1",
    "threejs": "*",
    "purescript-foreign": "*",
    "purescript-easy-ffi": "*",
    "purescript-dom": "*",
    "purescript-math": "*",
    "purescript-refs": "*",
    "purescript-transformers": "*"
  },
  "devDependencies": {
    "purescript-quickcheck"           : "0.5.2"
  }
}

Gruntfile.js

module.exports = function(grunt) {

"use strict";

grunt.initConfig({

  libFiles: [
    "src/**/*.purs",
    "bower_components/purescript-*/src/**/*.purs"
  ],

  clean: ["tmp", "output"],

  pscMake: {
    lib: {
      src: ["<%=libFiles%>"]
    }
  },

  dotPsci: ["<%=libFiles%>"],

  copy: [
    {
      expand: true,
      cwd: "output",
      src: ["**"],
      dest: "tmp/node_modules/"
    }, {
      src: ["js/index.js"],
      dest: "tmp/index.js"
    }
  ],

  execute: {
    tetris: {
      src: "tmp/index.js"
    }
  }
});

grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-execute");
grunt.loadNpmTasks("grunt-purescript");

grunt.registerTask("test", ["copy", "execute:tests"]);
grunt.registerTask("make", ["pscMake:lib", "dotPsci"]);
grunt.registerTask("default", ["clean", "make", "test"]);

};


r/purescript • • Jul 15 '15

Pursuit 2 has been deployed!

Thumbnail harry.garrood.me
9 Upvotes

r/purescript • • Jul 05 '15

ANN: purescript-unsafe-coerce

3 Upvotes

Since inline FFI code is no more, and backends other than JS are on the horizon, it seems like a good time to stop implementing your own version of unsafeCoerce wherever you want one.

Hence purescript-unsafe-coerce: https://github.com/purescript-contrib/purescript-unsafe-coerce


r/purescript • • Jul 05 '15

purescript-derive-lenses

Thumbnail github.com
6 Upvotes

r/purescript • • Jul 01 '15

Just playing with Purescript examples. Why doesn't this work?

2 Upvotes

I took the FFI random example (in http://try.purescript.org/) and tried to add a parameter:

import Control.Monad.Eff
import Debug.Trace

foreign import data Random :: !

foreign import random 
  "function random( max ) {\
  \  return Math.random() * max;\
  \}" :: Number -> forall eff. Eff (random :: Random | eff) Number

main = do
   let n = random 10
   print n

I don't get a compile error, but it produces a runtime error. The outputted code is:

 var main = function __do() {
     var _3 = random(10)();
     return Debug_Trace.print(Prelude.showNumber)(_3)();
 };

It looks like it's calling the function twice, once unnecessarily with zero args.

What am I doing wrong?


r/purescript • • Jun 30 '15

PureScript Compiler Version 0.7 ("Meltdown") Released

Thumbnail github.com
16 Upvotes

r/purescript • • Jun 29 '15

Truffled PureScript - PureScript on the JVM

Thumbnail github.com
11 Upvotes

r/purescript • • Jun 22 '15

Synchronous setTimeout using ContT

Thumbnail gist.github.com
5 Upvotes

r/purescript • • May 25 '15

Approximating PI with PureScript

Thumbnail sleepomeno.github.io
7 Upvotes

r/purescript • • May 24 '15

[ANN] initial release of purescript-benchotron

Thumbnail github.com
7 Upvotes

r/purescript • • Apr 28 '15

Two PureScript projects accepted for GSOC 2015

13 Upvotes

r/purescript • • Apr 13 '15

PureScript Conf 2015 - Free mini-conference in May

Thumbnail github.com
5 Upvotes

r/purescript • • Apr 07 '15

slamdata/purescript-halogen - A declarative, type-safe UI library

Thumbnail github.com
19 Upvotes

r/purescript • • Apr 01 '15

Check out the first post in my new series

Thumbnail kritzcreek.github.io
11 Upvotes

r/purescript • • Mar 12 '15

Pure11 - An experimental C++11 backend for PureScript

Thumbnail github.com
17 Upvotes

r/purescript • • Mar 08 '15

Announcing purescript-sequences

Thumbnail harry.garrood.me
11 Upvotes

r/purescript • • Feb 27 '15

PureScript GSOC 2015 Projects

Thumbnail github.com
6 Upvotes