fatype is the function argument type. atype[i] are type arguments. qtycon is a qualified (e.g. possibly with module prefix) type constructor, e.g. Just

So, for example if you have:

foreign import ccall "string.h strlen" cstrlen :: Ptr CChar -> IO CSize

fatype -> ftype :: ftype
  fatype :: fatype
    qtycon "Ptr"
    atype1 "CChar"
  fatype :: frtype
    qtycon "IO"
    atype1 "CSize"

(I struggled a bit with finding a good way to communicate the productions chosen, so bear with me)

Make sense?

-Ross


On Feb 10, 2009, at 6:13 PM, Maurí cio wrote:

The FFI spec says (at http://www.cse.unsw.edu.au/~chak/haskell/ffi/ffi/ffise3.html#x6-120003.2) :

There I see:

---
Foreign types are produced according to the following grammar:

ftype  --> frtype
      |   fatype -> ftype
frtype --> fatype
      |   ()
fatype --> qtycon atype[1] ... atype[k] (k > 0)
---

I can't understand the "qtycon atype[1]..." line. I did
search haskell 98 report syntax reference, and saw how
qtycon and tycon are defined, but I could not understand
how they are used here.

Thanks for your help,
Maurício

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to