Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text is decomposed in parts, instead of treated as Konstant by deriveFamily #16

Closed
arianvp opened this issue May 28, 2018 · 3 comments
Closed
Assignees

Comments

@arianvp
Copy link
Collaborator

arianvp commented May 28, 2018

             
/home/arian/Documents/UU/Thesis/generics/generics-mrsop-diff/src/Examples/Lua.hs:9:1: error:
    GHC.Prim.ByteArray# is not a declaration
  |          
9 | deriveFamily [t| Stat |]
  | ^^^^^^^^^^^^^^^^^^^^^^^^

This error was due to the fact that Text from the text package is an ADT defined in terms of ByteArray# . How can I convince the deriveFamily machinery to pick it as an atom instead?

@arianvp
Copy link
Collaborator Author

arianvp commented May 28, 2018

Perhaps we should be able to provide our own consTable ?
ala:

consTable =       $ [ ( ''Int     , "KInt")
        , ( ''Char    , "KChar")
        , ( ''Integer , "KInteger")
        , ( ''Float   , "KFloat")
        , ( ''Bool    , "KBool")
        , ( ''String  , "KString")
        , ( ''Double  , "KDouble")
        , (''Text, "KTexT")
        ]

deriveFamily  'Stat consTable

@VictorCMiraldo
Copy link
Owner

yes! we should be able to do that. I will try implementing that today!

@VictorCMiraldo VictorCMiraldo self-assigned this May 28, 2018
@arianvp
Copy link
Collaborator Author

arianvp commented May 28, 2018

We should also derive TestEquality for any Singl that we generate, as we need that for stuff like generic equality, and diffs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants