mirror of
https://github.com/IHaskell/IHaskell.git
synced 2025-04-14 10:26:07 +00:00
Added images and test NB.
This commit is contained in:
parent
9d23edbb48
commit
34f77d1064
113
IHaskell Test.ipynb
Normal file
113
IHaskell Test.ipynb
Normal 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
BIN
images/ihaskell-console.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 37 KiB |
BIN
images/ihaskell-notebook.png
Normal file
BIN
images/ihaskell-notebook.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
Loading…
x
Reference in New Issue
Block a user