Skip to content

Instantly share code, notes, and snippets.

instance Eq (Ref a) where
...
instance Eq a => Eq [a] where
...
>> Error in declaration filter:
>> Error checking type of term \_1 -> \_2 -> case _1 _2 of { (p, f) -> Data.Foldable.foldMap(\x -> p(x) ? Prelude.pure(x) : Data.Monoid.mempty)(f) } against type forall f. forall a. (Prelude.Applicative (f),Data.Foldable.Foldable (f),Data.Monoid.Monoid (f a)) => (a -> Prim.Boolean) -> f a -> f a:
>> Error checking type of term \_1 -> \_2 -> case _1 _2 of { (p, f) -> Data.Foldable.foldMap(\x -> p(x) ? Prelude.pure(x) : Data.Monoid.mempty)(f) } against type forall a. (Prelude.Applicative (s1840),Data.Foldable.Foldable (s1840),Data.Monoid.Monoid (s1840 a)) => (a -> Prim.Boolean) -> s1840 a -> s1840 a:
>> Error checking type of term \_1 -> \_2 -> case _1 _2 of { (p, f) -> Data.Foldable.foldMap(\x -> p(x) ? Prelude.pure(x) : Data.Monoid.mempty)(f) } against type (Prelude.Applicative (s1840),Data.Foldable.Foldable (s1840),Data.Monoid.Monoid (s1840 s1842)) => (s1842 -> Prim.Boolean) -> s1840 s1842 -> s1840 s1842:
>> Error checking type of term \_1 -> \_2 -> case _1 _2 of { (p, f)
➜ purescript git:(master) ✗ ./.cabal-sandbox/bin/psc --no-prelude -s
module Foo where
f = \o -> o {foo = 3}
(function (_ps) {
"use strict";
_ps.Foo = (function (module) {
var f = function (o) {
var newObj = {};
for (var key in o) {
➜ purescript git:(record-updates) ✗ ./.cabal-sandbox/bin/psc --no-prelude -s
module Foo where
f o = o {foo = 3}
(function (_ps) {
"use strict";
_ps.Foo = (function (module) {
var f = function (_1) {
return (function (_2) {
➜ inquire.js git:(master) ✗ grunt
Running "purescript:compile" (purescript) task
>> Error creating file lib/inquire.js
>> Error in declaration showInquire_show:
>> Error checking type of term \_1 -> case _1 of { (Inquire.EmptyAnd ) -> "" ; (Inquire.EmptyOr ) -> "" ; (Inquire.Pred (k) (r) (v : vs)) -> Prelude.(++)(Inquire.encodeURIComponent(Prelude.show(k)))(Prelude.(++)(Prelude.show(r))(Prelude.show(Data.Array.(:)(v)(vs)))) ; (Inquire.Pred (k : ks) (r) (v)) -> Prelude.(++)(Prelude.show(Data.Array.(:)(k)(ks)))(Prelude.(++)(Prelude.show(r))(Inquire.encodeURIComponent(Prelude.show(v)))) ; (Inquire.Pred (k) (r) (v)) -> Prelude.(++)(Inquire.encodeURIComponent(Prelude.show(k)))(Prelude.(++)(Prelude.show(r))(Inquire.encodeURIComponent(Prelude.show(v)))) ; (Inquire.Junc (l@Inquire.Pred (_) (_) (_)) (o) (r@Inquire.Pred (_) (_) (_))) -> Prelude.(++)(Prelude.show(l))(Prelude.(++)(Prelude.show(o))(Prelude.show(r))) ; (Inquire.Junc (l@Inquire.Pred (_) (_) (_)) (o) (r@Inquire.Junc (_) (o') (_))) | Prelude.(==)(o)(o'
@joneshf
joneshf / semigroup.purs
Created April 28, 2014 16:16
Motivation
module Motivation.Semigroup where
import Data.Monoid.All
import Data.String
instance semigroupFunction :: (Semigroup b) => Semigroup (a -> b) where
(<>) f g = \x -> f x <> g x
-- String examples.
@joneshf
joneshf / producttable.purs
Last active August 29, 2015 14:01
Thinking in react in PureScript
module ProductTable where
import Control.Monad.Eff
import Data.Array
import Data.Function
import React
import qualified Data.String as S
module Foo where
groupBy :: forall a. (a -> a -> Boolean) -> [a] -> [[a]]
groupBy _ [] = []
groupBy eq (x:xs) = case span (eq x) xs of
{init = ys, rest = zs} -> (x:ys) : groupBy eq zs
span :: forall a. (a -> Boolean) -> [a] -> { init :: [a], rest :: [a] }
span p (x:xs') | p x = case span p xs' of {init = ys, rest = zs} -> {init: (x:ys), rest: zs}
span _ xs = {init: [], rest: xs}
module Foo where
import React
import React.DOM
main = renderToBody foo
foo = div' [bar, bar]
bar = span' [text "bar"]
[gulp] Finished 'compile' after 1.01 s
[gulp] Starting 'compile'...
Error at /vagrant/bower_components/purescript-react/src/React.purs line 75, column 5:
Error in declaration spec
Error in value {
getInitialState: React.noop0
componentWillMount: React.noop0
componentDidMount: React.noop0
componentWillReceiveProps: React.noop1
shouldComponentUpdate: updateAlways