VictorCMiraldo / generics-mrsop

MIT License
21 stars 1 forks source link

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

Closed arianvp closed 6 years ago

arianvp commented 6 years ago

/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 commented 6 years ago

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 commented 6 years ago

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

arianvp commented 6 years ago

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