Size: a a a

2021 January 01

W👑

WHUSEIN 👑 in F# Chat
чат
источник

W👑

WHUSEIN 👑 in F# Chat
активный
источник

RM

Roman Melnikov in F# Chat
WHUSEIN 👑
активный
источник

SB

S B in F# Chat
На фримонадах это самый кровопролитный способ, особенно в языках, которые не предоставляют аналог do-нотации Хаскеля.
источник
2021 January 02

NK

ID:0 in F# Chat
источник
2021 January 03

MM

Maaf Merepotkan... 🙏... in F# Chat
Dear all,

I have an issue about using F# with linq.

open System

type MyTags = List<string>
type MySong = { Title: string; Tags: Option<MyTags> }

let songs : List<MySong> = [
 { Title = "Cantaloupe Island";
   Tags  = Some ["60s"; "jazz"]};
 { Title = "Let It Be";
   Tags  = Some ["60s"; "rock"]};
 { Title = "Knockin' on Heaven's Door";
   Tags  = Some ["70s"; "rock"]};
 { Title = "Emotion";
   Tags  = Some ["70s"; "pop"]};
 { Title = "The River";
   Tags  = None};
 ]

let extractTagss songs =
 query {
   for song in songs do
   where (song.Tags <> None)
   select song.Tags
 } |> Seq.toList

[<EntryPoint>]
for tags in (songs |> extractTagss) do
   tags |> Console.WriteLine


When I run, here is the result:

$ dotnet fsi 14-linq.fsx


/home/epsi/Documents/songs/fsharp/14-linq.fsx(27,23): error FS0001: The type 'List<MySong>' is not compatible with the type 'Linq.IQueryable<MySong>'


Sorry for my english.

🙂

How do I fix this?
источник

MM

Maaf Merepotkan... 🙏... in F# Chat
источник

AH

Ayrat Hudaygulov in F# Chat
Maaf Merepotkan... 🙏
Dear all,

I have an issue about using F# with linq.

open System

type MyTags = List<string>
type MySong = { Title: string; Tags: Option<MyTags> }

let songs : List<MySong> = [
 { Title = "Cantaloupe Island";
   Tags  = Some ["60s"; "jazz"]};
 { Title = "Let It Be";
   Tags  = Some ["60s"; "rock"]};
 { Title = "Knockin' on Heaven's Door";
   Tags  = Some ["70s"; "rock"]};
 { Title = "Emotion";
   Tags  = Some ["70s"; "pop"]};
 { Title = "The River";
   Tags  = None};
 ]

let extractTagss songs =
 query {
   for song in songs do
   where (song.Tags <> None)
   select song.Tags
 } |> Seq.toList

[<EntryPoint>]
for tags in (songs |> extractTagss) do
   tags |> Console.WriteLine


When I run, here is the result:

$ dotnet fsi 14-linq.fsx


/home/epsi/Documents/songs/fsharp/14-linq.fsx(27,23): error FS0001: The type 'List<MySong>' is not compatible with the type 'Linq.IQueryable<MySong>'


Sorry for my english.

🙂

How do I fix this?
Not sure, but seems you can't use list as data source for query builder.
источник

MM

Maaf Merepotkan... 🙏... in F# Chat
Ayrat Hudaygulov
Not sure, but seems you can't use list as data source for query builder.
What simple data can I use for query builder?
источник

AH

Ayrat Hudaygulov in F# Chat
Maaf Merepotkan... 🙏
What simple data can I use for query builder?
Do you need query builder at all?
If you really need it, I think you should explicitly cast List to IQueryable
источник

MM

Maaf Merepotkan... 🙏... in F# Chat
Ayrat Hudaygulov
Do you need query builder at all?
If you really need it, I think you should explicitly cast List to IQueryable
Wait...

I will response in an hour.
источник

PD

Prunkles Dreemurr in F# Chat
List doesn't implement IQueryable. So you should cast it using the extensions method .AsQueryable() (from the System.Linq namespace)
источник

MM

Maaf Merepotkan... 🙏... in F# Chat
Prunkles Dreemurr
List doesn't implement IQueryable. So you should cast it using the extensions method .AsQueryable() (from the System.Linq namespace)
That's working. Awesomeee 🙏🏽.
источник

MM

Maaf Merepotkan... 🙏... in F# Chat
источник

YT

Yogurt The Horse in F# Chat
Што
источник

YT

Yogurt The Horse in F# Chat
Это правда?
источник

SN

Shub Niggurath in F# Chat
Yogurt The Horse
Это правда?
no
источник

YT

Yogurt The Horse in F# Chat
Фух
источник

SN

Shub Niggurath in F# Chat
оно так начиналось
источник

MM

Maaf Merepotkan... 🙏... in F# Chat
источник