I am using c2hs to generate bindings to Wayland. I came across this unhelpful error message. I consider such a thing as a bug; it has halted me from making progress because I don't know what to do.
% c2hs Wayland/Client/Internal/C/Bug.chs
c2hs Wayland/Client/Internal/C/Bug.chs
c2hs: Errors during expansion of binding hooks:
Wayland/Client/Internal/C/Bug.chs:6: (column 3) [ERROR] >>> Internal type default error!
Something went wrong.
Here is a minimal example that expresses the bug.
-- Bug.chs
module Main where
#include <inttypes.h>
newtype Bug = Bug { getBug :: {#type uint32_t#} }
{#default in `Bug' [uint32_t] getBug#}
And here is the output of c2hs --version
% c2hs --version
c2hs --version
C->Haskell Compiler, version 0.28.1 Switcheroo, 1 April 2016
build platform is "x86_64-linux" <1, True, True, 1>
This is the latest version from Cabal.
Finally, I want to express what I was trying to do; I clearly am trying to do something in a strange way, so I might as well tell you what I wanted to have happen.
I have to pass an "opcode" to wayland, represented in the code as a uint32_t. I wanted to newtype over this and create a marshaller as above. I suspect the problem lies in doing weird stuff with newtypes in record syntax with type annotations. If there is a better way, please let me know.
Hello.
I am using c2hs to generate bindings to Wayland. I came across this unhelpful error message. I consider such a thing as a bug; it has halted me from making progress because I don't know what to do.
Here is a minimal example that expresses the bug.
And here is the output of
c2hs --version
This is the latest version from Cabal.
Finally, I want to express what I was trying to do; I clearly am trying to do something in a strange way, so I might as well tell you what I wanted to have happen.
I have to pass an "opcode" to wayland, represented in the code as a uint32_t. I wanted to newtype over this and create a marshaller as above. I suspect the problem lies in doing weird stuff with newtypes in record syntax with type annotations. If there is a better way, please let me know.
Hope this has been helpful.
Sincerely, Matt