I wonder if the problem of ordering and "and" type decleration ?

1
2
3
4
5
6
7
8
9
10
11
12
type LazyMessage<'a> (msg : 'a) =
    let lazymsg = lazy(serialize(msg))
    member x.Data 
        with get() = lazymsg.Value   //<----- the compiler error is here      
           
type ComPoint<'recv, 'send>() =
    let sendMessage (stream : Stream) message = async { do! stream.Send(message)}
   
    let sendLazy receiver (lazyMsg : LazyMessage<'send>)=
        let byteMessage = lazyMsg.Data
        sendMessage receiver byteMessage
    member x.SendAsyncLazy : Stream -> LazyMessage<'send> -> Async<unit> = sendLazy  
By on 1/29/2008 7:28 AM ()

Whoops!

Yes you are right - no reason for the LazyMessage to know anything about the ComPoint. I must be blind.

Thanks :)
Jacob

By on 1/29/2008 7:38 AM ()

I'm still not sure I understand why it wouldn't work with type definitions as they were. Anyone care to offer an explanation?

By on 1/29/2008 12:57 PM ()

You're right Robert,it should work anyway.

By on 1/30/2008 1:39 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper