Kashyap,

Can someone please send me a working example based on the contents posted in the URL below?

There's a small typo in the post: the definition of Proto should read

data Proto = Proto {a :: A, b :: B, c :: C}

The rest seems fine to me. (See below for an excerpt).

Cheers,

  Stefan

-------------------------------------------
import Data.Function (fix)
data A = A B C ; fa = A
data B = B A C ; fb = B
data C = C A B ; fc = C
userFunction = C
data Proto = Proto {a :: A, b :: B, c :: C}
proto = \self -> Proto {
  a = fa (b self) (c self),
  b = fb (a self) (c self),
  c = fc (a self) (b self)
}
customizedProto = \self -> proto self {
   c = userFunction (a self) (b self)
}
customizedABC = fix customizedProto
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to