Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type Thing<'a> = { value : 'a; name : string }
- // generated for thing:
- [<AbstractClass>]
- type MThing<'ma>() =
- abstract member value : 'ma
- abstract member name : IMod<string>
- type State = { thing : Thing<int>; other : plist<Thing<int>> }
- // generated for state
- [<System.Runtime.CompilerServices.Extension>]
- type private MThingOfIntForState(__initial : Thing<int>) =
- inherit MThing<IMod<int>>()
- let mutable __current = __initial
- let _value = ResetMod(__initial.value)
- let _name = ResetMod(__initial.name)
- member x.Update(thing : Thing<int>) =
- if not (System.Object.ReferenceEquals(__current, thing)) then
- __current <- thing
- _value.Update(thing.value)
- _name.Update(thing.name)
- static member Create(thing : Thing<int>) =
- MThingOfIntForState(thing) :> MThing<_>
- [<System.Runtime.CompilerServices.Extension>]
- static member Update(m : MThing<IMod<int>>, v : Thing<int>) =
- (unbox<MThingOfIntForState> m).Update(v)
- override x.value = _value :> IMod<_>
- override x.name = _name :> IMod<_>
- type MState(__initial : State) =
- let mutable __current = __initial
- let _thing = MThingOfIntForState.Create __initial.thing
- let _other = ResetMapList(__initial.other, (fun _ -> MThingOfIntForState.Create), MThingOfIntForState.Update)
- member x.thing = _thing
- member x.other = _other :> alist<_>
- static member Create(s : State) =
- MState(s)
- member x.Update(s : State) =
- if not (System.Object.ReferenceEquals(__current, s)) then
- __current <- s
- _thing.Update(s.thing)
- _other.Update(s.other)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement