Skip to content

Instantly share code, notes, and snippets.

@jchia
Last active August 27, 2020 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchia/c50b638fa9ee8f6b4e7d51aef5771c0f to your computer and use it in GitHub Desktop.
Save jchia/c50b638fa9ee8f6b4e7d51aef5771c0f to your computer and use it in GitHub Desktop.
No instance for (Biplate C3 Char) arising from a use of ‘dbg4’
import Data.Data (Data)
import Data.Generics.Uniplate.Operations
import Type.Reflection (Typeable)
-- The haddock for Biplate (http://hackage.haskell.org/package/uniplate-1.6.12/docs/Data-Generics-Uniplate-Operations.html) says this:
-- instance (Data a, Data b, Uniplate b) => Biplate a b
-- But why is there an error on the last line that there is no instance for (Biplate C3 Char)?
dbg1 :: Data a => a -> Bool
dbg1 = const True
dbg2 :: Typeable a => a -> Bool
dbg2 = const True
dbg3 :: Uniplate a => a -> Bool
dbg3 = const True
dbg4 :: Biplate a b => (a, b) -> Bool
dbg4 = const True
type C3 = (Char, Char, Char)
t1, t2, t3, t4 :: Bool
t1 = dbg1 @C3 undefined
t2 = dbg1 @Char undefined
t3 = dbg3 @Char undefined
t4 = dbg4 @C3 @Char undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment