Skip to content

Instantly share code, notes, and snippets.

@polypus74
Created February 25, 2011 00:42
Show Gist options
  • Save polypus74/843208 to your computer and use it in GitHub Desktop.
Save polypus74/843208 to your computer and use it in GitHub Desktop.
module A where
import Data.HList.CommonMain
data A = A deriving (Show)
ls = hCons "hi" $ hCons A $ hNil
upls = hUpdateAtType "bye" ls
-- shouldn't upls = HCons "bye" (HCons A HNil) ?
-- problem is i get this error:
-- /Users/polypus/Documents/creations/software/haskell/genesis/A.hs:10:7:
-- No instances for (TypeEq [Char] [Char] b,
-- HType2HNatCase b [Char] (HCons A HNil) n,
-- HUpdateAtHNat n [Char] (HCons [Char] (HCons A HNil)) l')
-- arising from a use of `hUpdateAtType'
-- at /Users/polypus/Documents/creations/software/haskell/genesis/A.hs:10:7-28
-- Possible fix:
-- add an instance declaration for
-- (TypeEq [Char] [Char] b,
-- HType2HNatCase b [Char] (HCons A HNil) n,
-- HUpdateAtHNat n [Char] (HCons [Char] (HCons A HNil)) l')
-- In the expression: hUpdateAtType "bye" ls
-- In the definition of `upls': upls = hUpdateAtType "bye" ls
@Saizan
Copy link

Saizan commented Feb 25, 2011

you also have to import some instances for TypeEq, try with Data.HList.TypeEqGeneric1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment