I am developing a high level OpenCL binding in Haskell, and I need peer-review and testing. It currently only gets platform and device info from OpenCL.I have lots of functions that only change the returned type and the size of the type passed to the C library, but I don't know how to fix it.GitHubgetDeviceInfoUlong :: CLDeviceInfo_ -> CLDeviceID -> IO (Either CLError CLulong)getDeviceInfoUlong infoid device = alloca $ \(dat :: Ptr CLulong) -> do  whenSuccess (raw_clGetDeviceInfo device infoid size (castPtr dat) nullPtr)    $ peek dat    where       size = fromIntegral $ sizeOf (0::CLulong)getDeviceInfoSizet :: CLDeviceInfo_ -> CLDeviceID -> IO (Either CLError CSize)getDeviceInfoSizet infoid device = alloca $ \(dat :: Ptr CSize) -> do  whenSuccess (raw_clGetDeviceInfo device infoid size (castPtr dat) nullPtr)    $ peek dat    where       size = fromIntegral $ sizeOf (0::CSize)
New Haskell package: OpenCL
haskell;opencl
Looking through the code, I see often the high level wrapper returns CLuints and such. I would say that is improper - Why not return the haskell type?Instead of returning, say, CLint, dof :: Integral i => ... -> iso that the user doesn't have to litter his code with those types and fromIntegrals all over the place.Also, don't leave commented code in the repository. You can always recover via git if you need to.