Added images and test NB.

This commit is contained in:
Andrew Gibiansky 2013-10-20 16:03:21 -07:00
parent 9d23edbb48
commit 34f77d1064
3 changed files with 113 additions and 0 deletions

113
IHaskell Test.ipynb Normal file
View File

@ -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": {}
}
]
}

BIN
images/ihaskell-console.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB