This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module StateMachine = | |
type State<'Event> = | |
| Next of ('Event -> State<'Event>) | |
| Stop | |
let feed state event = | |
match state with | |
| Stop -> failwith "Terminal state reached" | |
| Next handler -> event |> handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="jquery.min.js"></script> | |
<script src="fabric.min.js"></script> | |
<script src="FileSaver.min.js"></script> | |
<script src="canvas-toBlob.js"></script> | |
</head> | |
<body> | |
<canvas id="c" width="800" height="600"></canvas> | |
<input id="b" type="button" value="Save as Image" /> |