Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9220545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:22:26+00:00 2026-06-18T03:22:26+00:00

I am reading Web cloud and mobile solution with F# and I try to

  • 0

I am reading Web cloud and mobile solution with F# and I try to follow the web site the author is building. But I have some problem, I am unable to solve. I understand the logic of what I am doing , but it looks like some piece of code is missing to make it work .I have read up to page 19.

I have the following repository module :

module Repository =
    let get (source : IQueryable<_>) queryFn=
        queryFn |> Seq.toList

    let getAll ()= 
        fun s -> query { for x in s  do
                         select x }

The idea is to use getAll in queryFn to get all items from source. But I have a cast problem between the two .

Here is the controller that makes use of it:

[<HandleError>]
type GuitarsController(context : IDisposable, ?repository ) =
    inherit Controller()


    let fromRepository =
        match repository with
        | Some v -> v
        | _ -> (context :?>  FsMvcAppEntities).guitars
                |> Repository.get



    new() = new GuitarsController(new FsMvcAppEntities())

    member this.Index() =
        getAll()
        |> fromRepository
        |> this.View

getAll() does not go well with |> fromRepository.

The type ”b -> Linq.IQueryable<‘c>’ is not compatible with the type
‘seq<‘a>’.

When looking at the type defined in the repository module I can see that queryFn is :

val get : source:IQueryable<'a> -> queryFn:seq<'b> -> 'b list

and the getall gives

 unit -> s:System.Linq.IQueryable<'a> -> System.Linq.IQueryable<'a>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T03:22:28+00:00Added an answer on June 18, 2026 at 3:22 am

    Your Repository.get makes no use of source :D.

    Change it to:

    module Repository =
        let get (source : IQueryable<_>) queryFn =
            queryFn source |> Seq.toList
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been doing some reading up on web services programming with Java, Eclipse,
I have been reading up on web-site performance lately and along side lowering HTTP-Requests
I am reading the web-routes tutorial in Happstack, and I have no idea what
I am reading javascript web application and the author is using following code: mod.load
I'm reading in a plist from a web server, generated with some php. When
I am reading properties file in the Dynamic web application as follows : try
Possible Duplicate: Close and Dispose - which to call? Hi, After reading some web
I'm writing a web site with rails, which can let visitors inputing some domains
I've been reading about web workers in HTML5, but I know JavaScript is single-threaded.
After I finished reading Agile Web Development with Rails, I Have developed my own

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.