diff --git a/IHaskell Test.ipynb b/IHaskell Test.ipynb new file mode 100644 index 00000000..25c989c5 --- /dev/null +++ b/IHaskell Test.ipynb @@ -0,0 +1,113 @@ +{ + "metadata": { + "name": "" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "code", + "collapsed": false, + "input": [ + "data Value = X Int\n", + " | Y String\n", + " | Z Float\n", + " deriving Show\n", + " \n", + "let values = [X 20,\n", + " Y \"Test\",\n", + " Z 0.5]\n", + "mapM_ print values" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 1, + "text": [ + "X 20\n", + "Y \"Test\"\n", + "Z 0.5\n" + ] + }, + { + "metadata": {}, + "output_type": "display_data" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import Control.Applicative\n", + "\n", + "print $ (+) <$> Just 3 <*> Just 10" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 2, + "text": [ + "Just 13\n" + ] + }, + { + "metadata": {}, + "output_type": "display_data" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import Control.Monad\n", + "forM [1, 2, 3, 4] $ \\x -> do\n", + " print (x * x)\n", + " return (-x)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 4, + "text": [ + "1\n", + "4\n", + "9\n", + "16\n", + "[-1,-2,-3,-4]\n" + ] + }, + { + "metadata": {}, + "output_type": "display_data" + } + ], + "prompt_number": 4 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/images/ihaskell-console.png b/images/ihaskell-console.png new file mode 100644 index 00000000..e8189a07 Binary files /dev/null and b/images/ihaskell-console.png differ diff --git a/images/ihaskell-notebook.png b/images/ihaskell-notebook.png new file mode 100644 index 00000000..4cfaa618 Binary files /dev/null and b/images/ihaskell-notebook.png differ