Tests fail to run with current purs version (master)
Closed this issue · 5 comments
coot commented
* Building project in /home/marcin/repos/purescript/purescript-argonaut-generic
Compiling Test.Main
[1/1 NoInstanceFound] test/Main.purs:30:12
30 show a = genericShow a
^^^^^^^^^^^^^
No type class instance was found for
Data.Show.Show { foo :: Int
, bar :: String
}
while applying a function genericShow
of type Generic t0 t1 => GenericShow t1 => t0 -> String
to argument a
while checking that expression genericShow a
has type String
in value declaration showExample
where t1 is an unknown type
t0 is an unknown type
Src Lib All
Warnings 0 0 0
Errors 1 0 1
* ERROR: Subcommand terminated with exit code 1
It's likely a bug in the compiler.
justinwoo commented
I think the problem here is that Record doesn't have the Show instance in prelude yet, and we should be removing generics-rep deriving for records and removing the records code from here. Seems normal to fail for now, but we should make sure 0.12RC's don't fail.
coot commented
Yes and no. The problem is that in purs 0.11.6
>:t from (Record { x: 1 })
Constructor "Rec" (Rec (Field "x" Int))
But in the master:
>:t from (Record { x: 1 })
Constructor "Rec" (Argument { x :: Int })
coot commented
Ach, ok I see. Then you're right @justinwoo.
This will break in other places not just Show, i.e. in purescript-argonaut-generic too.
justinwoo commented
Right, a lot of that code should be updated simple-json style to RowToList sooner or later
coot commented
ok, thanks @justinwoo