Tuesday, May 19, 2015

representable functors

A nugget of insight about representable functors from The Catsters, episode Representables and Yoneda 3, around minute 1:00.

as it turns out, these are very very closely controlled, there's very little that they can do and they are completely controlled by very small amounts of data [...] we think that a lot is going on, when in fact we have very little choice in what's going on, and everything that's going on everywhere is just controlled by one really small bit   

Wednesday, May 13, 2015

a cabal sandbox for scripting

Later edit: this post is now obsolete, thanks to Stack.

As a way to facilitate Haskell scripting, I have created the hs-scripts repo on GitHub.

The idea is being able to run interpreted Hakell scripts, without having to install any package at the global level.

To test it, clone the repo, create a sandbox, and install the library. The repo should also be added to the PATH variable.

The library is empty at the moment, but is intended to hold common functions and definitions shared by multiple scripts.

You can invoke cabal repl in the repo to open a GHCi session with a lot of useful packages available (a poor man's Haskell Platform, if you will).

There are two batch scripts, hs.bat for Windows and hs.sh for Linux. They take a Haskell script name (without extension) as parameter and execute the script in the context of the sandbox. Scripts are searched in the current directory first and then in the /scripts subfolder of the repository.

Scripts are easy to compile, if necessary.

So far there's only one script, a replica of Python's ever-useful python -m SimpleHTTPServer.