F# tryHead is not defined - f#

I am using Seq.tryHead but I am getting an error
let maybeTagDatabaseModel = Seq.tryHead tagSeq
error
error FS39: The value, constructor, namespace or type 'tryHead' is not defined
Does anyone have suggestions on how to fix? Thanks

For future visitors
The problem seemed to be this dependency "FSharp.Interop.Dynamic": "3.0.0" in the project.json file.

Two of my projects were on version less than 4. Upgraded those and they work now.

Related

Possibly Bug in Websharper Zafir-Libraries (Beta)

I'm trying to create a Sitelet with SiteletBuilder in C#:
return WebSharper.Sitelets.Content.Page(...)
However, the class Websharper.Sitelet contains Content both as Struct and Class.
So, this does not compile.
Versions of Zafir-Libraries are
Zafir 4.0.152.29-beta5
Zafir.CSharp 4.0.152.29-beta5
Zafir.Html 4.0.56.95-beta5
Zafir.UI.Next 4.0.102.33-beta5
How to reference WebSharper.Sitelets.Content proberly?
Or is this indeed a bug?
Thanks for the report, created ticket: https://github.com/intellifactory/websharper/issues/645
I have been testing with having using WebSharper.Sitelets; and then using with shorter form Content.Page(...). C# can resolve this for some reason, although the name conflict indeed exists in WebSharper.Sitelets.dll

Dart Polymer : Type X is not a subtype of type Y

I develop my application with Dart and Polymer on PyCharm. I currently have an error :
Exception: type 'ObservableList<DrugFilterItem>' is not a subtype of type 'ObservableList<DrugCompareItem>' of '__$orderFilterList#51385934'
ObservableList is from package:observe/src/observable_list.dart
DrugFilterItem is from package:synmed/drug_elements/views/drug_filter_menu.dart
ObservableList is from package:observe/src/observable_list.dart
DrugCompareItem is from package:synmed/drug_elements/views/drug_search_toolbar.dart
DrugFilterItem and DrugCompareItem are both custom classes, DrugCompareItem extends DrugFilterItem, and the line designed by the error is :
ObservableList<DrugCompareItem> orderFilterList = new ObservableList<DrugFilterItem>();
The problem suddenly happened today : I installed Pycharm 2016.3 and tried to code, but I had an error with the package shadow, which I solved. Since, I have this error which I supposed came from a problem with the packages as the code didn't change from before to after.
What I have found for now is nothing in fact, I read a lot of post on this kind of error, one of the recurrent subject was the imports but I didn't find any problem with this. I am using Dart 1.20.1 and
polymer: "<=0.16.4+1"
core_elements: "<=0.7.1+3"
paper_elements: "<=0.7.1"
Do anyone has any clue for me? Thanks!
Sounds like https://github.com/dart-lang/sdk/issues/14972#issuecomment-108402835
I believe this is working as intended. A List is not assignable to a List, even if it only contains Apples.
There are several ways to work around this:
iterable.map((x) => x) (removing the generic type),
new List<MethodMirror>.from(iterable)
new MyIterableWrapper<MethodMirror>(iterable) (where the iterable-wrapper that would need to be written).

FsLex changed with latest PowerPack?

I've been working on a compiler for a while but after changing to PowerPack 1.9.9.9 and the release version of VS2010 I'm no unable to compile the following line:
let lexbuf = Lexing.from_string text
I get the following two error:
"The value, constructor, namespace or type 'from_string' is not defined" pretty obviopus what it's trying to tell me but what's the resolution?
My quick guess is that this function has been renamed to fromString (because, in general, functions with underscores such as of_seq are now written in camelCase).
Lexing.LexBuffer<_>.FromString ?

F# 2.0 with Powerpack 2.0, fslex error 1

In namespace RSLispV3.RunTime:
http://pastebin.com/XNb9qi11
LispParser.fsy:
http://pastebin.com/pymF1Vvm
LispLexer.fsl:
http://pastebin.com/pfXdDuxs
I got in MSBuild the PowerPacks targets, calling them from the .fsprog.
When building with VS2008 I get error: "fslex.exe" exited with code 1.
Help?
This might be the same bug I ran into with the Powerpack Metadata library.
You can test it by temporarily creating the registry key
Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.FSharp-1.9.9.9
(an equivalent with 2.0.0.0 should already be there.)
Or just download the updated powerpack binaries; they fixed the problem a couple of days ago.
Solved: my mistake, no ^ operator. Line 11 for future visitors.

F# on mono in leopard. Seq.cast error

I came across this answered question, but I can't seem to compile the code. I'm getting the following error on Seq.cast:
error FS0039: The value, constructor, namespace or type 'cast' is not defined.
I'm using Mono 2.0.1_1 and F# 1.9.4.19 on leopard. Is there something funky with f# when running under mono?
You need to upgrade to the latest version of F# 1.9.6.2 (also known as the September CTP):
http://www.microsoft.com/downloads/details.aspx?FamilyID=61ad6924-93ad-48dc-8c67-60f7e7803d3c&displaylang=en
Cheers,
Rob
Thanks Rob. That was it. I was able to get around it using map_to_typed in 1.9.4.19.
Seq.map_to_typed (fun e -> e :> System.Xml.XmlNode)

Resources