Skip to content

Instantly share code, notes, and snippets.

View hdgarrood's full-sized avatar
💭
All of my personal repos are unmaintained

Harry Garrood hdgarrood

💭
All of my personal repos are unmaintained
View GitHub Profile
@hdgarrood
hdgarrood / Main.purs
Last active August 29, 2015 14:21
Infix declarations
module Main where
import Debug.Trace
data Two a b = Two a b
instance showTwo :: (Show a, Show b) => Show (Two a b) where
show (Two x y) = "(" <> show x <> " : " <> show y <> ")"
-- Non-associative
// module Data.Traversable
exports.traverseArrayImpl = function(apply) {
return function(map) {
return function(pure) {
return function(consArray) {
return function(f) {
var buildFrom = function(x) {
return function(ys) {
@hdgarrood
hdgarrood / week-1.markdown
Last active August 29, 2015 14:22
Pursuit notes

Pursuit GSOC: Week 1

I'm going keeping a blog of progress on my Google Summer of Code project this summer, which is various enhancements to the PureScript code search tool Pursuit.

I have managed to get quite a bit done already, since I had been contributing to PureScript (and Pursuit in particular) for a while before I even applied for Google Summer of Code. So, for the first entry, I'm just going to go over what's been done so far:

@hdgarrood
hdgarrood / purescript-prelude.txt
Created June 16, 2015 21:12
An example Hoogle file, using the PureScript prelude
@package purescript-prelude
@version 999.1.0
module Prelude where
-- | <p>The <code>Unit</code> type has a single inhabitant, called <code>unit</code>. It represents
-- | values with no computational content.</p>
-- | <p><code>Unit</code> is often used, wrapped in a monadic type constructor, as the
-- | return type of a computation where only
-- | the <em>effects</em> are important.</p>
> let f c = if c then Nothing else Just false
> let x = Just true
> let y = Just false
> (x <|> y) >>= f
Nothing
> (x >>= f) <|> (y >>= f)
Just (false)
exports["concatStream'"] = function concatStream$prime(stream, callback) {
var concat = require("concat-stream");
var onSuccess = function(str) {
console.log("debug: hi, success");
callback(null, str);
};
var onError = function(err) {
console.log("debug: hi, err");

Re-exports + documentation

  • If values are re-exported from an "internal" module, then should they be hidden?

    • A: only if we also are hiding "internal" modules, which we're not
    • "internal" modules might not be a good idea anyway (cf. cabal)
  • If a whole, real module is re-exported, should we list everything, or just link to it?

  • list everything, pros:

Module Neon

Re-exported from Neon.Class:

Add

class Add a where
 add :: a -&gt; a -&gt; a
diff --git a/docs/Data/Array.md b/docs/Data/Array.md
index 4e4a3d9..8bd12a4 100644
--- a/docs/Data/Array.md
+++ b/docs/Data/Array.md
@@ -101,6 +101,8 @@ termination.
null :: forall a. Array a -> Boolean
```
+Test whether an array is empty.
+
module Main where
import Prelude
import Control.Bind ((=<<))
import Control.Monad (when)
import Control.Monad.Eff (Eff())
import Control.Monad.Eff.Var (($=), get, Var(), makeVar)
import Control.Monad.Eff.Console (CONSOLE(), log)
import Control.Monad.Eff.Console.Unsafe (logAny)