Skip to content

Instantly share code, notes, and snippets.

@wallymathieu
Created May 24, 2020 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wallymathieu/290d3392e2cc68872080c53e63de0930 to your computer and use it in GitHub Desktop.
Save wallymathieu/290d3392e2cc68872080c53e63de0930 to your computer and use it in GitHub Desktop.
Problem with microsoft.dotnet-interactive/1.0.115407 dotnet 5.0.100-preview.4.20258.7
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<script type=\"text/javascript\">#!javascript\r\n",
"if ((typeof(requirejs) !== typeof(Function)) || (typeof(requirejs.config) !== typeof(Function))) { \r\n",
" let script = document.createElement(\"script\"); \r\n",
" script.setAttribute(\"src\", \"https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js\"); \r\n",
" script.onload = function(){\r\n",
" loadDotnetInteractiveApi();\r\n",
" };\r\n",
" document.getElementsByTagName(\"head\")[0].appendChild(script); \r\n",
"}\r\n",
"else {\r\n",
" loadDotnetInteractiveApi();\r\n",
"}\r\n",
"\r\n",
"function loadDotnetInteractiveApi(){\r\n",
" let apiRequire = requirejs.config({context:\"dotnet-interactive.83027.62625\",paths:{dotnetInteractive:\"http://localhost:62625/resources/dotnet-interactive\"}});\r\n",
" apiRequire(['dotnetInteractive'], \r\n",
" function(api) { \r\n",
" api.createDotnetInteractiveClient(\"http://localhost:62625/\", window);\r\n",
" },\r\n",
" function(error){\r\n",
" console.log(error);\r\n",
" });\r\n",
"}</script>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Installed package Fleece.NewtonsoftJson version 0.8.0"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Installed package Newtonsoft.Json version 12.0.2"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Installed package FSharpPlus version 1.1.1"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Stopped due to error\n"
]
},
{
"ename": "Unhandled exception",
"evalue": "input.fsx (39,16)-(39,41) typecheck error The type referenced through 'FSharpPlus.Control.TryParse' is defined in an assembly that is not referenced. You must add a reference to assembly 'FSharpPlus'.\ninput.fsx (1,1)-(1,1) typecheck error The type referenced through 'FSharpPlus.Control.TryParse' is defined in an assembly that is not referenced. You must add a reference to assembly 'FSharpPlus'.",
"output_type": "error",
"traceback": [
"input.fsx (39,16)-(39,41) typecheck error The type referenced through 'FSharpPlus.Control.TryParse' is defined in an assembly that is not referenced. You must add a reference to assembly 'FSharpPlus'.\ninput.fsx (1,1)-(1,1) typecheck error The type referenced through 'FSharpPlus.Control.TryParse' is defined in an assembly that is not referenced. You must add a reference to assembly 'FSharpPlus'."
]
}
],
"source": [
"#r \"nuget: Fleece.NewtonsoftJson, 0.8.0\"\n",
"#r \"nuget: Newtonsoft.Json, 12.0.2\"\n",
"#r \"nuget: FSharpPlus, 1.1.1\"\n",
"open Newtonsoft.Json\n",
"open Fleece\n",
"open Fleece.Newtonsoft\n",
"open Fleece.Newtonsoft.Helpers\n",
"open Fleece.Newtonsoft.Operators\n",
"open FSharpPlus\n",
"open FSharpPlus.Data\n",
"\n",
"type Gender =\n",
" | Male = 1\n",
" | Female = 2\n",
"\n",
"type Person = {\n",
" Name: string\n",
" Age: int\n",
" Gender: Gender\n",
" DoB: DateTime\n",
" Children: Person list\n",
"}\n",
"\n",
"type Person with\n",
" static member Create name age dob gender children = { Person.Name = name; Age = age; DoB = dob; Gender = gender; Children = children }\n",
"\n",
" static member OfJson json = \n",
" match json with\n",
" | JObject o -> \n",
" monad {\n",
" let! name = o .@ \"name\"\n",
" let! age = o .@ \"age\"\n",
" let! dob = o .@ \"dob\"\n",
" let! gender = (o .@ \"gender\")\n",
" let! children = o .@ \"children\"\n",
" return Person.Create name age dob gender children\n",
" \n",
" }\n",
" | x -> Decode.Fail.objExpected x\n",
"\n",
" static member ToJson (x: Person) =\n",
" jobj [ \n",
" \"name\" .= x.Name\n",
" \"age\" .= x.Age\n",
" \"gender\" .= x.Gender\n",
" \"dob\" .= x.DoB\n",
" \"children\" .= x.Children\n",
" ] "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": ".NET (F#)",
"language": "F#",
"name": ".net-fsharp"
},
"language_info": {
"file_extension": ".fs",
"mimetype": "text/x-fsharp",
"name": "C#",
"pygments_lexer": "fsharp",
"version": "4.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment