├── .gitignore ├── .paket └── paket.exe ├── Fable.REPL.sln ├── LICENSE.md ├── NuGet.Config ├── README.md ├── Settings.FSharpLint ├── build.cmd ├── build.fsx ├── build.sh ├── docs ├── 06b79b8f8677e6333512a61ec7caa63f.eot ├── 1.3beae06523e8535f7e6b.js ├── 137778879005023b427be30df1f57d83.ttf ├── 1a77fe6d9f399212fcfcfde790ce66b2.ttf ├── 2.3beae06523e8535f7e6b.js ├── 3.3beae06523e8535f7e6b.js ├── 4.3beae06523e8535f7e6b.js ├── 4cfc570109e603356ee7586978c46852.eot ├── 5.3beae06523e8535f7e6b.js ├── 5c4876bef50a7df9d8ac48af75ecf11c.woff2 ├── 5c6aa3e267f5554fd7cf15557b7e44aa.eot ├── 6.3beae06523e8535f7e6b.js ├── 674f50d287a8c48dc19ba404d20fe713.eot ├── 7.3beae06523e8535f7e6b.js ├── 7c8fa37007189c6e9a50125e5ca64cff.eot ├── 8.3beae06523e8535f7e6b.js ├── 8027cf95961ca238debdd2352284e532.woff ├── 8c574ce84d5db50582b71f028e3c08b4.woff2 ├── 912ec66d7572ff821749319396470bde.svg ├── 9e710fd112b1d07cf5277175c2dec679.woff ├── CNAME ├── aba400cf60d151ff7b3da7c862cbde2d.woff ├── af2692f72b79d5935fe511236e05dbc8.woff ├── af7ae505a9eed503f8b8e6982036873e.woff2 ├── app.3beae06523e8535f7e6b.js ├── b06871f281fee6b241d60582ae9369b9.ttf ├── bfec314a4943882a8e81f066004b74f3.woff2 ├── css.worker.js ├── e0fea666fb73e683da8982050f509f81.woff2 ├── e4744d3e044f11f8ffe6.worker.js ├── e613bf534959b8c52533e77ea0cee44e.ttf ├── e6f9f118dba8224c7394.worker.js ├── ea734aec73e961c5814b1b403c9b90c6.ttf ├── ec58d7e81561b9160b27.worker.js ├── editor.worker.js ├── f50aff88aeac00a34952.worker.js ├── fee66e712a8a08eef5805a46892932ad.woff ├── html.worker.js ├── img │ ├── fsharp.ico │ └── fsharp.png ├── index.html ├── js │ └── repl │ │ ├── bundle.min.js │ │ ├── fable-library │ │ ├── Array.js │ │ ├── Async.js │ │ ├── AsyncBuilder.js │ │ ├── BigInt.js │ │ ├── BigInt │ │ │ ├── n.js │ │ │ └── z.js │ │ ├── BitConverter.js │ │ ├── Char.js │ │ ├── Date.js │ │ ├── DateOffset.js │ │ ├── Decimal.js │ │ ├── DictTypes.js │ │ ├── Double.js │ │ ├── Encoding.js │ │ ├── Event.js │ │ ├── FSharp.Collections.js │ │ ├── FSharp.Core.js │ │ ├── Global.js │ │ ├── Int32.js │ │ ├── List.js │ │ ├── Long.js │ │ ├── MailboxProcessor.js │ │ ├── Map.js │ │ ├── Observable.js │ │ ├── Option.js │ │ ├── Reflection.js │ │ ├── RegExp.js │ │ ├── Seq.js │ │ ├── Set.js │ │ ├── String.js │ │ ├── System.Text.js │ │ ├── TimeSpan.js │ │ ├── Timer.js │ │ ├── Types.js │ │ ├── Unicode.9.0.0.js │ │ ├── Uri.js │ │ ├── Util.js │ │ ├── lib │ │ │ └── big.js │ │ └── splitter.config.js │ │ ├── lib │ │ ├── BigInt │ │ │ ├── n.js │ │ │ └── z.js │ │ ├── Browser.Minimal │ │ │ └── Fable.Import.Browser.js │ │ ├── Components │ │ │ ├── Breadcrumb.js │ │ │ ├── Card.js │ │ │ ├── Dropdown.js │ │ │ ├── Media.js │ │ │ ├── Menu.js │ │ │ ├── Message.js │ │ │ ├── Modal.js │ │ │ ├── Navbar.js │ │ │ ├── Pagination.js │ │ │ ├── Panel.js │ │ │ └── Tabs.js │ │ ├── Elements │ │ │ ├── Box.js │ │ │ ├── Button.js │ │ │ ├── Content.js │ │ │ ├── Delete.js │ │ │ ├── Heading.js │ │ │ ├── Icon.js │ │ │ ├── Image.js │ │ │ ├── Notification.js │ │ │ ├── Progress.js │ │ │ ├── Table.js │ │ │ └── Tag.js │ │ ├── Elmish.React.js │ │ ├── Extra │ │ │ └── FontAwesome.js │ │ ├── Fable.React │ │ │ ├── Fable.Helpers.React.js │ │ │ └── Fable.Import.React.js │ │ ├── Fable.Recharts │ │ │ └── Fable.Recharts.js │ │ ├── Form │ │ │ ├── Checkbox.js │ │ │ ├── Control.js │ │ │ ├── Field.js │ │ │ ├── File.js │ │ │ ├── Help.js │ │ │ ├── Input.js │ │ │ ├── Label.js │ │ │ ├── Radio.js │ │ │ ├── Select.js │ │ │ └── Textarea.js │ │ ├── Fulma │ │ │ └── Common.js │ │ ├── Layouts │ │ │ ├── Column.js │ │ │ ├── Columns.js │ │ │ ├── Container.js │ │ │ ├── Footer.js │ │ │ ├── Hero.js │ │ │ ├── Level.js │ │ │ ├── Section.js │ │ │ └── Tile.js │ │ ├── Thoth.Json │ │ │ ├── Decode.js │ │ │ ├── Encode.js │ │ │ └── Types.js │ │ ├── fable-library.2.2.0-beta-010 │ │ │ ├── Array.js │ │ │ ├── Async.js │ │ │ ├── AsyncBuilder.js │ │ │ ├── BigInt.js │ │ │ ├── Date.js │ │ │ ├── DateOffset.js │ │ │ ├── Decimal.js │ │ │ ├── Int32.js │ │ │ ├── List.js │ │ │ ├── Long.js │ │ │ ├── Map.js │ │ │ ├── Option.js │ │ │ ├── Reflection.js │ │ │ ├── RegExp.js │ │ │ ├── Seq.js │ │ │ ├── Set.js │ │ │ ├── String.js │ │ │ ├── Types.js │ │ │ └── Util.js │ │ ├── lib │ │ │ └── big.js │ │ └── src │ │ │ ├── Http.js │ │ │ ├── Promise.js │ │ │ ├── PromiseImpl.js │ │ │ ├── cmd.js │ │ │ ├── prelude.js │ │ │ ├── program.js │ │ │ └── ring.js │ │ └── worker.min.js ├── libs │ ├── css │ │ ├── bulma.min.css │ │ └── font-awesome.min.css │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ ├── react-dom.production.min.js │ ├── react.production.min.js │ └── vs │ │ ├── base │ │ └── worker │ │ │ └── workerMain.js │ │ ├── basic-languages │ │ ├── apex │ │ │ └── apex.js │ │ ├── azcli │ │ │ └── azcli.js │ │ ├── bat │ │ │ └── bat.js │ │ ├── clojure │ │ │ └── clojure.js │ │ ├── coffee │ │ │ └── coffee.js │ │ ├── cpp │ │ │ └── cpp.js │ │ ├── csharp │ │ │ └── csharp.js │ │ ├── csp │ │ │ └── csp.js │ │ ├── css │ │ │ └── css.js │ │ ├── dockerfile │ │ │ └── dockerfile.js │ │ ├── fsharp │ │ │ └── fsharp.js │ │ ├── go │ │ │ └── go.js │ │ ├── handlebars │ │ │ └── handlebars.js │ │ ├── html │ │ │ └── html.js │ │ ├── ini │ │ │ └── ini.js │ │ ├── java │ │ │ └── java.js │ │ ├── javascript │ │ │ └── javascript.js │ │ ├── less │ │ │ └── less.js │ │ ├── lua │ │ │ └── lua.js │ │ ├── markdown │ │ │ └── markdown.js │ │ ├── msdax │ │ │ └── msdax.js │ │ ├── mysql │ │ │ └── mysql.js │ │ ├── objective-c │ │ │ └── objective-c.js │ │ ├── perl │ │ │ └── perl.js │ │ ├── pgsql │ │ │ └── pgsql.js │ │ ├── php │ │ │ └── php.js │ │ ├── postiats │ │ │ └── postiats.js │ │ ├── powerquery │ │ │ └── powerquery.js │ │ ├── powershell │ │ │ └── powershell.js │ │ ├── pug │ │ │ └── pug.js │ │ ├── python │ │ │ └── python.js │ │ ├── r │ │ │ └── r.js │ │ ├── razor │ │ │ └── razor.js │ │ ├── redis │ │ │ └── redis.js │ │ ├── redshift │ │ │ └── redshift.js │ │ ├── ruby │ │ │ └── ruby.js │ │ ├── rust │ │ │ └── rust.js │ │ ├── sb │ │ │ └── sb.js │ │ ├── scheme │ │ │ └── scheme.js │ │ ├── scss │ │ │ └── scss.js │ │ ├── shell │ │ │ └── shell.js │ │ ├── solidity │ │ │ └── solidity.js │ │ ├── sql │ │ │ └── sql.js │ │ ├── st │ │ │ └── st.js │ │ ├── swift │ │ │ └── swift.js │ │ ├── typescript │ │ │ └── typescript.js │ │ ├── vb │ │ │ └── vb.js │ │ ├── xml │ │ │ └── xml.js │ │ └── yaml │ │ │ └── yaml.js │ │ ├── editor │ │ ├── editor.main.css │ │ ├── editor.main.js │ │ ├── editor.main.nls.de.js │ │ ├── editor.main.nls.es.js │ │ ├── editor.main.nls.fr.js │ │ ├── editor.main.nls.it.js │ │ ├── editor.main.nls.ja.js │ │ ├── editor.main.nls.js │ │ ├── editor.main.nls.ko.js │ │ ├── editor.main.nls.ru.js │ │ ├── editor.main.nls.zh-cn.js │ │ └── editor.main.nls.zh-tw.js │ │ ├── language │ │ ├── css │ │ │ ├── cssMode.js │ │ │ └── cssWorker.js │ │ ├── html │ │ │ ├── htmlMode.js │ │ │ └── htmlWorker.js │ │ ├── json │ │ │ ├── jsonMode.js │ │ │ └── jsonWorker.js │ │ └── typescript │ │ │ ├── tsMode.js │ │ │ └── tsWorker.js │ │ └── loader.js ├── metadata │ ├── FSharp.Core.dll.txt │ ├── Fable.Core.dll.txt │ ├── Fable.Import.Browser.dll.txt │ ├── Fable.Repl.Lib.dll.txt │ ├── System.Collections.Concurrent.dll.txt │ ├── System.Collections.dll.txt │ ├── System.ComponentModel.Primitives.dll.txt │ ├── System.ComponentModel.TypeConverter.dll.txt │ ├── System.ComponentModel.dll.txt │ ├── System.Console.dll.txt │ ├── System.Core.dll.txt │ ├── System.Diagnostics.Debug.dll.txt │ ├── System.Diagnostics.Tracing.dll.txt │ ├── System.IO.dll.txt │ ├── System.Numerics.dll.txt │ ├── System.Reflection.Extensions.dll.txt │ ├── System.Reflection.Metadata.dll.txt │ ├── System.Reflection.Primitives.dll.txt │ ├── System.Reflection.TypeExtensions.dll.txt │ ├── System.Reflection.dll.txt │ ├── System.Runtime.Extensions.dll.txt │ ├── System.Runtime.Numerics.dll.txt │ ├── System.Runtime.dll.txt │ ├── System.Text.Encoding.Extensions.dll.txt │ ├── System.Text.Encoding.dll.txt │ ├── System.Text.RegularExpressions.dll.txt │ ├── System.Threading.Tasks.dll.txt │ ├── System.Threading.dll.txt │ ├── System.ValueTuple.dll.txt │ ├── System.dll.txt │ ├── mscorlib.dll.txt │ └── netstandard.dll.txt ├── precache-manifest.4b09d3ac729f0c38477b369a518a5a0d.js ├── repl-lib-map.json ├── samples │ ├── Samples.fsproj │ ├── paket.references │ ├── samples.json │ └── tour │ │ ├── classes.fs │ │ ├── collections.fs │ │ ├── functions.fs │ │ ├── index.css │ │ ├── index.html │ │ ├── primitives.fs │ │ ├── records.fs │ │ ├── unions.fs │ │ └── units.fs ├── service-worker.js ├── style.css └── typescript.worker.js ├── global.json ├── package.json ├── paket.dependencies ├── paket.lock ├── public ├── img │ ├── fsharp.ico │ └── fsharp.png ├── metadata-extra │ ├── Fable.Import.Browser.dll │ └── Fable.Repl.Lib.dll ├── repl-lib-map.json └── samples │ ├── Samples.fsproj │ ├── paket.references │ ├── samples.json │ └── tour │ ├── classes.fs │ ├── collections.fs │ ├── functions.fs │ ├── index.css │ ├── index.html │ ├── primitives.fs │ ├── records.fs │ ├── unions.fs │ └── units.fs ├── src ├── App │ ├── App.fsproj │ ├── ConsolePanel.fs │ ├── Editor.fs │ ├── Generator.fs │ ├── Helpers.fs │ ├── Libs │ │ └── ReactDeviceDetect.fs │ ├── Loader.fs │ ├── Main.fs │ ├── Monaco.fs │ ├── Mouse.fs │ ├── Prelude.fs │ ├── ReactEditor.fs │ ├── Router.fs │ ├── Sidebar.fs │ ├── Toast.fs │ ├── Widgets │ │ ├── About.fs │ │ ├── General.fs │ │ ├── Options.fs │ │ ├── Samples.fs │ │ └── Stats.fs │ ├── js │ │ ├── react-editor.js │ │ └── util.js │ └── paket.references ├── Export │ ├── Program.fs │ ├── README.md │ └── fcs-export.fsproj ├── Lib │ ├── Elmish.React.fs │ ├── Fable.Repl.Lib.fsproj │ ├── README.md │ ├── paket.references │ └── splitter.config.js ├── fonts │ ├── .DS_Store │ └── firacode │ │ ├── eot │ │ ├── FiraCode-Bold.eot │ │ ├── FiraCode-Light.eot │ │ ├── FiraCode-Medium.eot │ │ └── FiraCode-Regular.eot │ │ ├── fira_code.css │ │ ├── otf │ │ ├── FiraCode-Bold.otf │ │ ├── FiraCode-Light.otf │ │ ├── FiraCode-Medium.otf │ │ ├── FiraCode-Regular.otf │ │ └── FiraCode-Retina.otf │ │ ├── specimen.html │ │ ├── ttf │ │ ├── FiraCode-Bold.ttf │ │ ├── FiraCode-Light.ttf │ │ ├── FiraCode-Medium.ttf │ │ ├── FiraCode-Regular.ttf │ │ └── FiraCode-Retina.ttf │ │ ├── woff │ │ ├── FiraCode-Bold.woff │ │ ├── FiraCode-Light.woff │ │ ├── FiraCode-Medium.woff │ │ └── FiraCode-Regular.woff │ │ └── woff2 │ │ ├── FiraCode-Bold.woff2 │ │ ├── FiraCode-Light.woff2 │ │ ├── FiraCode-Medium.woff2 │ │ └── FiraCode-Regular.woff2 ├── index.html └── style │ ├── _variables.scss │ ├── fira_code.scss │ ├── main.scss │ ├── menu-group.scss │ ├── monaco-editor-hover-content.sass │ ├── scrollable-panel.scss │ └── toast.scss ├── webpack.config.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | public/js 2 | public/libs 3 | public/metadata 4 | deploy/ 5 | temp/ 6 | 7 | # Logs 8 | logs 9 | *.log 10 | npm-debug.log* 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | 17 | # Packages 18 | node_modules 19 | jspm_packages 20 | 21 | # Binaries 22 | bin 23 | obj 24 | 25 | # Output 26 | build 27 | 28 | .fake/ 29 | paket-files/ 30 | packages/ 31 | public/js/ 32 | public/libs/ 33 | 34 | public/*.eot 35 | public/*.svg 36 | public/*.woff2 37 | public/*.ttf 38 | public/*.woff 39 | 40 | *.DS_Store 41 | .ionide/ 42 | .paket/Paket.Restore.targets 43 | 44 | -------------------------------------------------------------------------------- /.paket/paket.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/.paket/paket.exe -------------------------------------------------------------------------------- /Fable.REPL.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26124.0 5 | MinimumVisualStudioVersion = 15.0.26124.0 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C8B9F97B-191C-4688-8F80-92749D53228E}" 7 | EndProject 8 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "App", "src\App\App.fsproj", "{31BC705C-C0E8-4447-931D-A2202623833C}" 9 | EndProject 10 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fable.Repl.Lib", "src\Lib\Fable.Repl.Lib.fsproj", "{08FEB5F5-56F4-42C5-A31F-DE5C6F64B99B}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Debug|x64 = Debug|x64 16 | Debug|x86 = Debug|x86 17 | Release|Any CPU = Release|Any CPU 18 | Release|x64 = Release|x64 19 | Release|x86 = Release|x86 20 | EndGlobalSection 21 | GlobalSection(SolutionProperties) = preSolution 22 | HideSolutionNode = FALSE 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {31BC705C-C0E8-4447-931D-A2202623833C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 26 | {31BC705C-C0E8-4447-931D-A2202623833C}.Debug|Any CPU.Build.0 = Debug|Any CPU 27 | {31BC705C-C0E8-4447-931D-A2202623833C}.Debug|x64.ActiveCfg = Debug|x64 28 | {31BC705C-C0E8-4447-931D-A2202623833C}.Debug|x64.Build.0 = Debug|x64 29 | {31BC705C-C0E8-4447-931D-A2202623833C}.Debug|x86.ActiveCfg = Debug|x86 30 | {31BC705C-C0E8-4447-931D-A2202623833C}.Debug|x86.Build.0 = Debug|x86 31 | {31BC705C-C0E8-4447-931D-A2202623833C}.Release|Any CPU.ActiveCfg = Release|Any CPU 32 | {31BC705C-C0E8-4447-931D-A2202623833C}.Release|Any CPU.Build.0 = Release|Any CPU 33 | {31BC705C-C0E8-4447-931D-A2202623833C}.Release|x64.ActiveCfg = Release|x64 34 | {31BC705C-C0E8-4447-931D-A2202623833C}.Release|x64.Build.0 = Release|x64 35 | {31BC705C-C0E8-4447-931D-A2202623833C}.Release|x86.ActiveCfg = Release|x86 36 | {31BC705C-C0E8-4447-931D-A2202623833C}.Release|x86.Build.0 = Release|x86 37 | {08FEB5F5-56F4-42C5-A31F-DE5C6F64B99B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 38 | {08FEB5F5-56F4-42C5-A31F-DE5C6F64B99B}.Debug|Any CPU.Build.0 = Debug|Any CPU 39 | {08FEB5F5-56F4-42C5-A31F-DE5C6F64B99B}.Debug|x64.ActiveCfg = Debug|Any CPU 40 | {08FEB5F5-56F4-42C5-A31F-DE5C6F64B99B}.Debug|x64.Build.0 = Debug|Any CPU 41 | {08FEB5F5-56F4-42C5-A31F-DE5C6F64B99B}.Debug|x86.ActiveCfg = Debug|Any CPU 42 | {08FEB5F5-56F4-42C5-A31F-DE5C6F64B99B}.Debug|x86.Build.0 = Debug|Any CPU 43 | {08FEB5F5-56F4-42C5-A31F-DE5C6F64B99B}.Release|Any CPU.ActiveCfg = Release|Any CPU 44 | {08FEB5F5-56F4-42C5-A31F-DE5C6F64B99B}.Release|Any CPU.Build.0 = Release|Any CPU 45 | {08FEB5F5-56F4-42C5-A31F-DE5C6F64B99B}.Release|x64.ActiveCfg = Release|Any CPU 46 | {08FEB5F5-56F4-42C5-A31F-DE5C6F64B99B}.Release|x64.Build.0 = Release|Any CPU 47 | {08FEB5F5-56F4-42C5-A31F-DE5C6F64B99B}.Release|x86.ActiveCfg = Release|Any CPU 48 | {08FEB5F5-56F4-42C5-A31F-DE5C6F64B99B}.Release|x86.Build.0 = Release|Any CPU 49 | EndGlobalSection 50 | GlobalSection(NestedProjects) = preSolution 51 | {31BC705C-C0E8-4447-931D-A2202623833C} = {C8B9F97B-191C-4688-8F80-92749D53228E} 52 | {08FEB5F5-56F4-42C5-A31F-DE5C6F64B99B} = {C8B9F97B-191C-4688-8F80-92749D53228E} 53 | EndGlobalSection 54 | EndGlobal 55 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /NuGet.Config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Fable REPL 2 | 3 | ## Building locally 4 | 5 | To develop the REPL locally, run the `WatchApp` FAKE target and then open `localhost:8080` in your browser. 6 | 7 | ## How to add a sample 8 | 9 | To add a sample, you need to add an .fs file to the `public/samples/Samples.fsproj` project (and a corresponding .html file if necessary), then update `public/samples/samples.json`. This file is used to generate the samples menu in the browser. [This commit](https://github.com/fable-compiler/repl2/commit/860243166459e10e47919815dffcc94ddbbd73b7) is a good example of adding a sample (pun intended). 10 | 11 | > If you just want to update on the existing samples, you can do it directly using Github UI and send a PR automatically. 12 | 13 | You can add three types of entries: 14 | 15 | - Category: Adds a title entry to the menu 16 | - SubCategory: Adds an entry under a category, and make it collapsible 17 | - MenuItem: Adds a classic item which when clicked will load the sample into the REPL 18 | 19 | ### Category 20 | 21 | ```json 22 | { 23 | "type": "category", 24 | "label": "Learn Fable", 25 | "children": [ 26 | ] 27 | } 28 | ``` 29 | 30 | - label: Will be displayed as the title of the category 31 | - children: A list of `SubCategory` or `MenuItem` 32 | 33 | ### SubCategory 34 | 35 | ```json 36 | { 37 | "type": "sub-category", 38 | "label": "Interop", 39 | "children": [ 40 | ] 41 | } 42 | ``` 43 | 44 | - label: Will be displayed as the title of the SubCategory 45 | - children: A list of `MenuItem` 46 | 47 | ### MenuItem 48 | 49 | ```json 50 | { 51 | "type": "menu-item", 52 | "label": "Basic canvas", 53 | "fsharpCode": "basic-canvas/basic_canvas.fs", 54 | "htmlCode": "basic-canvas/basic_canvas.html" 55 | } 56 | ``` 57 | 58 | - label: Name to display in the menu item 59 | - fsharpCode: Relative url of the F# code 60 | - htmlCode (*optional field*): Relative url of the html code 61 | - cssCode (*optional field*): Relative url of the css code 62 | 63 | All the urls for `fsharpCode`, `htmlCode` are relative to the `public/samples` folder. 64 | -------------------------------------------------------------------------------- /Settings.FSharpLint: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | False 6 | 7 | 8 | -------------------------------------------------------------------------------- /build.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | cls 3 | 4 | .paket\paket.exe restore 5 | if errorlevel 1 ( 6 | exit /b %errorlevel% 7 | ) 8 | 9 | packages\build\FAKE\tools\FAKE.exe build.fsx %* 10 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if test "$OS" = "Windows_NT" 3 | then 4 | # use .Net 5 | .paket/paket.exe restore 6 | exit_code=$? 7 | if [ $exit_code -ne 0 ]; then 8 | exit $exit_code 9 | fi 10 | 11 | packages/build/FAKE/tools/FAKE.exe $@ --fsiargs build.fsx 12 | else 13 | # use mono 14 | mono .paket/paket.exe restore 15 | exit_code=$? 16 | if [ $exit_code -ne 0 ]; then 17 | exit $exit_code 18 | fi 19 | mono packages/build/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx 20 | fi 21 | -------------------------------------------------------------------------------- /docs/06b79b8f8677e6333512a61ec7caa63f.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/06b79b8f8677e6333512a61ec7caa63f.eot -------------------------------------------------------------------------------- /docs/137778879005023b427be30df1f57d83.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/137778879005023b427be30df1f57d83.ttf -------------------------------------------------------------------------------- /docs/1a77fe6d9f399212fcfcfde790ce66b2.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/1a77fe6d9f399212fcfcfde790ce66b2.ttf -------------------------------------------------------------------------------- /docs/3.3beae06523e8535f7e6b.js: -------------------------------------------------------------------------------- 1 | (self.webpackJsonp=self.webpackJsonp||[]).push([[3],{291:function(e,n,t){"use strict";t.r(n),t.d(n,"conf",function(){return s}),t.d(n,"language",function(){return o});var s={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*//\\s*#region\\b|^\\s*\\(\\*\\s*#region(.*)\\*\\)"),end:new RegExp("^\\s*//\\s*#endregion\\b|^\\s*\\(\\*\\s*#endregion\\s*\\*\\)")}}},o={defaultToken:"",tokenPostfix:".fs",keywords:["abstract","and","atomic","as","assert","asr","base","begin","break","checked","component","const","constraint","constructor","continue","class","default","delegate","do","done","downcast","downto","elif","else","end","exception","eager","event","external","extern","false","finally","for","fun","function","fixed","functor","global","if","in","include","inherit","inline","interface","internal","land","lor","lsl","lsr","lxor","lazy","let","match","member","mod","module","mutable","namespace","method","mixin","new","not","null","of","open","or","object","override","private","parallel","process","protected","pure","public","rec","return","static","sealed","struct","sig","then","to","true","tailcall","trait","try","type","upcast","use","val","void","virtual","volatile","when","while","with","yield"],symbols:/[=>\]/,"annotation"],[/^#(if|else|endif)/,"keyword"],[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,"delimiter"],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0x[0-9a-fA-F]+LF/,"number.float"],[/0x[0-9a-fA-F]+(@integersuffix)/,"number.hex"],[/0b[0-1]+(@integersuffix)/,"number.bin"],[/\d+(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"""/,"string",'@string."""'],[/"/,"string",'@string."'],[/\@"/,{token:"string.quote",next:"@litstring"}],[/'[^\\']'B?/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\(\*(?!\))/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\*]+/,"comment"],[/\*\)/,"comment","@pop"],[/\*/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/("""|"B?)/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]],litstring:[[/[^"]+/,"string"],[/""/,"string.escape"],[/"/,{token:"string.quote",next:"@pop"}]]}}}}]); -------------------------------------------------------------------------------- /docs/4cfc570109e603356ee7586978c46852.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/4cfc570109e603356ee7586978c46852.eot -------------------------------------------------------------------------------- /docs/5c4876bef50a7df9d8ac48af75ecf11c.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/5c4876bef50a7df9d8ac48af75ecf11c.woff2 -------------------------------------------------------------------------------- /docs/5c6aa3e267f5554fd7cf15557b7e44aa.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/5c6aa3e267f5554fd7cf15557b7e44aa.eot -------------------------------------------------------------------------------- /docs/674f50d287a8c48dc19ba404d20fe713.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/674f50d287a8c48dc19ba404d20fe713.eot -------------------------------------------------------------------------------- /docs/7c8fa37007189c6e9a50125e5ca64cff.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/7c8fa37007189c6e9a50125e5ca64cff.eot -------------------------------------------------------------------------------- /docs/8027cf95961ca238debdd2352284e532.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/8027cf95961ca238debdd2352284e532.woff -------------------------------------------------------------------------------- /docs/8c574ce84d5db50582b71f028e3c08b4.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/8c574ce84d5db50582b71f028e3c08b4.woff2 -------------------------------------------------------------------------------- /docs/9e710fd112b1d07cf5277175c2dec679.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/9e710fd112b1d07cf5277175c2dec679.woff -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | try.fsharp.org -------------------------------------------------------------------------------- /docs/aba400cf60d151ff7b3da7c862cbde2d.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/aba400cf60d151ff7b3da7c862cbde2d.woff -------------------------------------------------------------------------------- /docs/af2692f72b79d5935fe511236e05dbc8.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/af2692f72b79d5935fe511236e05dbc8.woff -------------------------------------------------------------------------------- /docs/af7ae505a9eed503f8b8e6982036873e.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/af7ae505a9eed503f8b8e6982036873e.woff2 -------------------------------------------------------------------------------- /docs/b06871f281fee6b241d60582ae9369b9.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/b06871f281fee6b241d60582ae9369b9.ttf -------------------------------------------------------------------------------- /docs/bfec314a4943882a8e81f066004b74f3.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/bfec314a4943882a8e81f066004b74f3.woff2 -------------------------------------------------------------------------------- /docs/css.worker.js: -------------------------------------------------------------------------------- 1 | !function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=0)}([function(e,r,t){e.exports=function(){return new Worker(t.p+"e6f9f118dba8224c7394.worker.js")}}]); -------------------------------------------------------------------------------- /docs/e0fea666fb73e683da8982050f509f81.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/e0fea666fb73e683da8982050f509f81.woff2 -------------------------------------------------------------------------------- /docs/e613bf534959b8c52533e77ea0cee44e.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/e613bf534959b8c52533e77ea0cee44e.ttf -------------------------------------------------------------------------------- /docs/ea734aec73e961c5814b1b403c9b90c6.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/ea734aec73e961c5814b1b403c9b90c6.ttf -------------------------------------------------------------------------------- /docs/editor.worker.js: -------------------------------------------------------------------------------- 1 | !function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=0)}([function(e,r,t){e.exports=function(){return new Worker(t.p+"e4744d3e044f11f8ffe6.worker.js")}}]); -------------------------------------------------------------------------------- /docs/fee66e712a8a08eef5805a46892932ad.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/fee66e712a8a08eef5805a46892932ad.woff -------------------------------------------------------------------------------- /docs/html.worker.js: -------------------------------------------------------------------------------- 1 | !function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=0)}([function(e,r,t){e.exports=function(){return new Worker(t.p+"ec58d7e81561b9160b27.worker.js")}}]); -------------------------------------------------------------------------------- /docs/img/fsharp.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/img/fsharp.ico -------------------------------------------------------------------------------- /docs/img/fsharp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/img/fsharp.png -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Try F# 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/js/repl/fable-library/DictTypes.js: -------------------------------------------------------------------------------- 1 | import { createMutable as createMutableMap } from "./Map.js"; 2 | import { createMutable as createMutableSet } from "./Set.js"; 3 | import { declare } from "./Types.js"; 4 | export const Dictionary = declare(function Dictionary(source, comparer) { 5 | this.__mutableMap = createMutableMap(source, comparer); 6 | }); 7 | Object.defineProperty(Dictionary.prototype, "size", { get: function () { 8 | return this.__mutableMap.size; 9 | } }); 10 | Dictionary.prototype.clear = function () { return this.__mutableMap.clear(); }; 11 | Dictionary.prototype.delete = function (k) { return this.__mutableMap.delete(k); }; 12 | Dictionary.prototype.entries = function () { return this.__mutableMap.entries(); }; 13 | Dictionary.prototype.get = function (k) { return this.__mutableMap.get(k); }; 14 | Dictionary.prototype.has = function (k) { return this.__mutableMap.has(k); }; 15 | Dictionary.prototype.keys = function () { return this.__mutableMap.keys(); }; 16 | Dictionary.prototype.set = function (k, v) { return this.__mutableMap.set(k, v); }; 17 | Dictionary.prototype.values = function () { return this.__mutableMap.values(); }; 18 | Dictionary.prototype[Symbol.iterator] = function () { return this.__mutableMap[Symbol.iterator](); }; 19 | export const HashSet = declare(function HashSet(source, comparer) { 20 | this.__mutableSet = createMutableSet(source, comparer); 21 | }); 22 | Object.defineProperty(HashSet.prototype, "size", { get: function () { 23 | return this.__mutableSet.size; 24 | } }); 25 | HashSet.prototype.add = function (v) { return this.__mutableSet.add(v); }; 26 | HashSet.prototype.clear = function () { return this.__mutableSet.clear(); }; 27 | HashSet.prototype.delete = function (k) { return this.__mutableSet.delete(k); }; 28 | HashSet.prototype.has = function (k) { return this.__mutableSet.has(k); }; 29 | HashSet.prototype.values = function () { return this.__mutableSet.values(); }; 30 | HashSet.prototype[Symbol.iterator] = function () { return this.__mutableSet[Symbol.iterator](); }; 31 | -------------------------------------------------------------------------------- /docs/js/repl/fable-library/Double.js: -------------------------------------------------------------------------------- 1 | export function tryParse(str) { 2 | // TODO: test if value is valid and in range 3 | if (str != null && /\S/.test(str)) { 4 | const v = +str.replace("_", ""); 5 | if (!Number.isNaN(v)) { 6 | return [true, v]; 7 | } 8 | } 9 | return [false, 0]; 10 | } 11 | export function parse(str) { 12 | const [ok, value] = tryParse(str); 13 | if (ok) { 14 | return value; 15 | } 16 | else { 17 | throw new Error("Input string was not in a correct format."); 18 | } 19 | } 20 | // JS Number.isFinite function evals false for NaN 21 | export function isInfinity(x) { 22 | return x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY; 23 | } 24 | -------------------------------------------------------------------------------- /docs/js/repl/fable-library/FSharp.Collections.js: -------------------------------------------------------------------------------- 1 | import { compare, identityHash, equals, structuralHash } from "./Util.js"; 2 | export function HashIdentity$$$FromFunctions(hash, eq) { 3 | return { 4 | GetHashCode(x) { 5 | return hash(x); 6 | }, 7 | 8 | Equals(x$$1, y) { 9 | return eq(x$$1, y); 10 | } 11 | 12 | }; 13 | } 14 | export function HashIdentity$$$Structural() { 15 | return HashIdentity$$$FromFunctions(structuralHash, equals); 16 | } 17 | export function HashIdentity$$$Reference() { 18 | return HashIdentity$$$FromFunctions(identityHash, function (e1$$1, e2$$1) { 19 | return e1$$1 === e2$$1; 20 | }); 21 | } 22 | export function ComparisonIdentity$$$FromFunction(comparer) { 23 | return { 24 | Compare(x$$2, y$$1) { 25 | return comparer(x$$2, y$$1); 26 | } 27 | 28 | }; 29 | } 30 | export function ComparisonIdentity$$$Structural() { 31 | return ComparisonIdentity$$$FromFunction(compare); 32 | } -------------------------------------------------------------------------------- /docs/js/repl/fable-library/FSharp.Core.js: -------------------------------------------------------------------------------- 1 | import { structuralHash, equals } from "./Util.js"; 2 | import { HashIdentity$$$Structural as HashIdentity$0024$0024$0024Structural, ComparisonIdentity$$$Structural as ComparisonIdentity$0024$0024$0024Structural } from "./FSharp.Collections.js"; 3 | import { StringBuilder$$Append$$Z721C83C5 as StringBuilder$0024$0024Append$0024$0024Z721C83C5 } from "./System.Text.js"; 4 | export const LanguagePrimitives$$$GenericEqualityComparer = { 5 | Equals(x, y) { 6 | return equals(x, y); 7 | }, 8 | 9 | GetHashCode(x$$1) { 10 | return structuralHash(x$$1); 11 | } 12 | 13 | }; 14 | export const LanguagePrimitives$$$GenericEqualityERComparer = { 15 | Equals(x$$2, y$$1) { 16 | return equals(x$$2, y$$1); 17 | }, 18 | 19 | GetHashCode(x$$3) { 20 | return structuralHash(x$$3); 21 | } 22 | 23 | }; 24 | export function LanguagePrimitives$$$FastGenericComparer() { 25 | return ComparisonIdentity$0024$0024$0024Structural(); 26 | } 27 | export function LanguagePrimitives$$$FastGenericComparerFromTable() { 28 | return ComparisonIdentity$0024$0024$0024Structural(); 29 | } 30 | export function LanguagePrimitives$$$FastGenericEqualityComparer() { 31 | return HashIdentity$0024$0024$0024Structural(); 32 | } 33 | export function LanguagePrimitives$$$FastGenericEqualityComparerFromTable() { 34 | return HashIdentity$0024$0024$0024Structural(); 35 | } 36 | export function Operators$$$Failure(message) { 37 | return new Error(message); 38 | } 39 | export function Operators$$$FailurePattern(exn) { 40 | return exn.message; 41 | } 42 | export function Operators$$$NullArg(x$$4) { 43 | throw new Error(x$$4); 44 | } 45 | export function Operators$$$Lock(_lockObj, action) { 46 | return action(); 47 | } 48 | export function ExtraTopLevelOperators$$$LazyPattern(input) { 49 | return input.Value; 50 | } 51 | export function PrintfModule$$$PrintFormatToStringBuilderThen(continuation, builder, format) { 52 | const append = function append(s) { 53 | StringBuilder$0024$0024Append$0024$0024Z721C83C5(builder, s); 54 | return continuation(); 55 | }; 56 | 57 | return format.cont(append); 58 | } 59 | export function PrintfModule$$$PrintFormatToStringBuilder(builder$$1, format$$1) { 60 | return PrintfModule$$$PrintFormatToStringBuilderThen(function () {}, builder$$1, format$$1); 61 | } -------------------------------------------------------------------------------- /docs/js/repl/fable-library/Global.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/js/repl/fable-library/Global.js -------------------------------------------------------------------------------- /docs/js/repl/fable-library/MailboxProcessor.js: -------------------------------------------------------------------------------- 1 | import { defaultCancellationToken } from "./Async.js"; 2 | import { fromContinuations } from "./Async.js"; 3 | import { startImmediate } from "./Async.js"; 4 | class QueueCell { 5 | constructor(message) { 6 | this.value = message; 7 | } 8 | } 9 | class MailboxQueue { 10 | add(message) { 11 | const itCell = new QueueCell(message); 12 | if (this.firstAndLast) { 13 | this.firstAndLast[1].next = itCell; 14 | this.firstAndLast = [this.firstAndLast[0], itCell]; 15 | } 16 | else { 17 | this.firstAndLast = [itCell, itCell]; 18 | } 19 | } 20 | tryGet() { 21 | if (this.firstAndLast) { 22 | const value = this.firstAndLast[0].value; 23 | if (this.firstAndLast[0].next) { 24 | this.firstAndLast = [this.firstAndLast[0].next, this.firstAndLast[1]]; 25 | } 26 | else { 27 | delete this.firstAndLast; 28 | } 29 | return value; 30 | } 31 | return void 0; 32 | } 33 | } 34 | export default class MailboxProcessor { 35 | constructor(body, cancellationToken) { 36 | this.body = body; 37 | this.cancellationToken = cancellationToken || defaultCancellationToken; 38 | this.messages = new MailboxQueue(); 39 | } 40 | } 41 | function __processEvents($this) { 42 | if ($this.continuation) { 43 | const value = $this.messages.tryGet(); 44 | if (value) { 45 | const cont = $this.continuation; 46 | delete $this.continuation; 47 | cont(value); 48 | } 49 | } 50 | } 51 | export function startInstance($this) { 52 | startImmediate($this.body($this), $this.cancellationToken); 53 | } 54 | export function receive($this) { 55 | return fromContinuations((conts) => { 56 | if ($this.continuation) { 57 | throw new Error("Receive can only be called once!"); 58 | } 59 | $this.continuation = conts[0]; 60 | __processEvents($this); 61 | }); 62 | } 63 | export function post($this, message) { 64 | $this.messages.add(message); 65 | __processEvents($this); 66 | } 67 | export function postAndAsyncReply($this, buildMessage) { 68 | let result; 69 | let continuation; 70 | function checkCompletion() { 71 | if (result !== void 0 && continuation !== void 0) { 72 | continuation(result); 73 | } 74 | } 75 | const reply = { 76 | reply: (res) => { 77 | result = res; 78 | checkCompletion(); 79 | }, 80 | }; 81 | $this.messages.add(buildMessage(reply)); 82 | __processEvents($this); 83 | return fromContinuations((conts) => { 84 | continuation = conts[0]; 85 | checkCompletion(); 86 | }); 87 | } 88 | export function start(body, cancellationToken) { 89 | const mbox = new MailboxProcessor(body, cancellationToken); 90 | startInstance(mbox); 91 | return mbox; 92 | } 93 | -------------------------------------------------------------------------------- /docs/js/repl/fable-library/Option.js: -------------------------------------------------------------------------------- 1 | import { declare, Union } from "./Types.js"; 2 | import { compare, equals, structuralHash } from "./Util.js"; 3 | // Options are erased in runtime by Fable, but we have 4 | // the `Some` type below to wrap values that would evaluate 5 | // to null in runtime. These two rules must be followed: 6 | // 1- None is always null in runtime, a non-strict null check 7 | // (`x == null`) is enough to check the case of an option. 8 | // 2- To get the value of an option the `getValue` helper 9 | // below must **always** be used. 10 | // export type Option = T | Some; 11 | // Using a class here for better compatibility with TS files importing Some 12 | export class Some { 13 | constructor(value) { 14 | this.value = value; 15 | } 16 | // Don't add "Some" for consistency with erased options 17 | toString() { 18 | return String(this.value); 19 | } 20 | toJSON() { 21 | return this.value; 22 | } 23 | GetHashCode() { 24 | return structuralHash(this.value); 25 | } 26 | Equals(other) { 27 | return other == null 28 | ? false 29 | : equals(this.value, other instanceof Some ? other.value : other); 30 | } 31 | CompareTo(other) { 32 | return other == null 33 | ? 1 34 | : compare(this.value, other instanceof Some ? other.value : other); 35 | } 36 | } 37 | export function some(x) { 38 | return x == null || x instanceof Some ? new Some(x) : x; 39 | } 40 | export function value(x, acceptNull) { 41 | if (x == null) { 42 | if (!acceptNull) { 43 | throw new Error("Option has no value"); 44 | } 45 | return null; 46 | } 47 | else { 48 | return x instanceof Some ? x.value : x; 49 | } 50 | } 51 | export function defaultArg(arg, defaultValue, f) { 52 | return arg == null ? defaultValue : (f != null ? f(value(arg)) : value(arg)); 53 | } 54 | export function defaultArgWith(arg, defThunk) { 55 | return arg == null ? defThunk() : value(arg); 56 | } 57 | export function filter(predicate, arg) { 58 | return arg != null ? (!predicate(value(arg)) ? null : arg) : arg; 59 | } 60 | // CHOICE 61 | export const Choice = declare(function Choice(tag, name, field) { 62 | Union.call(this, tag, name, field); 63 | }, Union); 64 | export function choice1(x) { 65 | return new Choice(0, "Choice1Of2", x); 66 | } 67 | export function choice2(x) { 68 | return new Choice(1, "Choice2Of2", x); 69 | } 70 | export function tryValueIfChoice1(x) { 71 | return x.tag === 0 ? some(x.fields[0]) : null; 72 | } 73 | export function tryValueIfChoice2(x) { 74 | return x.tag === 1 ? some(x.fields[0]) : null; 75 | } 76 | // RESULT 77 | export const Result = declare(function Result(tag, name, field) { 78 | Union.call(this, tag, name, field); 79 | }, Union); 80 | export function ok(x) { 81 | return new Result(0, "Ok", x); 82 | } 83 | export function error(x) { 84 | return new Result(1, "Error", x); 85 | } 86 | export function mapOk(f, result) { 87 | return result.tag === 0 ? ok(f(result.fields[0])) : result; 88 | } 89 | export function mapError(f, result) { 90 | return result.tag === 1 ? error(f(result.fields[0])) : result; 91 | } 92 | export function bindOk(f, result) { 93 | return result.tag === 0 ? f(result.fields[0]) : result; 94 | } 95 | -------------------------------------------------------------------------------- /docs/js/repl/fable-library/System.Text.js: -------------------------------------------------------------------------------- 1 | import { declare } from "./Types.js"; 2 | import { type } from "./Reflection.js"; 3 | import { join, format } from "./String.js"; 4 | export const StringBuilder = declare(function System_Text_StringBuilder(value, capacity) { 5 | const $this$$1 = this; 6 | $this$$1.buf = []; 7 | 8 | if (!(value == null)) { 9 | $this$$1.buf.push(value); 10 | } 11 | }); 12 | export function StringBuilder$reflection() { 13 | return type("System.Text.StringBuilder"); 14 | } 15 | export function StringBuilder$$$$002Ector$$Z18115A39(value, capacity) { 16 | return this instanceof StringBuilder ? StringBuilder.call(this, value, capacity) : new StringBuilder(value, capacity); 17 | } 18 | export function StringBuilder$$$$002Ector$$Z524259A4(capacity$$1) { 19 | return StringBuilder$$$$002Ector$$Z18115A39.call(this, null, capacity$$1); 20 | } 21 | export function StringBuilder$$$$002Ector$$Z721C83C5(value$$1) { 22 | return StringBuilder$$$$002Ector$$Z18115A39.call(this, value$$1, 16); 23 | } 24 | export function StringBuilder$$$$002Ector() { 25 | return StringBuilder$$$$002Ector$$Z18115A39.call(this, null, 16); 26 | } 27 | export function StringBuilder$$Append$$Z721C83C5(x, s) { 28 | x.buf.push(s); 29 | return x; 30 | } 31 | export function StringBuilder$$AppendFormat$$433E080(x$$1, fmt, o) { 32 | x$$1.buf.push(format(fmt, o)); 33 | return x$$1; 34 | } 35 | 36 | StringBuilder.prototype.toString = function () { 37 | const __ = this; 38 | return join("", ...__.buf); 39 | }; -------------------------------------------------------------------------------- /docs/js/repl/fable-library/Timer.js: -------------------------------------------------------------------------------- 1 | import Event from "./Event.js"; 2 | export default class Timer { 3 | constructor(interval) { 4 | this.Interval = interval > 0 ? interval : 100; 5 | this.AutoReset = true; 6 | this._elapsed = new Event(); 7 | } 8 | get Elapsed() { 9 | return this._elapsed; 10 | } 11 | get Enabled() { 12 | return this._enabled; 13 | } 14 | set Enabled(x) { 15 | if (!this._isDisposed && this._enabled !== x) { 16 | this._enabled = x; 17 | if (this._enabled) { 18 | if (this.AutoReset) { 19 | this._intervalId = setInterval(() => { 20 | if (!this.AutoReset) { 21 | this.Enabled = false; 22 | } 23 | this._elapsed.Trigger(new Date()); 24 | }, this.Interval); 25 | } 26 | else { 27 | this._timeoutId = setTimeout(() => { 28 | this.Enabled = false; 29 | this._timeoutId = 0; 30 | if (this.AutoReset) { 31 | this.Enabled = true; 32 | } 33 | this._elapsed.Trigger(new Date()); 34 | }, this.Interval); 35 | } 36 | } 37 | else { 38 | if (this._timeoutId) { 39 | clearTimeout(this._timeoutId); 40 | this._timeoutId = 0; 41 | } 42 | if (this._intervalId) { 43 | clearInterval(this._intervalId); 44 | this._intervalId = 0; 45 | } 46 | } 47 | } 48 | } 49 | Dispose() { 50 | this.Enabled = false; 51 | this._isDisposed = true; 52 | } 53 | Close() { 54 | this.Dispose(); 55 | } 56 | Start() { 57 | this.Enabled = true; 58 | } 59 | Stop() { 60 | this.Enabled = false; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /docs/js/repl/fable-library/Uri.js: -------------------------------------------------------------------------------- 1 | export default class Uri { 2 | constructor(value, kindOrUri = 1 /* Absolute */) { 3 | if (typeof value === "string" && typeof kindOrUri === "number") { 4 | if (kindOrUri === 1 /* Absolute */) { 5 | try { 6 | this.url = new URL(value); 7 | this.kind = kindOrUri; 8 | } 9 | catch (e) { 10 | throw new Error("Invalid URI: The format of the URI could not be determined."); 11 | } 12 | } 13 | else if (kindOrUri === 2 /* Relative */) { 14 | let isRelativeUrl = false; 15 | try { 16 | const url = new URL(value); 17 | isRelativeUrl = false; 18 | } 19 | catch (e) { 20 | isRelativeUrl = true; 21 | } 22 | if (isRelativeUrl) { 23 | this.url = value; 24 | this.kind = kindOrUri; 25 | } 26 | else { 27 | throw new Error("uri is not a relative path"); 28 | } 29 | } 30 | else { 31 | this.url = value; 32 | this.kind = kindOrUri; 33 | } 34 | } 35 | else if (value instanceof Uri && typeof kindOrUri === "string") { 36 | if (value.kind !== 1 /* Absolute */) { 37 | throw new Error("base uri should has Absolute kind"); 38 | } 39 | this.url = new URL(kindOrUri, value.url); 40 | this.kind = 1 /* Absolute */; 41 | } 42 | else if (value instanceof Uri && kindOrUri instanceof Uri) { 43 | if (value.kind !== 1 /* Absolute */) { 44 | throw new Error("base uri should has Absolute kind"); 45 | } 46 | if (kindOrUri.kind !== 2 /* Relative */) { 47 | throw new Error("relative uri should has Relative kind"); 48 | } 49 | this.url = new URL(kindOrUri.url, value.url); 50 | this.kind = 1 /* Absolute */; 51 | } 52 | } 53 | parseUrl() { 54 | if (this.kind === 1 /* Absolute */) { 55 | return this.url; 56 | } 57 | if (this.kind === 0 /* RelativeOrAbsolute */) { 58 | return new URL(this.url); 59 | } 60 | throw new Error("relative url can not parse as a URI"); 61 | } 62 | get isAbsoluteUri() { 63 | try { 64 | this.parseUrl(); 65 | return true; 66 | } 67 | catch (e) { 68 | return false; 69 | } 70 | } 71 | get scheme() { 72 | const protocol = this.parseUrl().protocol; 73 | return protocol.slice(0, protocol.length - 1); 74 | } 75 | get host() { 76 | return this.parseUrl().host; 77 | } 78 | get absolutePath() { 79 | return this.parseUrl().pathname; 80 | } 81 | get query() { 82 | return this.parseUrl().search; 83 | } 84 | get pathAndQuery() { 85 | const url = this.parseUrl(); 86 | return url.pathname + url.search; 87 | } 88 | get fragment() { 89 | return this.parseUrl().hash; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /docs/js/repl/fable-library/splitter.config.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | const path = require("path"); 3 | const useCommonjs = process.argv.find(v => v === "--commonjs"); 4 | console.log("Compiling to " + (useCommonjs ? "commonjs" : "ES2015 modules") + "..."); 5 | const babelOptions = useCommonjs 6 | ? { plugins: ["@babel/plugin-transform-modules-commonjs"] } 7 | : {}; 8 | const fableOptions = { 9 | define: [ 10 | "FX_NO_BIGINT" 11 | ], 12 | }; 13 | const outDir = useCommonjs 14 | ? "../../build/fable-library-commonjs" 15 | : "../../build/fable-library"; 16 | module.exports = { 17 | cli: { 18 | path: resolve("../Fable.Cli"), 19 | fableLibrary: "force:${outDir}" 20 | }, 21 | entry: resolve("Fable.Library.fsproj"), 22 | outDir: resolve(outDir), 23 | allFiles: true, 24 | // port: 61225, 25 | babel: babelOptions, 26 | fable: fableOptions, 27 | }; 28 | function resolve(p) { 29 | return path.join(__dirname, p); 30 | } 31 | -------------------------------------------------------------------------------- /docs/js/repl/lib/Browser.Minimal/Fable.Import.Browser.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/js/repl/lib/Browser.Minimal/Fable.Import.Browser.js -------------------------------------------------------------------------------- /docs/js/repl/lib/Elements/Box.js: -------------------------------------------------------------------------------- 1 | import { Common$002EHelpers$$$classes as Common$0024002EHelpers$0024$0024$0024classes, Common$$$genericParse as Common$0024$0024$0024genericParse } from "../Fulma/Common.js"; 2 | import { List } from "../fable-library.2.2.0-beta-010/Types.js"; 3 | import { createObj } from "../fable-library.2.2.0-beta-010/Util.js"; 4 | const createElement = React.createElement; 5 | export function box$0027(options, children) { 6 | const opts = Common$0024$0024$0024genericParse(options); 7 | const classes = Common$0024002EHelpers$0024$0024$0024classes("box", new List(opts.CustomClass, opts.Modifiers), new List()); 8 | return createElement("div", createObj(new List(classes, opts.Props), 1), ...children); 9 | } 10 | -------------------------------------------------------------------------------- /docs/js/repl/lib/Elements/Content.js: -------------------------------------------------------------------------------- 1 | import { List, Record, declare, Union } from "../fable-library.2.2.0-beta-010/Types.js"; 2 | import { Common$002EHelpers$$$classes as Common$0024002EHelpers$0024$0024$0024classes, Size$$$ofSize as Size$0024$0024$0024ofSize, Modifier$$$parseModifiers as Modifier$0024$0024$0024parseModifiers, Modifier$002EIModifier$reflection as Modifier$0024002EIModifier$0024reflection, Size$002EISize$reflection as Size$0024002EISize$0024reflection } from "../Fulma/Common.js"; 3 | import { record, option, union, list as list$$1, type, string } from "../fable-library.2.2.0-beta-010/Reflection.js"; 4 | import { fold } from "../fable-library.2.2.0-beta-010/List.js"; 5 | import { createObj } from "../fable-library.2.2.0-beta-010/Util.js"; 6 | const createElement = React.createElement; 7 | export const Option = declare(function Fulma_Content_Option(tag, name, ...fields) { 8 | Union.call(this, tag, name, ...fields); 9 | }, Union); 10 | export function Option$reflection() { 11 | return union("Fulma.Content.Option", [], Option, () => [["Size", [Size$0024002EISize$0024reflection()]], ["CustomClass", [string]], ["Props", [list$$1(type("Fable.Helpers.React.Props.IHTMLProp"))]], ["Modifiers", [list$$1(Modifier$0024002EIModifier$0024reflection())]]]); 12 | } 13 | export const Options = declare(function Fulma_Content_Options(arg1, arg2, arg3, arg4) { 14 | this.Size = arg1; 15 | this.Props = arg2; 16 | this.CustomClass = arg3; 17 | this.Modifiers = arg4; 18 | }, Record); 19 | export function Options$reflection() { 20 | return record("Fulma.Content.Options", [], Options, () => [["Size", option(string)], ["Props", list$$1(type("Fable.Helpers.React.Props.IHTMLProp"))], ["CustomClass", option(string)], ["Modifiers", list$$1(option(string))]]); 21 | } 22 | export function Options$$$get_Empty() { 23 | return new Options(null, new List(), null, new List()); 24 | } 25 | export function content(options, children) { 26 | const parseOption = function parseOption(result, opt) { 27 | switch (opt.tag) { 28 | case 1: 29 | { 30 | const customClass = opt.fields[0]; 31 | return new Options(result.Size, result.Props, customClass, result.Modifiers); 32 | } 33 | 34 | case 2: 35 | { 36 | const props = opt.fields[0]; 37 | return new Options(result.Size, props, result.CustomClass, result.Modifiers); 38 | } 39 | 40 | case 3: 41 | { 42 | const modifiers = opt.fields[0]; 43 | return new Options(result.Size, result.Props, result.CustomClass, Modifier$0024$0024$0024parseModifiers(modifiers)); 44 | } 45 | 46 | default: 47 | { 48 | const size = opt.fields[0]; 49 | return new Options(Size$0024$0024$0024ofSize(size), result.Props, result.CustomClass, result.Modifiers); 50 | } 51 | } 52 | }; 53 | 54 | const opts = fold(parseOption, Options$$$get_Empty(), options); 55 | const classes = Common$0024002EHelpers$0024$0024$0024classes("content", new List(opts.CustomClass, new List(opts.Size, opts.Modifiers)), new List()); 56 | return createElement("div", createObj(new List(classes, opts.Props), 1), ...children); 57 | } 58 | -------------------------------------------------------------------------------- /docs/js/repl/lib/Elements/Icon.js: -------------------------------------------------------------------------------- 1 | import { List, Record, declare, Union } from "../fable-library.2.2.0-beta-010/Types.js"; 2 | import { Common$002EHelpers$$$classes as Common$0024002EHelpers$0024$0024$0024classes, Size$$$ofSize as Size$0024$0024$0024ofSize, Modifier$$$parseModifiers as Modifier$0024$0024$0024parseModifiers, Modifier$002EIModifier$reflection as Modifier$0024002EIModifier$0024reflection, Size$002EISize$reflection as Size$0024002EISize$0024reflection } from "../Fulma/Common.js"; 3 | import { record, option as option$$1, union, list as list$$1, type, string } from "../fable-library.2.2.0-beta-010/Reflection.js"; 4 | import { fold } from "../fable-library.2.2.0-beta-010/List.js"; 5 | import { createObj } from "../fable-library.2.2.0-beta-010/Util.js"; 6 | const createElement = React.createElement; 7 | export const Option = declare(function Fulma_Icon_Option(tag, name, ...fields) { 8 | Union.call(this, tag, name, ...fields); 9 | }, Union); 10 | export function Option$reflection() { 11 | return union("Fulma.Icon.Option", [], Option, () => [["Size", [Size$0024002EISize$0024reflection()]], "IsLeft", "IsRight", ["CustomClass", [string]], ["Props", [list$$1(type("Fable.Helpers.React.Props.IHTMLProp"))]], ["Modifiers", [list$$1(Modifier$0024002EIModifier$0024reflection())]]]); 12 | } 13 | export const Options = declare(function Fulma_Icon_Options(arg1, arg2, arg3, arg4, arg5) { 14 | this.Size = arg1; 15 | this.Position = arg2; 16 | this.CustomClass = arg3; 17 | this.Props = arg4; 18 | this.Modifiers = arg5; 19 | }, Record); 20 | export function Options$reflection() { 21 | return record("Fulma.Icon.Options", [], Options, () => [["Size", option$$1(string)], ["Position", option$$1(string)], ["CustomClass", option$$1(string)], ["Props", list$$1(type("Fable.Helpers.React.Props.IHTMLProp"))], ["Modifiers", list$$1(option$$1(string))]]); 22 | } 23 | export function Options$$$get_Empty() { 24 | return new Options(null, null, null, new List(), new List()); 25 | } 26 | export function icon(options, children) { 27 | const parseOptions = function parseOptions(result, option) { 28 | switch (option.tag) { 29 | case 1: 30 | { 31 | return new Options(result.Size, "is-left", result.CustomClass, result.Props, result.Modifiers); 32 | } 33 | 34 | case 2: 35 | { 36 | return new Options(result.Size, "is-right", result.CustomClass, result.Props, result.Modifiers); 37 | } 38 | 39 | case 3: 40 | { 41 | const customClass = option.fields[0]; 42 | return new Options(result.Size, result.Position, customClass, result.Props, result.Modifiers); 43 | } 44 | 45 | case 4: 46 | { 47 | const props = option.fields[0]; 48 | return new Options(result.Size, result.Position, result.CustomClass, props, result.Modifiers); 49 | } 50 | 51 | case 5: 52 | { 53 | const modifiers = option.fields[0]; 54 | return new Options(result.Size, result.Position, result.CustomClass, result.Props, Modifier$0024$0024$0024parseModifiers(modifiers)); 55 | } 56 | 57 | default: 58 | { 59 | const size = option.fields[0]; 60 | return new Options(Size$0024$0024$0024ofSize(size), result.Position, result.CustomClass, result.Props, result.Modifiers); 61 | } 62 | } 63 | }; 64 | 65 | const opts = fold(parseOptions, Options$$$get_Empty(), options); 66 | const classes = Common$0024002EHelpers$0024$0024$0024classes("icon", new List(opts.Size, new List(opts.Position, new List(opts.CustomClass, opts.Modifiers))), new List()); 67 | return createElement("span", createObj(new List(classes, opts.Props), 1), ...children); 68 | } 69 | -------------------------------------------------------------------------------- /docs/js/repl/lib/Elements/Notification.js: -------------------------------------------------------------------------------- 1 | import { List, Record, declare, Union } from "../fable-library.2.2.0-beta-010/Types.js"; 2 | import { Common$$$genericParse as Common$0024$0024$0024genericParse, Common$002EHelpers$$$classes as Common$0024002EHelpers$0024$0024$0024classes, Color$$$ofColor as Color$0024$0024$0024ofColor, Modifier$$$parseModifiers as Modifier$0024$0024$0024parseModifiers, Modifier$002EIModifier$reflection as Modifier$0024002EIModifier$0024reflection, Color$002EIColor$reflection as Color$0024002EIColor$0024reflection } from "../Fulma/Common.js"; 3 | import { record, option, union, list as list$$1, type, string } from "../fable-library.2.2.0-beta-010/Reflection.js"; 4 | import { ofSeq, fold } from "../fable-library.2.2.0-beta-010/List.js"; 5 | import { createObj } from "../fable-library.2.2.0-beta-010/Util.js"; 6 | import { append, delay, singleton } from "../fable-library.2.2.0-beta-010/Seq.js"; 7 | const createElement = React.createElement; 8 | export const Option = declare(function Fulma_Notification_Option(tag, name, ...fields) { 9 | Union.call(this, tag, name, ...fields); 10 | }, Union); 11 | export function Option$reflection() { 12 | return union("Fulma.Notification.Option", [], Option, () => [["Color", [Color$0024002EIColor$0024reflection()]], ["CustomClass", [string]], ["Props", [list$$1(type("Fable.Helpers.React.Props.IHTMLProp"))]], ["Modifiers", [list$$1(Modifier$0024002EIModifier$0024reflection())]]]); 13 | } 14 | export const Options = declare(function Fulma_Notification_Options(arg1, arg2, arg3, arg4) { 15 | this.Color = arg1; 16 | this.CustomClass = arg2; 17 | this.Props = arg3; 18 | this.Modifiers = arg4; 19 | }, Record); 20 | export function Options$reflection() { 21 | return record("Fulma.Notification.Options", [], Options, () => [["Color", option(string)], ["CustomClass", option(string)], ["Props", list$$1(type("Fable.Helpers.React.Props.IHTMLProp"))], ["Modifiers", list$$1(option(string))]]); 22 | } 23 | export function Options$$$get_Empty() { 24 | return new Options(null, null, new List(), new List()); 25 | } 26 | export function notification(options, children) { 27 | const parseOptions = function parseOptions(result, opt) { 28 | switch (opt.tag) { 29 | case 1: 30 | { 31 | const customClass = opt.fields[0]; 32 | return new Options(result.Color, customClass, result.Props, result.Modifiers); 33 | } 34 | 35 | case 2: 36 | { 37 | const props = opt.fields[0]; 38 | return new Options(result.Color, result.CustomClass, props, result.Modifiers); 39 | } 40 | 41 | case 3: 42 | { 43 | const modifiers = opt.fields[0]; 44 | return new Options(result.Color, result.CustomClass, result.Props, Modifier$0024$0024$0024parseModifiers(modifiers)); 45 | } 46 | 47 | default: 48 | { 49 | const color = opt.fields[0]; 50 | return new Options(Color$0024$0024$0024ofColor(color), result.CustomClass, result.Props, result.Modifiers); 51 | } 52 | } 53 | }; 54 | 55 | const opts = fold(parseOptions, Options$$$get_Empty(), options); 56 | const classes = Common$0024002EHelpers$0024$0024$0024classes("notification", new List(opts.CustomClass, new List(opts.Color, opts.Modifiers)), new List()); 57 | return createElement("div", createObj(new List(classes, opts.Props), 1), ...children); 58 | } 59 | export function delete$(options$$2, children$$3) { 60 | const opts$$1 = Common$0024$0024$0024genericParse(options$$2); 61 | return createElement("button", createObj(ofSeq(delay(function () { 62 | return append(singleton(Common$0024002EHelpers$0024$0024$0024classes("delete", new List(opts$$1.CustomClass, opts$$1.Modifiers), new List())), delay(function () { 63 | return opts$$1.Props; 64 | })); 65 | })), 1), ...children$$3); 66 | } 67 | -------------------------------------------------------------------------------- /docs/js/repl/lib/Elmish.React.js: -------------------------------------------------------------------------------- 1 | import { Program$00604 as Program$002400604 } from "./src/program.js"; 2 | const render = ReactDOM.render; 3 | export function withReactSynchronous(placeholderId, program) { 4 | const setState = function setState(model, dispatch) { 5 | render(program.view(model, dispatch), document.getElementById(placeholderId)); 6 | }; 7 | 8 | return new Program$002400604(program.init, program.update, program.subscribe, program.view, setState, program.onError, program.syncDispatch); 9 | } 10 | export function withReact(placeholderId$$1, program$$1) { 11 | return withReactSynchronous(placeholderId$$1, program$$1); 12 | } 13 | -------------------------------------------------------------------------------- /docs/js/repl/lib/Fable.React/Fable.Import.React.js: -------------------------------------------------------------------------------- 1 | import { declare, Record } from "../fable-library.2.2.0-beta-010/Types.js"; 2 | import { type, record, string } from "../fable-library.2.2.0-beta-010/Reflection.js"; 3 | const Fragment = React.Fragment, 4 | PureComponent = React.PureComponent, 5 | Component = React.Component; 6 | const createPortal = ReactDOM.createPortal, 7 | unmountComponentAtNode = ReactDOM.unmountComponentAtNode, 8 | hydrate = ReactDOM.hydrate, 9 | render = ReactDOM.render; 10 | export const React$002EComponent$00602 = Component; 11 | export const React$002EPureComponent$00602 = PureComponent; 12 | export const React$002EPureStatelessComponent$00601 = PureComponent; 13 | export const React$002EFragmentProps = declare(function Fable_Import_React_FragmentProps(arg1) { 14 | this.key = arg1; 15 | }, Record); 16 | export function React$002EFragmentProps$reflection() { 17 | return record("Fable.Import.React.FragmentProps", [], React$002EFragmentProps, () => [["key", string]]); 18 | } 19 | export const React$002EFragment = Fragment; 20 | export const ReactDom = declare(function Fable_Import_ReactDom() {}); 21 | export function ReactDom$reflection() { 22 | return type("Fable.Import.ReactDom"); 23 | } 24 | export const ReactDom$$$render$$Z7FB92351 = render; 25 | export const ReactDom$$$hydrate$$Z7FB92351 = hydrate; 26 | export const ReactDom$$$unmountComponentAtNode$$48950228 = unmountComponentAtNode; 27 | export const ReactDom$$$createPortal$$Z4D70F7B4 = createPortal; 28 | -------------------------------------------------------------------------------- /docs/js/repl/lib/Form/Checkbox.js: -------------------------------------------------------------------------------- 1 | import { Common$002EHelpers$$$classes as Common$0024002EHelpers$0024$0024$0024classes, Common$$$genericParse as Common$0024$0024$0024genericParse } from "../Fulma/Common.js"; 2 | import { List } from "../fable-library.2.2.0-beta-010/Types.js"; 3 | import { createObj } from "../fable-library.2.2.0-beta-010/Util.js"; 4 | import { Props$002EHTMLAttr as Props$0024002EHTMLAttr } from "../Fable.React/Fable.Helpers.React.js"; 5 | const createElement = React.createElement; 6 | export function checkbox(options, children) { 7 | const opts = Common$0024$0024$0024genericParse(options); 8 | const classes = Common$0024002EHelpers$0024$0024$0024classes("checkbox", new List(opts.CustomClass, opts.Modifiers), new List()); 9 | return createElement("label", createObj(new List(classes, opts.Props), 1), ...children); 10 | } 11 | export function input(options$$1) { 12 | const opts$$1 = Common$0024$0024$0024genericParse(options$$1); 13 | const classes$$1 = Common$0024002EHelpers$0024$0024$0024classes("", new List(opts$$1.CustomClass, opts$$1.Modifiers), new List()); 14 | return createElement("input", createObj(new List(classes$$1, new List(new Props$0024002EHTMLAttr(117, "Type", "checkbox"), opts$$1.Props)), 1), ...new List()); 15 | } 16 | -------------------------------------------------------------------------------- /docs/js/repl/lib/Form/Help.js: -------------------------------------------------------------------------------- 1 | import { List, Record, declare, Union } from "../fable-library.2.2.0-beta-010/Types.js"; 2 | import { record, option, union, list as list$$1, type, string } from "../fable-library.2.2.0-beta-010/Reflection.js"; 3 | import { Common$002EHelpers$$$classes as Common$0024002EHelpers$0024$0024$0024classes, Modifier$$$parseModifiers as Modifier$0024$0024$0024parseModifiers, Color$$$ofColor as Color$0024$0024$0024ofColor, Modifier$002EIModifier$reflection as Modifier$0024002EIModifier$0024reflection, Color$002EIColor$reflection as Color$0024002EIColor$0024reflection } from "../Fulma/Common.js"; 4 | import { fold } from "../fable-library.2.2.0-beta-010/List.js"; 5 | import { createObj } from "../fable-library.2.2.0-beta-010/Util.js"; 6 | const createElement = React.createElement; 7 | export const Option = declare(function Fulma_Help_Option(tag, name, ...fields) { 8 | Union.call(this, tag, name, ...fields); 9 | }, Union); 10 | export function Option$reflection() { 11 | return union("Fulma.Help.Option", [], Option, () => [["CustomClass", [string]], ["Props", [list$$1(type("Fable.Helpers.React.Props.IHTMLProp"))]], ["Color", [Color$0024002EIColor$0024reflection()]], ["Modifiers", [list$$1(Modifier$0024002EIModifier$0024reflection())]]]); 12 | } 13 | export const Options = declare(function Fulma_Help_Options(arg1, arg2, arg3, arg4) { 14 | this.CustomClass = arg1; 15 | this.Props = arg2; 16 | this.Color = arg3; 17 | this.Modifiers = arg4; 18 | }, Record); 19 | export function Options$reflection() { 20 | return record("Fulma.Help.Options", [], Options, () => [["CustomClass", option(string)], ["Props", list$$1(type("Fable.Helpers.React.Props.IHTMLProp"))], ["Color", option(string)], ["Modifiers", list$$1(option(string))]]); 21 | } 22 | export function Options$$$get_Empty() { 23 | return new Options(null, new List(), null, new List()); 24 | } 25 | export function help(options, children) { 26 | const parseOptions = function parseOptions(result, _arg1) { 27 | switch (_arg1.tag) { 28 | case 1: 29 | { 30 | const props = _arg1.fields[0]; 31 | return new Options(result.CustomClass, props, result.Color, result.Modifiers); 32 | } 33 | 34 | case 2: 35 | { 36 | const color = _arg1.fields[0]; 37 | return new Options(result.CustomClass, result.Props, Color$0024$0024$0024ofColor(color), result.Modifiers); 38 | } 39 | 40 | case 3: 41 | { 42 | const modifiers = _arg1.fields[0]; 43 | return new Options(result.CustomClass, result.Props, result.Color, Modifier$0024$0024$0024parseModifiers(modifiers)); 44 | } 45 | 46 | default: 47 | { 48 | const customClass = _arg1.fields[0]; 49 | return new Options(customClass, result.Props, result.Color, result.Modifiers); 50 | } 51 | } 52 | }; 53 | 54 | const opts = fold(parseOptions, Options$$$get_Empty(), options); 55 | const classes = Common$0024002EHelpers$0024$0024$0024classes("help", new List(opts.CustomClass, new List(opts.Color, opts.Modifiers)), new List()); 56 | return createElement("p", createObj(new List(classes, opts.Props), 1), ...children); 57 | } 58 | -------------------------------------------------------------------------------- /docs/js/repl/lib/Layouts/Container.js: -------------------------------------------------------------------------------- 1 | import { List, Record, declare, Union } from "../fable-library.2.2.0-beta-010/Types.js"; 2 | import { record, bool, option, union, string, list as list$$1, type } from "../fable-library.2.2.0-beta-010/Reflection.js"; 3 | import { Common$002EHelpers$$$classes as Common$0024002EHelpers$0024$0024$0024classes, Modifier$$$parseModifiers as Modifier$0024$0024$0024parseModifiers, Modifier$002EIModifier$reflection as Modifier$0024002EIModifier$0024reflection } from "../Fulma/Common.js"; 4 | import { fold } from "../fable-library.2.2.0-beta-010/List.js"; 5 | import { createObj } from "../fable-library.2.2.0-beta-010/Util.js"; 6 | const createElement = React.createElement; 7 | export const Option = declare(function Fulma_Container_Option(tag, name, ...fields) { 8 | Union.call(this, tag, name, ...fields); 9 | }, Union); 10 | export function Option$reflection() { 11 | return union("Fulma.Container.Option", [], Option, () => ["IsFluid", "IsWideScreen", "IsFullHD", ["Props", [list$$1(type("Fable.Helpers.React.Props.IHTMLProp"))]], ["CustomClass", [string]], ["Modifiers", [list$$1(Modifier$0024002EIModifier$0024reflection())]]]); 12 | } 13 | export const Options = declare(function Fulma_Container_Options(arg1, arg2, arg3, arg4, arg5) { 14 | this.Props = arg1; 15 | this.CustomClass = arg2; 16 | this.IsFluid = arg3; 17 | this.Breakpoint = arg4; 18 | this.Modifiers = arg5; 19 | }, Record); 20 | export function Options$reflection() { 21 | return record("Fulma.Container.Options", [], Options, () => [["Props", list$$1(type("Fable.Helpers.React.Props.IHTMLProp"))], ["CustomClass", option(string)], ["IsFluid", bool], ["Breakpoint", option(string)], ["Modifiers", list$$1(option(string))]]); 22 | } 23 | export function Options$$$get_Empty() { 24 | return new Options(new List(), null, false, null, new List()); 25 | } 26 | export function container(options, children) { 27 | const parseOptions = function parseOptions(result, opt) { 28 | switch (opt.tag) { 29 | case 0: 30 | { 31 | return new Options(result.Props, result.CustomClass, true, result.Breakpoint, result.Modifiers); 32 | } 33 | 34 | case 1: 35 | { 36 | return new Options(result.Props, result.CustomClass, result.IsFluid, "is-widescreen", result.Modifiers); 37 | } 38 | 39 | case 2: 40 | { 41 | return new Options(result.Props, result.CustomClass, result.IsFluid, "is-fullhd", result.Modifiers); 42 | } 43 | 44 | case 4: 45 | { 46 | const customClass = opt.fields[0]; 47 | return new Options(result.Props, customClass, result.IsFluid, result.Breakpoint, result.Modifiers); 48 | } 49 | 50 | case 5: 51 | { 52 | const modifiers = opt.fields[0]; 53 | return new Options(result.Props, result.CustomClass, result.IsFluid, result.Breakpoint, Modifier$0024$0024$0024parseModifiers(modifiers)); 54 | } 55 | 56 | default: 57 | { 58 | const props = opt.fields[0]; 59 | return new Options(props, result.CustomClass, result.IsFluid, result.Breakpoint, result.Modifiers); 60 | } 61 | } 62 | }; 63 | 64 | const opts = fold(parseOptions, Options$$$get_Empty(), options); 65 | const classes = Common$0024002EHelpers$0024$0024$0024classes("container", new List(opts.Breakpoint, new List(opts.CustomClass, opts.Modifiers)), new List(["is-fluid", opts.IsFluid], new List())); 66 | return createElement("div", createObj(new List(classes, opts.Props), 1), ...children); 67 | } 68 | -------------------------------------------------------------------------------- /docs/js/repl/lib/Layouts/Footer.js: -------------------------------------------------------------------------------- 1 | import { Common$002EHelpers$$$classes as Common$0024002EHelpers$0024$0024$0024classes, Common$$$genericParse as Common$0024$0024$0024genericParse } from "../Fulma/Common.js"; 2 | import { List } from "../fable-library.2.2.0-beta-010/Types.js"; 3 | import { createObj } from "../fable-library.2.2.0-beta-010/Util.js"; 4 | const createElement = React.createElement; 5 | export function footer(options, children) { 6 | const opts = Common$0024$0024$0024genericParse(options); 7 | const classes = Common$0024002EHelpers$0024$0024$0024classes("footer", new List(opts.CustomClass, opts.Modifiers), new List()); 8 | return createElement("div", createObj(new List(classes, opts.Props), 1), ...children); 9 | } 10 | -------------------------------------------------------------------------------- /docs/js/repl/lib/Layouts/Section.js: -------------------------------------------------------------------------------- 1 | import { List, Record, declare, Union } from "../fable-library.2.2.0-beta-010/Types.js"; 2 | import { record, option, union, string, list as list$$1, type } from "../fable-library.2.2.0-beta-010/Reflection.js"; 3 | import { Common$002EHelpers$$$classes as Common$0024002EHelpers$0024$0024$0024classes, Modifier$$$parseModifiers as Modifier$0024$0024$0024parseModifiers, Modifier$002EIModifier$reflection as Modifier$0024002EIModifier$0024reflection } from "../Fulma/Common.js"; 4 | import { fold } from "../fable-library.2.2.0-beta-010/List.js"; 5 | import { createObj } from "../fable-library.2.2.0-beta-010/Util.js"; 6 | const createElement = React.createElement; 7 | export const Option = declare(function Fulma_Section_Option(tag, name, ...fields) { 8 | Union.call(this, tag, name, ...fields); 9 | }, Union); 10 | export function Option$reflection() { 11 | return union("Fulma.Section.Option", [], Option, () => [["Props", [list$$1(type("Fable.Helpers.React.Props.IHTMLProp"))]], ["CustomClass", [string]], "IsMedium", "IsLarge", ["Modifiers", [list$$1(Modifier$0024002EIModifier$0024reflection())]]]); 12 | } 13 | export const Options = declare(function Fulma_Section_Options(arg1, arg2, arg3, arg4) { 14 | this.Props = arg1; 15 | this.CustomClass = arg2; 16 | this.Spacing = arg3; 17 | this.Modifiers = arg4; 18 | }, Record); 19 | export function Options$reflection() { 20 | return record("Fulma.Section.Options", [], Options, () => [["Props", list$$1(type("Fable.Helpers.React.Props.IHTMLProp"))], ["CustomClass", option(string)], ["Spacing", option(string)], ["Modifiers", list$$1(option(string))]]); 21 | } 22 | export function Options$$$get_Empty() { 23 | return new Options(new List(), null, null, new List()); 24 | } 25 | export function section(options, children) { 26 | const parseOptions = function parseOptions(result, opt) { 27 | switch (opt.tag) { 28 | case 2: 29 | { 30 | return new Options(result.Props, result.CustomClass, "is-medium", result.Modifiers); 31 | } 32 | 33 | case 3: 34 | { 35 | return new Options(result.Props, result.CustomClass, "is-large", result.Modifiers); 36 | } 37 | 38 | case 1: 39 | { 40 | const customClass = opt.fields[0]; 41 | return new Options(result.Props, customClass, result.Spacing, result.Modifiers); 42 | } 43 | 44 | case 4: 45 | { 46 | const modifiers = opt.fields[0]; 47 | return new Options(result.Props, result.CustomClass, result.Spacing, Modifier$0024$0024$0024parseModifiers(modifiers)); 48 | } 49 | 50 | default: 51 | { 52 | const props = opt.fields[0]; 53 | return new Options(props, result.CustomClass, result.Spacing, result.Modifiers); 54 | } 55 | } 56 | }; 57 | 58 | const opts = fold(parseOptions, Options$$$get_Empty(), options); 59 | const classes = Common$0024002EHelpers$0024$0024$0024classes("section", new List(opts.CustomClass, new List(opts.Spacing, opts.Modifiers)), new List()); 60 | return createElement("section", createObj(new List(classes, opts.Props), 1), ...children); 61 | } 62 | -------------------------------------------------------------------------------- /docs/js/repl/lib/Thoth.Json/Types.js: -------------------------------------------------------------------------------- 1 | import { declare, Union } from "../fable-library.2.2.0-beta-010/Types.js"; 2 | import { type, union, list, obj, string } from "../fable-library.2.2.0-beta-010/Reflection.js"; 3 | import { tryGetValue } from "../fable-library.2.2.0-beta-010/Util.js"; 4 | export const ErrorReason = declare(function Thoth_Json_ErrorReason(tag, name, ...fields) { 5 | Union.call(this, tag, name, ...fields); 6 | }, Union); 7 | export function ErrorReason$reflection() { 8 | return union("Thoth.Json.ErrorReason", [], ErrorReason, () => [["BadPrimitive", [string, obj]], ["BadPrimitiveExtra", [string, obj, string]], ["BadType", [string, obj]], ["BadField", [string, obj]], ["BadPath", [string, obj, string]], ["TooSmallArray", [string, obj]], ["FailMessage", [string]], ["BadOneOf", [list(string)]]]); 9 | } 10 | export const Cache$002ECache$00601 = declare(function Thoth_Json_Cache_Cache() { 11 | const $this$$1 = this; 12 | $this$$1.cache = new Map([]); 13 | }); 14 | export function Cache$002ECache$00601$reflection($gen$$2) { 15 | return type("Thoth.Json.Cache.Cache`1", [$gen$$2]); 16 | } 17 | export function Cache$002ECache$00601$$$$002Ector() { 18 | return this != null ? Cache$002ECache$00601.call(this) : new Cache$002ECache$00601(); 19 | } 20 | export function Cache$002ECache$00601$$GetOrAdd$$43981464(__, key, factory) { 21 | const matchValue = tryGetValue(__.cache, key, null); 22 | 23 | if (matchValue[0]) { 24 | return matchValue[1]; 25 | } else { 26 | const x$$1 = factory(); 27 | 28 | __.cache.set(key, x$$1); 29 | 30 | return x$$1; 31 | } 32 | } 33 | export const Cache$$$Encoders = Cache$002ECache$00601$$$$002Ector(); 34 | export const Cache$$$Decoders = Cache$002ECache$00601$$$$002Ector(); 35 | -------------------------------------------------------------------------------- /docs/js/repl/lib/fable-library.2.2.0-beta-010/Option.js: -------------------------------------------------------------------------------- 1 | import { declare, Union } from "./Types.js"; 2 | import { compare, equals, structuralHash } from "./Util.js"; // Options are erased in runtime by Fable, but we have 3 | // the `Some` type below to wrap values that would evaluate 4 | // to null in runtime. These two rules must be followed: 5 | // 1- None is always null in runtime, a non-strict null check 6 | // (`x == null`) is enough to check the case of an option. 7 | // 2- To get the value of an option the `getValue` helper 8 | // below must **always** be used. 9 | // export type Option = T | Some; 10 | // Using a class here for better compatibility with TS files importing Some 11 | 12 | export class Some { 13 | constructor(value) { 14 | this.value = value; 15 | } // Don't add "Some" for consistency with erased options 16 | 17 | 18 | toString() { 19 | return String(this.value); 20 | } 21 | 22 | toJSON() { 23 | return this.value; 24 | } 25 | 26 | GetHashCode() { 27 | return structuralHash(this.value); 28 | } 29 | 30 | Equals(other) { 31 | return other == null ? false : equals(this.value, other instanceof Some ? other.value : other); 32 | } 33 | 34 | CompareTo(other) { 35 | return other == null ? 1 : compare(this.value, other instanceof Some ? other.value : other); 36 | } 37 | 38 | } 39 | export function some(x) { 40 | return x == null || x instanceof Some ? new Some(x) : x; 41 | } 42 | export function value(x, acceptNull) { 43 | if (x == null) { 44 | if (!acceptNull) { 45 | throw new Error("Option has no value"); 46 | } 47 | 48 | return null; 49 | } else { 50 | return x instanceof Some ? x.value : x; 51 | } 52 | } 53 | export function defaultArg(arg, defaultValue, f) { 54 | return arg == null ? defaultValue : f != null ? f(value(arg)) : value(arg); 55 | } 56 | export function defaultArgWith(arg, defThunk) { 57 | return arg == null ? defThunk() : value(arg); 58 | } 59 | export function filter(predicate, arg) { 60 | return arg != null ? !predicate(value(arg)) ? null : arg : arg; 61 | } // CHOICE 62 | 63 | export const Choice = declare(function Choice(tag, name, field) { 64 | Union.call(this, tag, name, field); 65 | }, Union); 66 | export function choice1(x) { 67 | return new Choice(0, "Choice1Of2", x); 68 | } 69 | export function choice2(x) { 70 | return new Choice(1, "Choice2Of2", x); 71 | } 72 | export function tryValueIfChoice1(x) { 73 | return x.tag === 0 ? some(x.fields[0]) : null; 74 | } 75 | export function tryValueIfChoice2(x) { 76 | return x.tag === 1 ? some(x.fields[0]) : null; 77 | } // RESULT 78 | 79 | export const Result = declare(function Result(tag, name, field) { 80 | Union.call(this, tag, name, field); 81 | }, Union); 82 | export function ok(x) { 83 | return new Result(0, "Ok", x); 84 | } 85 | export function error(x) { 86 | return new Result(1, "Error", x); 87 | } 88 | export function mapOk(f, result) { 89 | return result.tag === 0 ? ok(f(result.fields[0])) : result; 90 | } 91 | export function mapError(f, result) { 92 | return result.tag === 1 ? error(f(result.fields[0])) : result; 93 | } 94 | export function bindOk(f, result) { 95 | return result.tag === 0 ? f(result.fields[0]) : result; 96 | } 97 | -------------------------------------------------------------------------------- /docs/js/repl/lib/src/PromiseImpl.js: -------------------------------------------------------------------------------- 1 | import { PromiseBuilder$$$$002Ector as PromiseBuilder$0024$0024$0024$0024002Ector } from "./Promise.js"; 2 | export const promise = PromiseBuilder$0024$0024$0024$0024002Ector(); 3 | -------------------------------------------------------------------------------- /docs/js/repl/lib/src/cmd.js: -------------------------------------------------------------------------------- 1 | import { concat, map, iterate } from "../fable-library.2.2.0-beta-010/List.js"; 2 | import { List } from "../fable-library.2.2.0-beta-010/Types.js"; 3 | import { singleton } from "../fable-library.2.2.0-beta-010/AsyncBuilder.js"; 4 | import { startImmediate, catchAsync } from "../fable-library.2.2.0-beta-010/Async.js"; 5 | export function Cmd$$$exec(dispatch, cmd) { 6 | iterate(function action(sub) { 7 | sub(dispatch); 8 | }, cmd); 9 | } 10 | export function Cmd$$$none() { 11 | return new List(); 12 | } 13 | export function Cmd$$$ofMsg(msg) { 14 | return new List(function (dispatch$$1) { 15 | dispatch$$1(msg); 16 | }, new List()); 17 | } 18 | export function Cmd$$$map(f, cmd$$1) { 19 | return map(function mapping(g) { 20 | return function ($arg$$2) { 21 | g(function ($arg$$1) { 22 | $arg$$2(f($arg$$1)); 23 | }); 24 | }; 25 | }, cmd$$1); 26 | } 27 | export function Cmd$$$batch(cmds) { 28 | return concat(cmds); 29 | } 30 | export function Cmd$$$ofAsync(task, arg, ofSuccess, ofError) { 31 | const bind = function bind(dispatch$$3) { 32 | const builder$0040 = singleton; 33 | return builder$0040.Delay(function () { 34 | return builder$0040.Bind(catchAsync(task(arg)), function (_arg1) { 35 | var x$$1, x; 36 | const r = _arg1; 37 | dispatch$$3(r.tag === 1 ? (x$$1 = r.fields[0], ofError(x$$1)) : (x = r.fields[0], ofSuccess(x))); 38 | return builder$0040.Zero(); 39 | }); 40 | }); 41 | }; 42 | 43 | return new List(function ($arg$$3) { 44 | startImmediate(bind($arg$$3)); 45 | }, new List()); 46 | } 47 | export function Cmd$$$ofFunc(task$$1, arg$$1, ofSuccess$$1, ofError$$1) { 48 | const bind$$1 = function bind$$1(dispatch$$4) { 49 | try { 50 | return dispatch$$4(ofSuccess$$1(task$$1(arg$$1))); 51 | } catch (x$$2) { 52 | return dispatch$$4(ofError$$1(x$$2)); 53 | } 54 | }; 55 | 56 | return new List(bind$$1, new List()); 57 | } 58 | export function Cmd$$$performFunc(task$$2, arg$$2, ofSuccess$$2) { 59 | const bind$$2 = function bind$$2(dispatch$$5) { 60 | try { 61 | dispatch$$5(ofSuccess$$2(task$$2(arg$$2))); 62 | } catch (x$$3) {} 63 | }; 64 | 65 | return new List(bind$$2, new List()); 66 | } 67 | export function Cmd$$$attemptFunc(task$$3, arg$$3, ofError$$2) { 68 | const bind$$3 = function bind$$3(dispatch$$6) { 69 | try { 70 | task$$3(arg$$3); 71 | } catch (x$$4) { 72 | dispatch$$6(ofError$$2(x$$4)); 73 | } 74 | }; 75 | 76 | return new List(bind$$3, new List()); 77 | } 78 | export function Cmd$$$ofSub(sub$$1) { 79 | return new List(sub$$1, new List()); 80 | } 81 | export function Cmd$$$ofPromise(task$$4, arg$$4, ofSuccess$$3, ofError$$3) { 82 | const bind$$4 = function bind$$4(dispatch$$7) { 83 | task$$4(arg$$4).then(function a($arg$$8) { 84 | return dispatch$$7(ofSuccess$$3($arg$$8)); 85 | }).then(void 0, function fail($arg$$9) { 86 | return dispatch$$7(ofError$$3($arg$$9)); 87 | }); 88 | }; 89 | 90 | return new List(bind$$4, new List()); 91 | } 92 | -------------------------------------------------------------------------------- /docs/js/repl/lib/src/prelude.js: -------------------------------------------------------------------------------- 1 | export function onError(text, ex) { 2 | console.error(text, ex); 3 | } 4 | export function toConsole(text$$1, o) { 5 | console.log(text$$1, o); 6 | } 7 | -------------------------------------------------------------------------------- /docs/js/repl/lib/src/ring.js: -------------------------------------------------------------------------------- 1 | import { declare, Union } from "../fable-library.2.2.0-beta-010/Types.js"; 2 | import { type, union, int32, array } from "../fable-library.2.2.0-beta-010/Reflection.js"; 3 | import { max, comparePrimitives } from "../fable-library.2.2.0-beta-010/Util.js"; 4 | import { ofSeq, fill } from "../fable-library.2.2.0-beta-010/Array.js"; 5 | import { some } from "../fable-library.2.2.0-beta-010/Option.js"; 6 | import { append, delay, collect, rangeNumber, singleton, take, skip } from "../fable-library.2.2.0-beta-010/Seq.js"; 7 | export const RingState$00601 = declare(function Elmish_RingState(tag, name, ...fields) { 8 | Union.call(this, tag, name, ...fields); 9 | }, Union); 10 | export function RingState$00601$reflection($gen$$4) { 11 | return union("Elmish.RingState`1", [$gen$$4], RingState$00601, () => [["Writable", [array($gen$$4), int32]], ["ReadWritable", [array($gen$$4), int32, int32]]]); 12 | } 13 | export const RingBuffer$00601 = declare(function Elmish_RingBuffer(size) { 14 | const $this$$1 = this; 15 | $this$$1.state = new RingState$00601(0, "Writable", fill(new Array(max(comparePrimitives, size, 10)), 0, max(comparePrimitives, size, 10), null), 0); 16 | }); 17 | export function RingBuffer$00601$reflection($gen$$5) { 18 | return type("Elmish.RingBuffer`1", [$gen$$5]); 19 | } 20 | export function RingBuffer$00601$$$$002Ector$$Z524259A4(size) { 21 | return this != null ? RingBuffer$00601.call(this, size) : new RingBuffer$00601(size); 22 | } 23 | export function RingBuffer$00601$$Pop(__) { 24 | const matchValue = __.state; 25 | 26 | if (matchValue.tag === 1) { 27 | const wix = matchValue.fields[1] | 0; 28 | const rix = matchValue.fields[2] | 0; 29 | const items = matchValue.fields[0]; 30 | const rix$0027 = (rix + 1) % items.length | 0; 31 | 32 | if (rix$0027 === wix) { 33 | __.state = new RingState$00601(0, "Writable", items, wix); 34 | } else { 35 | __.state = new RingState$00601(1, "ReadWritable", items, wix, rix$0027); 36 | } 37 | 38 | return some(items[rix]); 39 | } else { 40 | return null; 41 | } 42 | } 43 | export function RingBuffer$00601$$Push$$2B595(__$$1, item) { 44 | const matchValue$$2 = __$$1.state; 45 | 46 | if (matchValue$$2.tag === 1) { 47 | const wix$$2 = matchValue$$2.fields[1] | 0; 48 | const rix$$1 = matchValue$$2.fields[2] | 0; 49 | const items$$2 = matchValue$$2.fields[0]; 50 | items$$2[wix$$2] = item; 51 | const wix$0027 = (wix$$2 + 1) % items$$2.length | 0; 52 | 53 | if (wix$0027 === rix$$1) { 54 | const items$$4 = RingBuffer$00601$$doubleSize(__$$1, rix$$1, items$$2); 55 | __$$1.state = new RingState$00601(1, "ReadWritable", items$$4, wix$0027, 0); 56 | } else { 57 | __$$1.state = new RingState$00601(1, "ReadWritable", items$$2, wix$0027, rix$$1); 58 | } 59 | } else { 60 | const ix = matchValue$$2.fields[1] | 0; 61 | const items$$1 = matchValue$$2.fields[0]; 62 | items$$1[ix] = item; 63 | const wix$$1 = (ix + 1) % items$$1.length | 0; 64 | __$$1.state = new RingState$00601(1, "ReadWritable", items$$1, wix$$1, ix); 65 | } 66 | } 67 | 68 | function RingBuffer$00601$$doubleSize(this$, ix$$1, items$$5) { 69 | return ofSeq(delay(function () { 70 | return append(skip(ix$$1, items$$5), delay(function () { 71 | return append(take(ix$$1, items$$5), delay(function () { 72 | return collect(function (matchValue$$4) { 73 | return singleton(null); 74 | }, rangeNumber(0, 1, items$$5.length)); 75 | })); 76 | })); 77 | }), Array); 78 | } 79 | -------------------------------------------------------------------------------- /docs/libs/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/libs/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /docs/libs/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/libs/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/libs/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/libs/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/libs/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/libs/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/libs/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsharp/TryFSharp/6f72accdd16135766afdddd775c658328d254f81/docs/libs/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /docs/libs/vs/basic-languages/azcli/azcli.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * monaco-languages version: 1.6.0(858705e74270e53559a241fdee187e7a6ae53b23) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md 6 | *-----------------------------------------------------------------------------*/ 7 | define("vs/basic-languages/azcli/azcli",["require","exports"],function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.conf={comments:{lineComment:"#"}},t.language={defaultToken:"keyword",ignoreCase:!0,tokenPostfix:".azcli",str:/[^#\s]/,tokenizer:{root:[{include:"@comment"},[/\s-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}],[/^-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}]],type:[{include:"@comment"},[/-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":"key.identifier"}}],[/@str+\s*/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}]],comment:[[/#.*$/,{cases:{"@eos":{token:"comment",next:"@popall"}}}]]}}}); -------------------------------------------------------------------------------- /docs/libs/vs/basic-languages/bat/bat.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * monaco-languages version: 1.6.0(858705e74270e53559a241fdee187e7a6ae53b23) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md 6 | *-----------------------------------------------------------------------------*/ 7 | define("vs/basic-languages/bat/bat",["require","exports"],function(e,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.conf={comments:{lineComment:"REM"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*(::\\s*|REM\\s+)#region"),end:new RegExp("^\\s*(::\\s*|REM\\s+)#endregion")}}},s.language={defaultToken:"",ignoreCase:!0,tokenPostfix:".bat",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:/call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,symbols:/[=>\]/,"annotation"],[/^#(if|else|endif)/,"keyword"],[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,"delimiter"],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0x[0-9a-fA-F]+LF/,"number.float"],[/0x[0-9a-fA-F]+(@integersuffix)/,"number.hex"],[/0b[0-1]+(@integersuffix)/,"number.bin"],[/\d+(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"""/,"string",'@string."""'],[/"/,"string",'@string."'],[/\@"/,{token:"string.quote",next:"@litstring"}],[/'[^\\']'B?/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\(\*(?!\))/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\*]+/,"comment"],[/\*\)/,"comment","@pop"],[/\*/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/("""|"B?)/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]],litstring:[[/[^"]+/,"string"],[/""/,"string.escape"],[/"/,{token:"string.quote",next:"@pop"}]]}}}); -------------------------------------------------------------------------------- /docs/libs/vs/basic-languages/go/go.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * monaco-languages version: 1.6.0(858705e74270e53559a241fdee187e7a6ae53b23) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md 6 | *-----------------------------------------------------------------------------*/ 7 | define("vs/basic-languages/go/go",["require","exports"],function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.conf={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"`",close:"`",notIn:["string"]},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"`",close:"`"},{open:'"',close:'"'},{open:"'",close:"'"}]},n.language={defaultToken:"",tokenPostfix:".go",keywords:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var","bool","true","false","uint8","uint16","uint32","uint64","int8","int16","int32","int64","float32","float64","complex64","complex128","byte","rune","uint","int","uintptr","string","nil"],operators:["+","-","*","/","%","&","|","^","<<",">>","&^","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>=","&^=","&&","||","<-","++","--","==","<",">","=","!","!=","<=",">=",":=","...","(",")","","]","{","}",",",";",".",":"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F]/,"number.hex"],[/0[0-7']*[0-7]/,"number.octal"],[/0[bB][0-1']*[0-1]/,"number.binary"],[/\d[\d']*/,"number"],[/\d/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/`/,"string","@rawstring"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\/\*/,"comment.doc.invalid"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],rawstring:[[/[^\`]/,"string"],[/`/,"string","@pop"]]}}}); -------------------------------------------------------------------------------- /docs/libs/vs/basic-languages/ini/ini.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * monaco-languages version: 1.6.0(858705e74270e53559a241fdee187e7a6ae53b23) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md 6 | *-----------------------------------------------------------------------------*/ 7 | define("vs/basic-languages/ini/ini",["require","exports"],function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.conf={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},n.language={defaultToken:"",tokenPostfix:".ini",escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^\[[^\]]*\]/,"metatag"],[/(^\w+)(\s*)(\=)/,["key","","delimiter"]],{include:"@whitespace"},[/\d+/,"number"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],whitespace:[[/[ \t\r\n]+/,""],[/^\s*[#;].*$/,"comment"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}}}); -------------------------------------------------------------------------------- /docs/libs/vs/basic-languages/java/java.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * monaco-languages version: 1.6.0(858705e74270e53559a241fdee187e7a6ae53b23) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md 6 | *-----------------------------------------------------------------------------*/ 7 | define("vs/basic-languages/java/java",["require","exports"],function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.conf={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:))")}}},t.language={defaultToken:"",tokenPostfix:".java",keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,"annotation"],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,"number.float"],[/0[xX](@hexdigits)[Ll]?/,"number.hex"],[/0(@octaldigits)[Ll]?/,"number.octal"],[/0[bB](@binarydigits)[Ll]?/,"number.binary"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@javadoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],javadoc:[[/[^\/*]+/,"comment.doc"],[/\/\*/,"comment.doc.invalid"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]]}}}); -------------------------------------------------------------------------------- /docs/libs/vs/basic-languages/lua/lua.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * monaco-languages version: 1.6.0(858705e74270e53559a241fdee187e7a6ae53b23) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md 6 | *-----------------------------------------------------------------------------*/ 7 | define("vs/basic-languages/lua/lua",["require","exports"],function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.conf={comments:{lineComment:"--",blockComment:["--[[","]]"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},n.language={defaultToken:"",tokenPostfix:".lua",keywords:["and","break","do","else","elseif","end","false","for","function","goto","if","in","local","nil","not","or","repeat","return","then","true","until","while"],brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.array",open:"[",close:"]"},{token:"delimiter.parenthesis",open:"(",close:")"}],operators:["+","-","*","/","%","^","#","==","~=","<=",">=","<",">","=",";",":",",",".","..","..."],symbols:/[=>",notIn:["string"]}],surroundingPairs:[{open:"(",close:")"},{open:"[",close:"]"},{open:"`",close:"`"}],folding:{markers:{start:new RegExp("^\\s*\x3c!--\\s*#?region\\b.*--\x3e"),end:new RegExp("^\\s*\x3c!--\\s*#?endregion\\b.*--\x3e")}}},t.language={defaultToken:"",tokenPostfix:".md",control:/[\\`*_\[\]{}()#+\-\.!]/,noncontrol:/[^\\`*_\[\]{}()#+\-\.!]/,escapes:/\\(?:@control)/,jsescapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,empty:["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param"],tokenizer:{root:[[/^(\s{0,3})(#+)((?:[^\\#]|@escapes)+)((?:#+)?)/,["white","keyword","keyword","keyword"]],[/^\s*(=+|\-+)\s*$/,"keyword"],[/^\s*((\*[ ]?)+)\s*$/,"meta.separator"],[/^\s*>+/,"comment"],[/^\s*([\*\-+:]|\d+\.)\s/,"keyword"],[/^(\t|[ ]{4})[^ ].*$/,"string"],[/^\s*~~~\s*((?:\w|[\/\-#])+)?\s*$/,{token:"string",next:"@codeblock"}],[/^\s*```\s*((?:\w|[\/\-#])+)\s*$/,{token:"string",next:"@codeblockgh",nextEmbedded:"$1"}],[/^\s*```\s*$/,{token:"string",next:"@codeblock"}],{include:"@linecontent"}],codeblock:[[/^\s*~~~\s*$/,{token:"string",next:"@pop"}],[/^\s*```\s*$/,{token:"string",next:"@pop"}],[/.*$/,"variable.source"]],codeblockgh:[[/```\s*$/,{token:"variable.source",next:"@pop",nextEmbedded:"@pop"}],[/[^`]+/,"variable.source"]],linecontent:[[/&\w+;/,"string.escape"],[/@escapes/,"escape"],[/\b__([^\\_]|@escapes|_(?!_))+__\b/,"strong"],[/\*\*([^\\*]|@escapes|\*(?!\*))+\*\*/,"strong"],[/\b_[^_]+_\b/,"emphasis"],[/\*([^\\*]|@escapes)+\*/,"emphasis"],[/`([^\\`]|@escapes)+`/,"variable"],[/\{+[^}]+\}+/,"string.target"],[/(!?\[)((?:[^\]\\]|@escapes)*)(\]\([^\)]+\))/,["string.link","","string.link"]],[/(!?\[)((?:[^\]\\]|@escapes)*)(\])/,"string.link"],{include:"html"}],html:[[/<(\w+)\/>/,"tag"],[/<(\w+)/,{cases:{"@empty":{token:"tag",next:"@tag.$1"},"@default":{token:"tag",next:"@tag.$1"}}}],[/<\/(\w+)\s*>/,{token:"tag"}],[//,"comment","@pop"],[//,{token:"comment",next:"@pop"}],[/ Parse Input = %A" input 72 | printfn "---> Parse Error = %A" parseRes.Errors 73 | 74 | match typedRes with 75 | | FSharpCheckFileAnswer.Succeeded(res) -> parseRes, res 76 | | res -> failwithf "Parsing did not finish... (%A)" res 77 | 78 | [] 79 | let main argv = 80 | ignore argv 81 | printfn "Exporting metadata..." 82 | let file = "/temp/test.fsx" 83 | let input = "let a = 42" 84 | // parse script just to export metadata 85 | let parseRes, typedRes = parseAndCheckScript(file, input) 86 | printfn "Exporting is done." 87 | 0 88 | -------------------------------------------------------------------------------- /src/Export/README.md: -------------------------------------------------------------------------------- 1 | # EXPORT METADATA 2 | 3 | The only purpose of this project is to generate metadata from BCL/F# libs 4 | to be used in the Repl. See BuildFcsExport/GenerateMetadata build targets. -------------------------------------------------------------------------------- /src/Export/fcs-export.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/Lib/Elmish.React.fs: -------------------------------------------------------------------------------- 1 | namespace Elmish.React 2 | 3 | [] 4 | module Program = 5 | open Fable.Import.Browser 6 | 7 | /// Setup rendering of root React component inside html element identified by placeholderId 8 | let withReactSynchronous placeholderId (program:Elmish.Program<_,_,_,_>) = 9 | let setState model dispatch = 10 | Fable.Import.ReactDom.render( 11 | program.view model dispatch, 12 | document.getElementById(placeholderId) 13 | ) 14 | 15 | { program with setState = setState } 16 | 17 | let withReact placeholderId (program:Elmish.Program<_,_,_,_>) = 18 | withReactSynchronous placeholderId program 19 | -------------------------------------------------------------------------------- /src/Lib/README.md: -------------------------------------------------------------------------------- 1 | # Fable REPL Lib 2 | 3 | This library includes APIs that will be available to samples and user-generated code in the Fable REPL (besides Fable.Core and Fable.Import.Browser) as precompiled JS. At the moment there are the following restrictions: 4 | 5 | - **Public inlined functions** cannot be used. 6 | - All modules must be prefixed with `Fable.Repl.Lib`. 7 | - The root module (after trimming `Fable.Repl.Lib.`) **must match the name of the file** and shouldn't contain periods. 8 | 9 | > Example: A file cannot be named `Elmish.React` but you can have an `Elmish.fs` file, with a `Fable.Repl.Lib.Elmish` root module containing a `React` submodule. 10 | 11 | > Note: external libraries like `React` are currently loaded as global variables, so the HTML code of the sample must contain a `