+++ /dev/null
-TOP = ../../..
-include $(TOP)/mk/boilerplate.mk
-
-HS_SRCS = $(wildcard *.hs)
-
-SRC_RUNTEST_OPTS += -o1 $*.stdout -o2 $*.stderr -x 0
-HC_OPTS += -noC -ddump-tc -dcore-lint -hi
-
-drv004_RUNTEST_OPTS = -x 1
-drv007_RUNTEST_OPTS = -x 1
-
-%.o : %.hs
-
-%.o : %.hs
- $(RUNTEST) $(HC) $(RUNTEST_OPTS) $(HC_OPTS) -c $< -o $@ -osuf $(subst .,,$(suffix $@))
-
-all :: $(HS_OBJS)
-
-include $(TOP)/mk/target.mk
-
+++ /dev/null
---!!! canonical weird example for "deriving"
-module ShouldSucceed where
-
-data X a b
- = C1 (T a)
- | C2 (Y b)
- | C3 (X b a)
- deriving (Read, Show)
-
-data Y b
- = D1
- | D2 (X Int b)
- deriving (Read, Show)
-
-data T a
- = E1
-
-instance Eq a => Show (T a) where
- showsPrec = error "show"
-instance Eq a => Read (T a) where
- readsPrec = error "read"
+++ /dev/null
-
-
-================================================================================
-Typechecked:
-{- nonrec -}
-{- nonrec -}
-E1{-r3K,x-}{i} =
- _/\_ a{-r3A-} ->
- E1{-r3K,x-}{i}
- {_@_ a{-r3A-}}
-{- nonrec -}
-D1{-r6,x-}{i} =
- _/\_ b{-r3C-} ->
- D1{-r6,x-}{i}
- {_@_ b{-r3C-}}
-D2{-r5,x-}{i} =
- _/\_ b{-r3C-} -> \ tpl_B1 ->
- D2{-r5,x-}{i}
- {_@_ b{-r3C-} tpl_B1}
-{- nonrec -}
-C1{-rb,x-}{i} =
- _/\_ a{-r3H-} b{-r3I-} -> \ tpl_B1 ->
- C1{-rb,x-}{i}
- {_@_ a{-r3H-} _@_ b{-r3I-} tpl_B1}
-C2{-ra,x-}{i} =
- _/\_ a{-r3H-} b{-r3I-} -> \ tpl_B1 ->
- C2{-ra,x-}{i}
- {_@_ a{-r3H-} _@_ b{-r3I-} tpl_B1}
-C3{-rd,x-}{i} =
- _/\_ a{-r3H-} b{-r3I-} -> \ tpl_B1 ->
- C3{-rd,x-}{i}
- {_@_ a{-r3H-} _@_ b{-r3I-} tpl_B1}
-{- rec -}
-AbsBinds [a{-a1fw-}] [] [([a{-a1fw-}], $d3{-r1fM,x-}, d.Eval_a15O)]
- d.Eval_a15O =
- ({-dict-} [] [])
-{- rec -}
-AbsBinds [b{-a1fx-}] [] [([b{-a1fx-}], $d4{-r1ge,x-}, d.Eval_a15U)]
- d.Eval_a15U =
- ({-dict-} [] [])
-{- rec -}
-AbsBinds
-[a{-a1fy-}, b{-a1fz-}]
-[]
-[([a{-a1fy-}, b{-a1fz-}], $d5{-r1gf,x-}, d.Eval_a161)]
- d.Eval_a161 =
- ({-dict-} [] [])
-{- rec -}
-AbsBinds
-[b{-a178-}]
-[d.Eq_a17C]
-[([b{-a178-}], $d6{-r1gg,x-}, d.Read_a167)]
- d.Eq_a17Y =
- PrelBase.$d7{-rc5,p-}
- d.Eq_a17Z =
- d.Eq_a17C
- d.Read_a17W =
- $d7{-r1gl,x-}
- [PrelBase.Int{-3g,p-}, b{-a178-}]
- [d.Eq_a17Y, d.Eq_a17Z]
- readsPrec_a1gk =
- PrelRead.readsPrec{-rlS,p-}
- (X{-r3N,x-} PrelBase.Int{-3g,p-} b{-a178-})
- d.Read_a17W
- readsPrec_a1gj =
- readsPrec_a1gi
- AbsBinds [] [] [([], readsPrec_a1gi, readsPrec_a16a)]
- ==_a1gp =
- ==_a1gc
- >>=_a1go =
- >>=_a1gb
- return_a1gn =
- return_a1ga
- zero_a1gm =
- zero_a1g9
- readsPrec_a16a
- a_r12Z b_r131
- = ++_a1gd
- (Y{-r3M,x-} b{-a178-}, PrelBase.String{-rdl,p-})
- (PrelRead.readParen{-rmu,p-}
- (Y{-r3M,x-} b{-a178-})
- PrelBase.False{-58,p-}{i}
- \ c_r133 -> [ (D1{-r6,x-}{i}
- b{-a178-},
- d_r135) |
- ("D1", d_r135) <- PrelRead.lex{-rmh,p-}
- c_r133
- ]
- b_r131)
- (PrelRead.readParen{-rmu,p-}
- (Y{-r3M,x-} b{-a178-})
- a_r12Z >_a1g8 lit_a1g6
- \ c_r137 -> [ (D2{-r5,x-}{i}
- b{-a178-}
- a1_r13b,
- b1_r13c) |
- ("D2", d_r139) <- PrelRead.lex{-rmh,p-}
- c_r137, (a1_r13b, b1_r13c) <- readsPrec_a1gk
- lit_a1g4
- d_r139
- ]
- b_r131)
- AbsBinds [] [] [([], readList_a1gh, readList_a17x)]
- readList_a17x
- = PrelRead.readList__{-rjw,p-}
- (Y{-r3M,x-} b{-a178-})
- readsPrec_a1gj
- lit_a1g2
- d.Read_a167 =
- ({-dict-} [] [readsPrec_a1gi, readList_a1gh])
-{- rec -}
-AbsBinds
-[a{-a1ah-}, b{-a1ai-}]
-[d.Eq_a1aM, d.Eq_a1aN]
-[([a{-a1ah-}, b{-a1ai-}], $d7{-r1gl,x-}, d.Read_a18a)]
- d.Eq_a1b3 =
- d.Eq_a1aM
- d.Read_a1b1 =
- $d1{-r1gw,x-}
- a{-a1ah-}
- d.Eq_a1b3
- readsPrec_a1gv =
- PrelRead.readsPrec{-rlS,p-}
- (T{-r3L,x-} a{-a1ah-})
- d.Read_a1b1
- d.Eq_a1be =
- d.Eq_a1aN
- d.Read_a1bc =
- $d6{-r1gg,x-}
- b{-a1ai-}
- d.Eq_a1be
- readsPrec_a1gu =
- PrelRead.readsPrec{-rlS,p-}
- (Y{-r3M,x-} b{-a1ai-})
- d.Read_a1bc
- d.Eq_a1bi =
- d.Eq_a1aN
- d.Eq_a1bj =
- d.Eq_a1aM
- d.Read_a1bg =
- $d7{-r1gl,x-}
- [b{-a1ai-}, a{-a1ah-}]
- [d.Eq_a1bi, d.Eq_a1bj]
- readsPrec_a1gt =
- PrelRead.readsPrec{-rlS,p-}
- (X{-r3N,x-} b{-a1ai-} a{-a1ah-})
- d.Read_a1bg
- readsPrec_a1gs =
- readsPrec_a1gr
- AbsBinds [] [] [([], readsPrec_a1gr, readsPrec_a18d)]
- ++_a1gL =
- ++_a1g1
- >_a1gK =
- >_a1g0
- lit_a1gJ =
- lit_a1fZ
- ==_a1gI =
- ==_a1fY
- lit_a1gH =
- lit_a1fX
- >>=_a1gG =
- >>=_a1fW
- return_a1gF =
- return_a1fV
- zero_a1gE =
- zero_a1fU
- >_a1gD =
- >_a1g0
- lit_a1gC =
- lit_a1fZ
- ==_a1gB =
- ==_a1fY
- lit_a1gA =
- lit_a1fX
- >>=_a1gz =
- >>=_a1fW
- return_a1gy =
- return_a1fV
- zero_a1gx =
- zero_a1fU
- readsPrec_a18d
- a_r13j b_r13l
- = ++_a1g1
- (X{-r3N,x-} a{-a1ah-} b{-a1ai-}, PrelBase.String{-rdl,p-})
- (PrelRead.readParen{-rmu,p-}
- (X{-r3N,x-} a{-a1ah-} b{-a1ai-})
- a_r13j >_a1g0 lit_a1fZ
- \ c_r13n -> [ (C1{-rb,x-}{i}
- [a{-a1ah-}, b{-a1ai-}]
- a1_r13r,
- b1_r13s) |
- ("C1", d_r13p) <- PrelRead.lex{-rmh,p-}
- c_r13n, (a1_r13r, b1_r13s) <- readsPrec_a1gv
- lit_a1fX
- d_r13p
- ]
- b_r13l)
- (++_a1gL
- (X{-r3N,x-} a{-a1ah-} b{-a1ai-}, PrelBase.String{-rdl,p-})
- (PrelRead.readParen{-rmu,p-}
- (X{-r3N,x-} a{-a1ah-} b{-a1ai-})
- a_r13j >_a1gK lit_a1gJ
- \ c_r13u -> [ (C2{-ra,x-}{i}
- [a{-a1ah-}, b{-a1ai-}]
- a1_r13y,
- b1_r13z) |
- ("C2", d_r13w) <- PrelRead.lex{-rmh,p-}
- c_r13u, (a1_r13y, b1_r13z) <- readsPrec_a1gu
- lit_a1gH
- d_r13w
- ]
- b_r13l)
- (PrelRead.readParen{-rmu,p-}
- (X{-r3N,x-} a{-a1ah-} b{-a1ai-})
- a_r13j >_a1gD lit_a1gC
- \ c_r13B -> [ (C3{-rd,x-}{i}
- [a{-a1ah-}, b{-a1ai-}]
- a1_r13F,
- b1_r13G) |
- ("C3", d_r13D) <- PrelRead.lex{-rmh,p-}
- c_r13B, (a1_r13F, b1_r13G) <- readsPrec_a1gt
- lit_a1gA
- d_r13D
- ]
- b_r13l))
- AbsBinds [] [] [([], readList_a1gq, readList_a1aH)]
- readList_a1aH
- = PrelRead.readList__{-rjw,p-}
- (X{-r3N,x-} a{-a1ah-} b{-a1ai-})
- readsPrec_a1gs
- lit_a1fT
- d.Read_a18a =
- ({-dict-} [] [readsPrec_a1gr, readList_a1gq])
-{- rec -}
-AbsBinds
-[b{-a1bz-}]
-[d.Eq_a1c4]
-[([b{-a1bz-}], $d8{-r1gM,x-}, d.Show_a1bs)]
- d.Eq_a1cg =
- PrelBase.$d7{-rc5,p-}
- d.Eq_a1ch =
- d.Eq_a1c4
- d.Show_a1ce =
- $d9{-r1gR,x-}
- [PrelBase.Int{-3g,p-}, b{-a1bz-}]
- [d.Eq_a1cg, d.Eq_a1ch]
- showsPrec_a1gQ =
- PrelBase.showsPrec{-rdi,p-}
- (X{-r3N,x-} PrelBase.Int{-3g,p-} b{-a1bz-})
- d.Show_a1ce
- showsPrec_a1gP =
- showsPrec_a1gO
- AbsBinds [] [] [([], showsPrec_a1gO, showsPrec_a1bv)]
- lit_a1gS =
- lit_a1fR
- showsPrec_a1bv
- a_r13N D1{-r6,x-}{i}
- = PrelBase.showString{-rhV,p-}
- "D1"
- showsPrec_a1bv
- a_r13Q (D2{-r5,x-}{i} b1_r13S)
- = PrelBase.showParen{-rhS,p-}
- a_r13Q >=_a1fS lit_a1fR
- PrelBase..{-rd1,p-}
- [PrelBase.String{-rdl,p-}, PrelBase.String{-rdl,p-}, PrelBase.String{-rdl,p-}]
- PrelBase.showString{-rhV,p-}
- "D2 "
- showsPrec_a1gQ
- lit_a1gS b1_r13S
- AbsBinds [] [] [([], showList_a1gN, showList_a1bZ)]
- showList_a1bZ
- = PrelBase.showList__{-r3J,p-}
- (Y{-r3M,x-} b{-a1bz-})
- showsPrec_a1gP
- lit_a1fQ
- d.Show_a1bs =
- ({-dict-} [] [showsPrec_a1gO, showList_a1gN])
-{- rec -}
-AbsBinds
-[a{-a1cA-}, b{-a1cD-}]
-[d.Eq_a1dJ, d.Eq_a1dK]
-[([a{-a1cA-}, b{-a1cD-}], $d9{-r1gR,x-}, d.Show_a1cr)]
- d.Eq_a1dW =
- d.Eq_a1dJ
- d.Show_a1dU =
- $d2{-r1gZ,x-}
- a{-a1cA-}
- d.Eq_a1dW
- showsPrec_a1gY =
- PrelBase.showsPrec{-rdi,p-}
- (T{-r3L,x-} a{-a1cA-})
- d.Show_a1dU
- d.Eq_a1e0 =
- d.Eq_a1dK
- d.Show_a1dY =
- $d8{-r1gM,x-}
- b{-a1cD-}
- d.Eq_a1e0
- showsPrec_a1gX =
- PrelBase.showsPrec{-rdi,p-}
- (Y{-r3M,x-} b{-a1cD-})
- d.Show_a1dY
- d.Eq_a1e4 =
- d.Eq_a1dK
- d.Eq_a1e5 =
- d.Eq_a1dJ
- d.Show_a1e2 =
- $d9{-r1gR,x-}
- [b{-a1cD-}, a{-a1cA-}]
- [d.Eq_a1e4, d.Eq_a1e5]
- showsPrec_a1gW =
- PrelBase.showsPrec{-rdi,p-}
- (X{-r3N,x-} b{-a1cD-} a{-a1cA-})
- d.Show_a1e2
- showsPrec_a1gV =
- showsPrec_a1gU
- AbsBinds [] [] [([], showsPrec_a1gU, showsPrec_a1cu)]
- lit_a1h6 =
- lit_a1fO
- >=_a1h5 =
- >=_a1fP
- lit_a1h4 =
- lit_a1fO
- lit_a1h3 =
- lit_a1fO
- >=_a1h2 =
- >=_a1fP
- lit_a1h1 =
- lit_a1fO
- lit_a1h0 =
- lit_a1fO
- showsPrec_a1cu
- a_r13Z (C1{-rb,x-}{i} b1_r141)
- = PrelBase.showParen{-rhS,p-}
- a_r13Z >=_a1fP lit_a1fO
- PrelBase..{-rd1,p-}
- [PrelBase.String{-rdl,p-}, PrelBase.String{-rdl,p-}, PrelBase.String{-rdl,p-}]
- PrelBase.showString{-rhV,p-}
- "C1 "
- showsPrec_a1gY
- lit_a1h6 b1_r141
- showsPrec_a1cu
- a_r143 (C2{-ra,x-}{i} b1_r145)
- = PrelBase.showParen{-rhS,p-}
- a_r143 >=_a1h5 lit_a1h4
- PrelBase..{-rd1,p-}
- [PrelBase.String{-rdl,p-}, PrelBase.String{-rdl,p-}, PrelBase.String{-rdl,p-}]
- PrelBase.showString{-rhV,p-}
- "C2 "
- showsPrec_a1gX
- lit_a1h3 b1_r145
- showsPrec_a1cu
- a_r147 (C3{-rd,x-}{i} b1_r149)
- = PrelBase.showParen{-rhS,p-}
- a_r147 >=_a1h2 lit_a1h1
- PrelBase..{-rd1,p-}
- [PrelBase.String{-rdl,p-}, PrelBase.String{-rdl,p-}, PrelBase.String{-rdl,p-}]
- PrelBase.showString{-rhV,p-}
- "C3 "
- showsPrec_a1gW
- lit_a1h0 b1_r149
- AbsBinds [] [] [([], showList_a1gT, showList_a1dE)]
- showList_a1dE
- = PrelBase.showList__{-r3J,p-}
- (X{-r3N,x-} a{-a1cA-} b{-a1cD-})
- showsPrec_a1gV
- lit_a1fN
- d.Show_a1cr =
- ({-dict-} [] [showsPrec_a1gU, showList_a1gT])
-{- rec -}
-AbsBinds
-[a{-a1ek-}]
-[d.Eq_a1es]
-[([a{-a1ek-}], $d1{-r1gw,x-}, d.Read_a1ee)]
- d.Read_a1ew =
- d.Read_a1ee
- $mreadList_a1h8 =
- PrelRead.$mreadList{-rlO,p-}
- (T{-r3L,x-} a{-a1ek-})
- d.Read_a1ew
- AbsBinds [] [] [([], readsPrec_a1h7, readsPrec_a1eh)]
- readsPrec_a1eh
- = IOBase.error{-87,p-}
- (PrelBase.Int{-3g,p-}
- -> PrelBase.String{-rdl,p-}
- -> [(T{-r3L,x-} a{-a1ek-}, PrelBase.String{-rdl,p-})])
- "read"
- AbsBinds [] [] [([], readList_a1en, readList_a1ep)]
- readList_a1ep
- = $mreadList_a1h8
- d.Read_a1ee =
- ({-dict-} [] [readsPrec_a1h7, readList_a1en])
-{- rec -}
-AbsBinds
-[a{-a1eJ-}]
-[d.Eq_a1eR]
-[([a{-a1eJ-}], $d2{-r1gZ,x-}, d.Show_a1eD)]
- d.Show_a1eV =
- d.Show_a1eD
- $mshowList_a1ha =
- PrelBase.$mshowList{-rcA,p-}
- (T{-r3L,x-} a{-a1eJ-})
- d.Show_a1eV
- AbsBinds [] [] [([], showsPrec_a1h9, showsPrec_a1eG)]
- showsPrec_a1eG
- = IOBase.error{-87,p-}
- (PrelBase.Int{-3g,p-}
- -> T{-r3L,x-} a{-a1eJ-}
- -> PrelBase.String{-rdl,p-}
- -> PrelBase.String{-rdl,p-})
- "show"
- AbsBinds [] [] [([], showList_a1eM, showList_a1eO)]
- showList_a1eO
- = $mshowList_a1ha
- d.Show_a1eD =
- ({-dict-} [] [showsPrec_a1h9, showList_a1eM])
-{- nonrec -}
-d.MonadPlus_a1eY =
- PrelBase.$d22{-rbr,p-}
-++_a1gd =
- PrelBase.++{-rfN,p-}
- PrelBase.[]{-3j,p-}
- d.MonadPlus_a1eY
-d.Eq_a1f3 =
- PrelBase.$d33{-rbD,p-}
-d.Eq_a1f1 =
- PrelBase.$d27{-rbw,p-}
- PrelBase.Char{-38,p-}
- d.Eq_a1f3
-==_a1gc =
- PrelBase.=={-8Y,p-}
- [PrelBase.Char{-38,p-}]
- d.Eq_a1f1
-d.Monad_a1f6 =
- PrelBase.$d24{-rbt,p-}
->>=_a1gb =
- PrelBase.>>={-811,p-}
- PrelBase.[]{-3j,p-}
- d.Monad_a1f6
-d.Monad_a1f9 =
- d.Monad_a1f6
-return_a1ga =
- PrelBase.return{-816,p-}
- PrelBase.[]{-3j,p-}
- d.Monad_a1f9
-d.MonadZero_a1fb =
- PrelBase.$d23{-rbs,p-}
-zero_a1g9 =
- PrelBase.zero{-810,p-}
- PrelBase.[]{-3j,p-}
- d.MonadZero_a1fb
-d.Ord_a1fe =
- PrelBase.$d6{-rc4,p-}
->_a1g8 =
- PrelBase.>{-rdf,p-}
- PrelBase.Int{-3g,p-}
- d.Ord_a1fe
-d.Num_a1fi =
- PrelBase.$d3{-rbz,p-}
-fromInt_a1g7 =
- PrelBase.fromInt{-8R,p-}
- PrelBase.Int{-3g,p-}
- d.Num_a1fi
-lit_a1g6 =
- fromInt_a1g7
- PrelBase.I#{-5b,p-}{i}
- 9#
-fromInt_a1g5 =
- fromInt_a1g7
-lit_a1g4 =
- fromInt_a1g5
- PrelBase.I#{-5b,p-}{i}
- 10#
-fromInt_a1g3 =
- fromInt_a1g7
-lit_a1g2 =
- fromInt_a1g3
- PrelBase.I#{-5b,p-}{i}
- 0#
-++_a1g1 =
- ++_a1gd
->_a1g0 =
- >_a1g8
-lit_a1fZ =
- lit_a1g6
-==_a1fY =
- ==_a1gc
-lit_a1fX =
- lit_a1g4
->>=_a1fW =
- >>=_a1gb
-return_a1fV =
- return_a1ga
-zero_a1fU =
- zero_a1g9
-lit_a1fT =
- lit_a1g2
-d.Ord_a1fn =
- d.Ord_a1fe
->=_a1fS =
- PrelBase.>={-8Z,p-}
- PrelBase.Int{-3g,p-}
- d.Ord_a1fn
-lit_a1fR =
- lit_a1g4
-lit_a1fQ =
- lit_a1g2
->=_a1fP =
- >=_a1fS
-lit_a1fO =
- lit_a1g4
-lit_a1fN =
- lit_a1g2
-ghc: module version changed to 1; reason: no old .hi file
+++ /dev/null
-module ShouldSucceed where
-
-data Z a b
- = C1 (T a)
- | C2 (Z [a] [b])
- deriving (Show, Read)
-
-data T a
- = E1
-
-instance Eq a => Show (T a) where
- showsPrec = error "show"
-instance Eq a => Read (T a) where
- readsPrec = error "read"
+++ /dev/null
-
-
-================================================================================
-Typechecked:
-{- nonrec -}
-{- nonrec -}
-E1{-r3B,x-}{i} =
- _/\_ a{-r3t-} ->
- E1{-r3B,x-}{i}
- {_@_ a{-r3t-}}
-{- nonrec -}
-C1{-r6,x-}{i} =
- _/\_ a{-r3v-} b{-r3w-} -> \ tpl_B1 ->
- C1{-r6,x-}{i}
- {_@_ a{-r3v-} _@_ b{-r3w-} tpl_B1}
-C2{-r5,x-}{i} =
- _/\_ a{-r3v-} b{-r3w-} -> \ tpl_B1 ->
- C2{-r5,x-}{i}
- {_@_ a{-r3v-} _@_ b{-r3w-} tpl_B1}
-{- rec -}
-AbsBinds [a{-a1a9-}] [] [([a{-a1a9-}], $d3{-r1ag,x-}, d.Eval_a14Q)]
- d.Eval_a14Q =
- ({-dict-} [] [])
-{- rec -}
-AbsBinds
-[a{-a1aa-}, b{-a1ab-}]
-[]
-[([a{-a1aa-}, b{-a1ab-}], $d4{-r1aw,x-}, d.Eval_a14X)]
- d.Eval_a14X =
- ({-dict-} [] [])
-{- rec -}
-AbsBinds
-[a{-a16r-}, b{-a16s-}]
-[d.Eq_a16W]
-[([a{-a16r-}, b{-a16s-}], $d5{-r1ax,x-}, d.Read_a154)]
- d.Eq_a17c =
- d.Eq_a16W
- d.Read_a17a =
- $d1{-r1aD,x-}
- a{-a16r-}
- d.Eq_a17c
- readsPrec_a1aC =
- PrelRead.readsPrec{-r62,p-}
- (T{-r3C,x-} a{-a16r-})
- d.Read_a17a
- d.Eq_a17p =
- d.Eq_a16W
- d.Eq_a17n =
- PrelBase.$d27{-rf7,p-}
- a{-a16r-}
- d.Eq_a17p
- d.Read_a17l =
- $d5{-r1ax,x-}
- [[a{-a16r-}], [b{-a16s-}]]
- d.Eq_a17n
- readsPrec_a1aB =
- PrelRead.readsPrec{-r62,p-}
- (Z{-r3D,x-} [a{-a16r-}] [b{-a16s-}])
- d.Read_a17l
- readsPrec_a1aA =
- readsPrec_a1az
- AbsBinds [] [] [([], readsPrec_a1az, readsPrec_a157)]
- >_a1aK =
- >_a1au
- lit_a1aJ =
- lit_a1as
- ==_a1aI =
- ==_a1ar
- lit_a1aH =
- lit_a1ap
- >>=_a1aG =
- >>=_a1ao
- return_a1aF =
- return_a1an
- zero_a1aE =
- zero_a1am
- readsPrec_a157
- a_r12I b_r12K
- = ++_a1av
- (Z{-r3D,x-} a{-a16r-} b{-a16s-}, PrelBase.String{-r7r,p-})
- (PrelRead.readParen{-r6E,p-}
- (Z{-r3D,x-} a{-a16r-} b{-a16s-})
- a_r12I >_a1au lit_a1as
- \ c_r12M -> [ (C1{-r6,x-}{i}
- [a{-a16r-}, b{-a16s-}]
- a1_r12Q,
- b1_r12R) |
- ("C1", d_r12O) <- PrelRead.lex{-r6r,p-}
- c_r12M, (a1_r12Q, b1_r12R) <- readsPrec_a1aC
- lit_a1ap
- d_r12O
- ]
- b_r12K)
- (PrelRead.readParen{-r6E,p-}
- (Z{-r3D,x-} a{-a16r-} b{-a16s-})
- a_r12I >_a1aK lit_a1aJ
- \ c_r12T -> [ (C2{-r5,x-}{i}
- [a{-a16r-}, b{-a16s-}]
- a1_r12X,
- b1_r12Y) |
- ("C2", d_r12V) <- PrelRead.lex{-r6r,p-}
- c_r12T, (a1_r12X, b1_r12Y) <- readsPrec_a1aB
- lit_a1aH
- d_r12V
- ]
- b_r12K)
- AbsBinds [] [] [([], readList_a1ay, readList_a16R)]
- readList_a16R
- = PrelRead.readList__{-r3A,p-}
- (Z{-r3D,x-} a{-a16r-} b{-a16s-})
- readsPrec_a1aA
- lit_a1ak
- d.Read_a154 =
- ({-dict-} [] [readsPrec_a1az, readList_a1ay])
-{- rec -}
-AbsBinds
-[a{-a17H-}, b{-a17K-}]
-[d.Eq_a18v]
-[([a{-a17H-}, b{-a17K-}], $d6{-r1aL,x-}, d.Show_a17y)]
- d.Eq_a18H =
- d.Eq_a18v
- d.Show_a18F =
- $d2{-r1aR,x-}
- a{-a17H-}
- d.Eq_a18H
- showsPrec_a1aQ =
- PrelBase.showsPrec{-rgT,p-}
- (T{-r3C,x-} a{-a17H-})
- d.Show_a18F
- d.Eq_a18N =
- d.Eq_a18v
- d.Eq_a18L =
- PrelBase.$d27{-rf7,p-}
- a{-a17H-}
- d.Eq_a18N
- d.Show_a18J =
- $d6{-r1aL,x-}
- [[a{-a17H-}], [b{-a17K-}]]
- d.Eq_a18L
- showsPrec_a1aP =
- PrelBase.showsPrec{-rgT,p-}
- (Z{-r3D,x-} [a{-a17H-}] [b{-a17K-}])
- d.Show_a18J
- showsPrec_a1aO =
- showsPrec_a1aN
- AbsBinds [] [] [([], showsPrec_a1aN, showsPrec_a17B)]
- lit_a1aV =
- lit_a1ai
- >=_a1aU =
- >=_a1aj
- lit_a1aT =
- lit_a1ai
- lit_a1aS =
- lit_a1ai
- showsPrec_a17B
- a_r135 (C1{-r6,x-}{i} b1_r137)
- = PrelBase.showParen{-rlt,p-}
- a_r135 >=_a1aj lit_a1ai
- PrelBase..{-rgC,p-}
- [PrelBase.String{-r7r,p-}, PrelBase.String{-r7r,p-}, PrelBase.String{-r7r,p-}]
- PrelBase.showString{-rlw,p-}
- "C1 "
- showsPrec_a1aQ
- lit_a1aV b1_r137
- showsPrec_a17B
- a_r139 (C2{-r5,x-}{i} b1_r13b)
- = PrelBase.showParen{-rlt,p-}
- a_r139 >=_a1aU lit_a1aT
- PrelBase..{-rgC,p-}
- [PrelBase.String{-r7r,p-}, PrelBase.String{-r7r,p-}, PrelBase.String{-r7r,p-}]
- PrelBase.showString{-rlw,p-}
- "C2 "
- showsPrec_a1aP
- lit_a1aS b1_r13b
- AbsBinds [] [] [([], showList_a1aM, showList_a18q)]
- showList_a18q
- = PrelBase.showList__{-rlr,p-}
- (Z{-r3D,x-} a{-a17H-} b{-a17K-})
- showsPrec_a1aO
- lit_a1ah
- d.Show_a17y =
- ({-dict-} [] [showsPrec_a1aN, showList_a1aM])
-{- rec -}
-AbsBinds
-[a{-a191-}]
-[d.Eq_a199]
-[([a{-a191-}], $d1{-r1aD,x-}, d.Read_a18V)]
- d.Read_a19d =
- d.Read_a18V
- $mreadList_a1aX =
- PrelRead.$mreadList{-r5Y,p-}
- (T{-r3C,x-} a{-a191-})
- d.Read_a19d
- AbsBinds [] [] [([], readsPrec_a1aW, readsPrec_a18Y)]
- readsPrec_a18Y
- = IOBase.error{-87,p-}
- (PrelBase.Int{-3g,p-}
- -> PrelBase.String{-r7r,p-}
- -> [(T{-r3C,x-} a{-a191-}, PrelBase.String{-r7r,p-})])
- "read"
- AbsBinds [] [] [([], readList_a194, readList_a196)]
- readList_a196
- = $mreadList_a1aX
- d.Read_a18V =
- ({-dict-} [] [readsPrec_a1aW, readList_a194])
-{- rec -}
-AbsBinds
-[a{-a19q-}]
-[d.Eq_a19y]
-[([a{-a19q-}], $d2{-r1aR,x-}, d.Show_a19k)]
- d.Show_a19C =
- d.Show_a19k
- $mshowList_a1aZ =
- PrelBase.$mshowList{-rgb,p-}
- (T{-r3C,x-} a{-a19q-})
- d.Show_a19C
- AbsBinds [] [] [([], showsPrec_a1aY, showsPrec_a19n)]
- showsPrec_a19n
- = IOBase.error{-87,p-}
- (PrelBase.Int{-3g,p-}
- -> T{-r3C,x-} a{-a19q-}
- -> PrelBase.String{-r7r,p-}
- -> PrelBase.String{-r7r,p-})
- "show"
- AbsBinds [] [] [([], showList_a19t, showList_a19v)]
- showList_a19v
- = $mshowList_a1aZ
- d.Show_a19k =
- ({-dict-} [] [showsPrec_a1aY, showList_a19t])
-{- nonrec -}
-d.MonadPlus_a19F =
- PrelBase.$d22{-rf2,p-}
-++_a1av =
- PrelBase.++{-rjn,p-}
- PrelBase.[]{-3j,p-}
- d.MonadPlus_a19F
-d.Ord_a19I =
- PrelBase.$d6{-rfF,p-}
->_a1au =
- PrelBase.>{-rgQ,p-}
- PrelBase.Int{-3g,p-}
- d.Ord_a19I
-d.Num_a19M =
- PrelBase.$d3{-rfa,p-}
-fromInt_a1at =
- PrelBase.fromInt{-8R,p-}
- PrelBase.Int{-3g,p-}
- d.Num_a19M
-lit_a1as =
- fromInt_a1at
- PrelBase.I#{-5b,p-}{i}
- 9#
-d.Eq_a19R =
- PrelBase.$d33{-rfe,p-}
-d.Eq_a19P =
- PrelBase.$d27{-rf7,p-}
- PrelBase.Char{-38,p-}
- d.Eq_a19R
-==_a1ar =
- PrelBase.=={-8Y,p-}
- [PrelBase.Char{-38,p-}]
- d.Eq_a19P
-fromInt_a1aq =
- fromInt_a1at
-lit_a1ap =
- fromInt_a1aq
- PrelBase.I#{-5b,p-}{i}
- 10#
-d.Monad_a19V =
- PrelBase.$d24{-rf4,p-}
->>=_a1ao =
- PrelBase.>>={-811,p-}
- PrelBase.[]{-3j,p-}
- d.Monad_a19V
-d.Monad_a19Y =
- d.Monad_a19V
-return_a1an =
- PrelBase.return{-816,p-}
- PrelBase.[]{-3j,p-}
- d.Monad_a19Y
-d.MonadZero_a1a0 =
- PrelBase.$d23{-rf3,p-}
-zero_a1am =
- PrelBase.zero{-810,p-}
- PrelBase.[]{-3j,p-}
- d.MonadZero_a1a0
-fromInt_a1al =
- fromInt_a1at
-lit_a1ak =
- fromInt_a1al
- PrelBase.I#{-5b,p-}{i}
- 0#
-d.Ord_a1a4 =
- d.Ord_a19I
->=_a1aj =
- PrelBase.>={-8Z,p-}
- PrelBase.Int{-3g,p-}
- d.Ord_a1a4
-lit_a1ai =
- lit_a1ap
-lit_a1ah =
- lit_a1ak
-ghc: module version changed to 1; reason: no old .hi file
+++ /dev/null
---!!! This is the example given in TcDeriv
---
-module ShouldSucceed where
-
-data T a b
- = C1 (Foo a) (Bar b)
- | C2 Int (T b a)
- | C3 (T a a)
- deriving Eq
-
-data Foo a = MkFoo Double a deriving ()
-instance (Eq a) => Eq (Foo a)
-
-data Bar a = MkBar Int Int deriving ()
-instance (Ping b) => Eq (Bar b)
-
-class Ping a
+++ /dev/null
-
-
-================================================================================
-Typechecked:
-{- nonrec -}
-MkBar{-r3E,x-}{i} =
- _/\_ a{-r3u-} -> \ tpl_B1 tpl_B2 ->
- MkBar{-r3E,x-}{i}
- {_@_ a{-r3u-} tpl_B1 tpl_B2}
-{- nonrec -}
-MkFoo{-r3G,x-}{i} =
- _/\_ a{-r3z-} -> \ tpl_B1 tpl_B2 ->
- MkFoo{-r3G,x-}{i}
- {_@_ a{-r3z-} tpl_B1 tpl_B2}
-{- nonrec -}
-C1{-r9,x-}{i} =
- _/\_ a{-r3B-} b{-r3C-} -> \ tpl_B1 tpl_B2 ->
- C1{-r9,x-}{i}
- {_@_ a{-r3B-} _@_ b{-r3C-} tpl_B1 tpl_B2}
-C2{-r8,x-}{i} =
- _/\_ a{-r3B-} b{-r3C-} -> \ tpl_B1 tpl_B2 ->
- C2{-r8,x-}{i}
- {_@_ a{-r3B-} _@_ b{-r3C-} tpl_B1 tpl_B2}
-C3{-rb,x-}{i} =
- _/\_ a{-r3B-} b{-r3C-} -> \ tpl_B1 ->
- C3{-rb,x-}{i}
- {_@_ a{-r3B-} _@_ b{-r3C-} tpl_B1}
-{- nonrec -}
-{- nonrec -}
-{- rec -}
-AbsBinds
-[a{-aHF-}, b{-aHG-}]
-[d.Eq_aIL, d.Ping_aIM, d.Eq_aIN, d.Ping_aIO]
-[([a{-aHF-}, b{-aHG-}], $d3{-rKF,x-}, d.Eq_aHt)]
- d.Eq_aIU =
- d.Eq_aIL
- d.Eq_aIS =
- $d2{-rKO,x-}
- a{-aHF-}
- d.Eq_aIU
- ==_aKN =
- PrelBase.=={-8Y,p-}
- (Foo{-r3H,x-} a{-aHF-})
- d.Eq_aIS
- d.Ping_aIY =
- d.Ping_aIO
- d.Eq_aIW =
- $d1{-rKP,x-}
- b{-aHG-}
- d.Ping_aIY
- ==_aKM =
- PrelBase.=={-8Y,p-}
- (Bar{-r3F,x-} b{-aHG-})
- d.Eq_aIW
- d.Eq_aJ4 =
- d.Eq_aIN
- d.Ping_aJ5 =
- d.Ping_aIO
- d.Eq_aJ6 =
- d.Eq_aIL
- d.Ping_aJ7 =
- d.Ping_aIM
- d.Eq_aJ2 =
- $d3{-rKF,x-}
- [b{-aHG-}, a{-aHF-}]
- [d.Eq_aJ4, d.Ping_aJ5, d.Eq_aJ6, d.Ping_aJ7]
- ==_aKL =
- PrelBase.=={-8Y,p-}
- (T{-r3I,x-} b{-aHG-} a{-aHF-})
- d.Eq_aJ2
- d.Eq_aJb =
- d.Eq_aIL
- d.Ping_aJc =
- d.Ping_aIM
- d.Eq_aJd =
- d.Eq_aIL
- d.Ping_aJe =
- d.Ping_aIM
- d.Eq_aJ9 =
- $d3{-rKF,x-}
- [a{-aHF-}, a{-aHF-}]
- [d.Eq_aJb, d.Ping_aJc, d.Eq_aJd, d.Ping_aJe]
- ==_aKK =
- PrelBase.=={-8Y,p-}
- (T{-r3I,x-} a{-aHF-} a{-aHF-})
- d.Eq_aJ9
- ==_aKJ =
- ==_aKI
- AbsBinds [] [] [([], ==_aKI, ==_aHw)]
- ==_aHw
- (C1{-r9,x-}{i} a1_rGO a2_rGP) (C1{-r9,x-}{i} b1_rGR b2_rGS)
- = (a1_rGO ==_aKN b1_rGR)
- PrelBase.&&{-rcW,p-} (a2_rGP ==_aKM b2_rGS)
- ==_aHw
- (C2{-r8,x-}{i} a1_rGU a2_rGV) (C2{-r8,x-}{i} b1_rGX b2_rGY)
- = (a1_rGU ==_aKG b1_rGX)
- PrelBase.&&{-rcW,p-} (a2_rGV ==_aKL b2_rGY)
- ==_aHw
- (C3{-rb,x-}{i} a1_rH0) (C3{-rb,x-}{i} b1_rH2)
- = a1_rH0 ==_aKK b1_rH2
- ==_aHw
- a_rH4 b_rH6
- = PrelBase.False{-58,p-}{i}
- AbsBinds [] [] [([], /=_aKH, /=_aIE)]
- /=_aIE
- a_rHa b_rHc
- = PrelBase.not{-r3D,p-}
- ==_aKJ
- a_rHa b_rHc
- d.Eq_aHt =
- ({-dict-} [] [==_aKI, /=_aKH])
-{- rec -}
-AbsBinds [a{-aKB-}] [] [([a{-aKB-}], $d4{-rKR,x-}, d.Eval_aJo)]
- d.Eval_aJo =
- ({-dict-} [] [])
-{- rec -}
-AbsBinds [a{-aKC-}] [] [([a{-aKC-}], $d5{-rKT,x-}, d.Eval_aJu)]
- d.Eval_aJu =
- ({-dict-} [] [])
-{- rec -}
-AbsBinds
-[a{-aKD-}, b{-aKE-}]
-[]
-[([a{-aKD-}, b{-aKE-}], $d6{-rKV,x-}, d.Eval_aJB)]
- d.Eval_aJB =
- ({-dict-} [] [])
-{- rec -}
-AbsBinds
-[b{-aJO-}]
-[d.Ping_aJX]
-[([b{-aJO-}], $d1{-rKP,x-}, d.Eq_aJH)]
- d.Eq_aK1 =
- d.Eq_aJH
- $m==_aKX =
- PrelBase.$m=={-rcc,p-}
- (Bar{-r3F,x-} b{-aJO-})
- d.Eq_aK1
- d.Eq_aK3 =
- d.Eq_aJH
- $m/=_aKW =
- PrelBase.$m/={-rc9,p-}
- (Bar{-r3F,x-} b{-aJO-})
- d.Eq_aK3
- AbsBinds [] [] [([], ==_aJJ, ==_aJL)]
- ==_aJL
- = $m==_aKX
- AbsBinds [] [] [([], /=_aJS, /=_aJU)]
- /=_aJU
- = $m/=_aKW
- d.Eq_aJH =
- ({-dict-} [] [==_aJJ, /=_aJS])
-{- rec -}
-AbsBinds
-[a{-aKh-}]
-[d.Eq_aKq]
-[([a{-aKh-}], $d2{-rKO,x-}, d.Eq_aKa)]
- d.Eq_aKu =
- d.Eq_aKa
- $m==_aKZ =
- PrelBase.$m=={-rcc,p-}
- (Foo{-r3H,x-} a{-aKh-})
- d.Eq_aKu
- d.Eq_aKw =
- d.Eq_aKa
- $m/=_aKY =
- PrelBase.$m/={-rc9,p-}
- (Foo{-r3H,x-} a{-aKh-})
- d.Eq_aKw
- AbsBinds [] [] [([], ==_aKc, ==_aKe)]
- ==_aKe
- = $m==_aKZ
- AbsBinds [] [] [([], /=_aKl, /=_aKn)]
- /=_aKn
- = $m/=_aKY
- d.Eq_aKa =
- ({-dict-} [] [==_aKc, /=_aKl])
-{- nonrec -}
-d.Eq_aKA =
- PrelBase.$d7{-rc2,p-}
-==_aKG =
- PrelBase.=={-8Y,p-}
- PrelBase.Int{-3g,p-}
- d.Eq_aKA
-ghc: module version changed to 1; reason: no old .hi file
+++ /dev/null
---!!! simple example of deriving Ord (and, implicitly, Eq)
---
-module ShouldSucceed where
-
-data Foo a b
- = C1 a Int
- | C2 b Double
- deriving Ord
+++ /dev/null
-
-drv004.hs:5: No instance for:
- `PrelBase.Eq (Foo a{-aIX-} b{-aIY-})'
- drv004.hs:5:
- in an instance declaration
- When checking superclass constraints of an instance declaration
-
-
-Compilation had errors
+++ /dev/null
---!!! simple example of deriving Enum
---
-module ShouldSucceed where
-
-data Foo = Foo1 | Foo2 | Foo3 | Foo4 | Foo5 | Foo6 | Foo7 | Foo8
- deriving Enum
+++ /dev/null
-
-
-================================================================================
-Typechecked:
-{- nonrec -}
-Foo1{-r4,x-}{i} =
- Foo1{-r4,x-}{i}
- {}
-Foo2{-r3,x-}{i} =
- Foo2{-r3,x-}{i}
- {}
-Foo3{-r6,x-}{i} =
- Foo3{-r6,x-}{i}
- {}
-Foo4{-r8,x-}{i} =
- Foo4{-r8,x-}{i}
- {}
-Foo5{-ra,x-}{i} =
- Foo5{-ra,x-}{i}
- {}
-Foo6{-rc,x-}{i} =
- Foo6{-rc,x-}{i}
- {}
-Foo7{-re,x-}{i} =
- Foo7{-re,x-}{i}
- {}
-Foo8{-rg,x-}{i} =
- Foo8{-rg,x-}{i}
- {}
-{- rec -}
-AbsBinds [] [] [([], $d1{-rJK,x-}, d.Enum_aHX)]
- map_aJU =
- map_aJP
- AbsBinds [] [] [([], toEnum_aJT, toEnum_aI0)]
- toEnum_aI0
- a_rH5 = tag2con_Foo#_rGH
- a_rH5
- AbsBinds [] [] [([], fromEnum_aJS, fromEnum_aI5)]
- fromEnum_aI5
- a_rHp = case
- con2tag_Foo#_rGJ
- a_rHp
- of
- a#_rHr -> PrelBase.I#{-5b,p-}{i}
- a#_rHr
- AbsBinds [] [] [([], enumFrom_aJR, enumFrom_aIc)]
- enumFrom_aIc
- a_rH9 = case
- con2tag_Foo#_rGJ
- a_rH9
- of
- a#_rHb -> map_aJP
- [PrelBase.Int{-3g,p-}, Foo{-rZ,x-}]
- tag2con_Foo#_rGH
- enumFromTo_aJO
- PrelBase.I#{-5b,p-}{i}
- a#_rHb
- maxtag_Foo#_rGI
- AbsBinds [] [] [([], enumFromThen_aJQ, enumFromThen_aIA)]
- enumFromThen_aIA
- a_rHf b_rHh
- = case
- con2tag_Foo#_rGJ
- a_rHf
- of
- a#_rHj -> case
- con2tag_Foo#_rGJ
- b_rHh
- of
- b#_rHl -> map_aJU
- [PrelBase.Int{-3g,p-}, Foo{-rZ,x-}]
- tag2con_Foo#_rGH
- enumFromThenTo_aJN
- PrelBase.I#{-5b,p-}{i}
- a#_rHj
- PrelBase.I#{-5b,p-}{i}
- b#_rHl
- maxtag_Foo#_rGI
- AbsBinds [] [] [([], enumFromTo_aJ1, enumFromTo_aJ3)]
- enumFromTo_aJ3
- = $menumFromTo_aJM
- AbsBinds [] [] [([], enumFromThenTo_aJa, enumFromThenTo_aJc)]
- enumFromThenTo_aJc
- = $menumFromThenTo_aJL
- d.Enum_aHX =
- ({-dict-}
- []
- [toEnum_aJT, fromEnum_aJS, enumFrom_aJR, enumFromThen_aJQ, enumFromTo_aJ1, enumFromThenTo_aJa])
-{- rec -}
-AbsBinds [] [] [([], $d2{-rJW,x-}, d.Eval_aJw)]
- d.Eval_aJw =
- ({-dict-} [] [])
-{- nonrec -}
-d.Functor_aJy =
- PrelBase.$d25{-rbd,p-}
-map_aJP =
- PrelBase.map{-rY,p-}
- PrelBase.[]{-3j,p-}
- d.Functor_aJy
-d.Enum_aJB =
- PrelBase.$d5{-rbE,p-}
-enumFromTo_aJO =
- PrelBase.enumFromTo{-8W,p-}
- PrelBase.Int{-3g,p-}
- d.Enum_aJB
-d.Enum_aJE =
- d.Enum_aJB
-enumFromThenTo_aJN =
- PrelBase.enumFromThenTo{-8X,p-}
- PrelBase.Int{-3g,p-}
- d.Enum_aJE
-d.Enum_aJG =
- $d1{-rJK,x-}
-$menumFromTo_aJM =
- PrelBase.$menumFromTo{-rc8,p-}
- Foo{-rZ,x-}
- d.Enum_aJG
-d.Enum_aJJ =
- d.Enum_aJG
-$menumFromThenTo_aJL =
- PrelBase.$menumFromThenTo{-rc7,p-}
- Foo{-rZ,x-}
- d.Enum_aJJ
-{- nonrec -}
-AbsBinds [] [] [([], con2tag_Foo#_rGJ, con2tag_Foo#_aHG)]
- con2tag_Foo#_aHG
- Foo1{-r4,x-}{i}
- = 0#
- con2tag_Foo#_aHG
- Foo2{-r3,x-}{i}
- = 1#
- con2tag_Foo#_aHG
- Foo3{-r6,x-}{i}
- = 2#
- con2tag_Foo#_aHG
- Foo4{-r8,x-}{i}
- = 3#
- con2tag_Foo#_aHG
- Foo5{-ra,x-}{i}
- = 4#
- con2tag_Foo#_aHG
- Foo6{-rc,x-}{i}
- = 5#
- con2tag_Foo#_aHG
- Foo7{-re,x-}{i}
- = 6#
- con2tag_Foo#_aHG
- Foo8{-rg,x-}{i}
- = 7#
-{- nonrec -}
-{- nonrec -}
-AbsBinds [] [] [([], maxtag_Foo#_rGI, maxtag_Foo#_aHK)]
- maxtag_Foo#_aHK
- = PrelBase.I#{-5b,p-}{i}
- 7#
-{- nonrec -}
-{- nonrec -}
-AbsBinds [] [] [([], tag2con_Foo#_rGH, tag2con_Foo#_aHO)]
- tag2con_Foo#_aHO
- (PrelBase.I#{-5b,p-}{i} 0#)
- = Foo1{-r4,x-}{i}
- tag2con_Foo#_aHO
- (PrelBase.I#{-5b,p-}{i} 1#)
- = Foo2{-r3,x-}{i}
- tag2con_Foo#_aHO
- (PrelBase.I#{-5b,p-}{i} 2#)
- = Foo3{-r6,x-}{i}
- tag2con_Foo#_aHO
- (PrelBase.I#{-5b,p-}{i} 3#)
- = Foo4{-r8,x-}{i}
- tag2con_Foo#_aHO
- (PrelBase.I#{-5b,p-}{i} 4#)
- = Foo5{-ra,x-}{i}
- tag2con_Foo#_aHO
- (PrelBase.I#{-5b,p-}{i} 5#)
- = Foo6{-rc,x-}{i}
- tag2con_Foo#_aHO
- (PrelBase.I#{-5b,p-}{i} 6#)
- = Foo7{-re,x-}{i}
- tag2con_Foo#_aHO
- (PrelBase.I#{-5b,p-}{i} 7#)
- = Foo8{-rg,x-}{i}
- tag2con_Foo#_aHO
- _ = IOBase.error{-87,p-}
- Foo{-rZ,x-}
- "Urk! in TcGenDeriv"
-{- nonrec -}
-ghc: module version changed to 1; reason: no old .hi file
+++ /dev/null
---!!! simple examples of deriving Ix
---
-module ShouldSucceed where
-import Ix
-
-data Foo = Foo1 | Foo2 | Foo3 | Foo4 | Foo5 | Foo6 | Foo7 | Foo8
- deriving (Eq, Ord, Ix, Show)
-
-data Bar a b = MkBar a Int b Integer a
+++ /dev/null
-
-
-================================================================================
-Typechecked:
-{- nonrec -}
-{- nonrec -}
-MkBar{-r4H,x-}{i} =
- _/\_ a{-r4B-} b{-r4C-} -> \ tpl_B1 tpl_B2 tpl_B3 tpl_B4 tpl_B5 ->
- MkBar{-r4H,x-}{i}
- {_@_ a{-r4B-} _@_ b{-r4C-} tpl_B1 tpl_B2 tpl_B3 tpl_B4 tpl_B5}
-{- nonrec -}
-Foo1{-r4t,x-}{i} =
- Foo1{-r4t,x-}{i}
- {}
-Foo2{-r4s,x-}{i} =
- Foo2{-r4s,x-}{i}
- {}
-Foo3{-r4u,x-}{i} =
- Foo3{-r4u,x-}{i}
- {}
-Foo4{-r4v,x-}{i} =
- Foo4{-r4v,x-}{i}
- {}
-Foo5{-r4w,x-}{i} =
- Foo5{-r4w,x-}{i}
- {}
-Foo6{-r4x,x-}{i} =
- Foo6{-r4x,x-}{i}
- {}
-Foo7{-r4y,x-}{i} =
- Foo7{-r4y,x-}{i}
- {}
-Foo8{-r4z,x-}{i} =
- Foo8{-r4z,x-}{i}
- {}
-{- rec -}
-AbsBinds [] [] [([], $d1{-r193,x-}, d.Eq_a14i)]
- ==_a19a =
- ==_a199
- AbsBinds [] [] [([], ==_a199, ==_a14l)]
- ==_a14l
- a_r10n b_r10p
- = case
- con2tag_Foo#_r101
- a_r10n
- of
- a#_r10r -> case
- con2tag_Foo#_r101
- b_r10p
- of
- b#_r10t -> if a#_r10r GHC.==#{-79,p-}{I} b#_r10t then
- PrelBase.True{-5E,p-}{i}
- else
- PrelBase.False{-58,p-}{i}
- AbsBinds [] [] [([], /=_a198, /=_a14x)]
- /=_a14x
- a_r10x b_r10z
- = PrelBase.not{-rho,p-}
- ==_a19a
- a_r10x b_r10z
- d.Eq_a14i =
- ({-dict-} [] [==_a199, /=_a198])
-{- rec -}
-AbsBinds
-[a{-a191-}, b{-a192-}]
-[]
-[([a{-a191-}, b{-a192-}], $d2{-r19b,x-}, d.Eval_a14N)]
- d.Eval_a14N =
- ({-dict-} [] [])
-{- rec -}
-AbsBinds [] [] [([], $d3{-r19c,x-}, d.Eval_a14S)]
- d.Eval_a14S =
- ({-dict-} [] [])
-{- rec -}
-AbsBinds [] [] [([], $d4{-r19d,x-}, d.Ord_a14X)]
- d.Eq_a16H =
- $d1{-r193,x-}
- compare_a19q =
- compare_a19k
- compare_a19p =
- compare_a19k
- compare_a19o =
- compare_a19k
- compare_a19n =
- compare_a19k
- compare_a19m =
- compare_a19k
- compare_a19l =
- compare_a19k
- AbsBinds [] [] [([], compare_a19k, compare_a150)]
- compare_a150
- a_r11y b_r11A
- = case
- con2tag_Foo#_r101
- a_r11y
- of
- a#_r11G -> case
- con2tag_Foo#_r101
- b_r11A
- of
- b#_r11I -> if a#_r11G GHC.==#{-79,p-}{I} b#_r11I then
- PrelBase.EQ{-rbX,p-}{i}
- else
- if a#_r11G GHC.<#{-7b,p-}{I} b#_r11I then
- PrelBase.LT{-rbY,p-}{i}
- else
- PrelBase.GT{-rbZ,p-}{i}
- where
- {- nonrec -}
- AbsBinds
- [t{-a15e-}, t{-a15g-}]
- []
- [([t{-a15e-}, t{-a15g-}], cmp_eq_r11C, cmp_eq_a154)]
- cmp_eq_a154
- _ _ = PrelBase.EQ{-rbX,p-}{i}
- {- nonrec -}
- AbsBinds [] [] [([], <_a19j, <_a15q)]
- <_a15q
- a_r10G b_r10I
- = case
- compare_a19q
- a_r10G b_r10I
- of
- PrelBase.LT{-rbY,p-}{i}
- -> PrelBase.True{-5E,p-}{i}
- PrelBase.EQ{-rbX,p-}{i}
- -> PrelBase.False{-58,p-}{i}
- PrelBase.GT{-rbZ,p-}{i}
- -> PrelBase.False{-58,p-}{i}
- AbsBinds [] [] [([], <=_a19i, <=_a15D)]
- <=_a15D
- a_r10P b_r10R
- = case
- compare_a19p
- a_r10P b_r10R
- of
- PrelBase.LT{-rbY,p-}{i}
- -> PrelBase.True{-5E,p-}{i}
- PrelBase.EQ{-rbX,p-}{i}
- -> PrelBase.True{-5E,p-}{i}
- PrelBase.GT{-rbZ,p-}{i}
- -> PrelBase.False{-58,p-}{i}
- AbsBinds [] [] [([], >=_a19h, >=_a15Q)]
- >=_a15Q
- a_r10Y b_r110
- = case
- compare_a19o
- a_r10Y b_r110
- of
- PrelBase.LT{-rbY,p-}{i}
- -> PrelBase.False{-58,p-}{i}
- PrelBase.EQ{-rbX,p-}{i}
- -> PrelBase.True{-5E,p-}{i}
- PrelBase.GT{-rbZ,p-}{i}
- -> PrelBase.True{-5E,p-}{i}
- AbsBinds [] [] [([], >_a19g, >_a163)]
- >_a163
- a_r117 b_r119
- = case
- compare_a19n
- a_r117 b_r119
- of
- PrelBase.LT{-rbY,p-}{i}
- -> PrelBase.False{-58,p-}{i}
- PrelBase.EQ{-rbX,p-}{i}
- -> PrelBase.False{-58,p-}{i}
- PrelBase.GT{-rbZ,p-}{i}
- -> PrelBase.True{-5E,p-}{i}
- AbsBinds [] [] [([], max_a19f, max_a16g)]
- max_a16g
- a_r11g b_r11i
- = case
- compare_a19m
- a_r11g b_r11i
- of
- PrelBase.LT{-rbY,p-}{i}
- -> b_r11i
- PrelBase.EQ{-rbX,p-}{i}
- -> a_r11g
- PrelBase.GT{-rbZ,p-}{i}
- -> a_r11g
- AbsBinds [] [] [([], min_a19e, min_a16v)]
- min_a16v
- a_r11p b_r11r
- = case
- compare_a19l
- a_r11p b_r11r
- of
- PrelBase.LT{-rbY,p-}{i}
- -> a_r11p
- PrelBase.EQ{-rbX,p-}{i}
- -> b_r11r
- PrelBase.GT{-rbZ,p-}{i}
- -> b_r11r
- d.Ord_a14X =
- ({-dict-}
- [d.Eq_a16H]
- [compare_a19k, <_a19j, <=_a19i, >=_a19h, >_a19g, max_a19f, min_a19e])
-{- rec -}
-AbsBinds [] [] [([], $d5{-r19r,x-}, d.Show_a16O)]
- showsPrec_a19u =
- showsPrec_a19t
- AbsBinds [] [] [([], showsPrec_a19t, showsPrec_a16R)]
- showsPrec_a16R
- a_r11N Foo1{-r4t,x-}{i}
- = PrelBase.showString{-rjF,p-}
- "Foo1"
- showsPrec_a16R
- a_r11Q Foo2{-r4s,x-}{i}
- = PrelBase.showString{-rjF,p-}
- "Foo2"
- showsPrec_a16R
- a_r11T Foo3{-r4u,x-}{i}
- = PrelBase.showString{-rjF,p-}
- "Foo3"
- showsPrec_a16R
- a_r11W Foo4{-r4v,x-}{i}
- = PrelBase.showString{-rjF,p-}
- "Foo4"
- showsPrec_a16R
- a_r11Z Foo5{-r4w,x-}{i}
- = PrelBase.showString{-rjF,p-}
- "Foo5"
- showsPrec_a16R
- a_r122 Foo6{-r4x,x-}{i}
- = PrelBase.showString{-rjF,p-}
- "Foo6"
- showsPrec_a16R
- a_r125 Foo7{-r4y,x-}{i}
- = PrelBase.showString{-rjF,p-}
- "Foo7"
- showsPrec_a16R
- a_r128 Foo8{-r4z,x-}{i}
- = PrelBase.showString{-rjF,p-}
- "Foo8"
- AbsBinds [] [] [([], showList_a19s, showList_a173)]
- showList_a173
- = PrelBase.showList__{-r4G,p-}
- Foo{-r4J,x-}
- showsPrec_a19u
- lit_a196
- d.Show_a16O =
- ({-dict-} [] [showsPrec_a19t, showList_a19s])
-{- rec -}
-AbsBinds [] [] [([], $d6{-r19v,x-}, d.Ix_a17k)]
- d.Show_a18G =
- $d5{-r19r,x-}
- d.Ord_a18H =
- $d4{-r19d,x-}
- inRange_a19z =
- inRange_a19w
- AbsBinds [] [] [([], range_a19y, range_a17n)]
- range_a17n
- (a_r12g, b_r12h)
- = case
- con2tag_Foo#_r101
- a_r12g
- of
- a#_r12j -> case
- con2tag_Foo#_r101
- b_r12h
- of
- b#_r12l -> map_a195
- [PrelBase.Int{-3g,p-}, Foo{-r4J,x-}]
- tag2con_Foo#_rZZ
- enumFromTo_a194
- PrelBase.I#{-5b,p-}{i}
- a#_r12j
- PrelBase.I#{-5b,p-}{i}
- b#_r12l
- AbsBinds [] [] [([], index_a19x, index_a17V)]
- index_a17V
- (c_r12p@(a_r12q, b_r12r)) d_r12t
- = if inRange_a19z
- c_r12p d_r12t then
- case
- con2tag_Foo#_r101
- a_r12q
- of
- a#_r12v -> case
- con2tag_Foo#_r101
- d_r12t
- of
- d#_r12x -> case d#_r12x GHC.-#{-7E,p-}{I} a#_r12v of
- c_r12z -> PrelBase.I#{-5b,p-}{i}
- c_r12z
- else
- IOBase.error{-87,p-}
- PrelBase.Int{-3g,p-}
- "Ix.Foo.index: out of range\n"
- AbsBinds [] [] [([], inRange_a19w, inRange_a18o)]
- inRange_a18o
- (a_r12D, b_r12E) c_r12G
- = case
- con2tag_Foo#_r101
- a_r12D
- of
- a#_r12I -> case
- con2tag_Foo#_r101
- b_r12E
- of
- b#_r12K -> case
- con2tag_Foo#_r101
- c_r12G
- of
- c#_r12M -> if c#_r12M
- GHC.>=#{-78,p-}{I} a#_r12I then
- c#_r12M
- GHC.<=#{-7c,p-}{I} b#_r12K
- else
- PrelBase.False{-58,p-}{i}
- d.Ix_a17k =
- ({-dict-}
- [d.Show_a18G, d.Ord_a18H]
- [range_a19y, index_a19x, inRange_a19w])
-{- nonrec -}
-d.Num_a18U =
- PrelBase.$d3{-rdj,p-}
-fromInt_a197 =
- PrelBase.fromInt{-8R,p-}
- PrelBase.Int{-3g,p-}
- d.Num_a18U
-lit_a196 =
- fromInt_a197
- PrelBase.I#{-5b,p-}{i}
- 0#
-d.Functor_a18X =
- PrelBase.$d25{-rde,p-}
-map_a195 =
- PrelBase.map{-reK,p-}
- PrelBase.[]{-3j,p-}
- d.Functor_a18X
-d.Enum_a190 =
- PrelBase.$d5{-rdF,p-}
-enumFromTo_a194 =
- PrelBase.enumFromTo{-8W,p-}
- PrelBase.Int{-3g,p-}
- d.Enum_a190
-{- nonrec -}
-AbsBinds [] [] [([], con2tag_Foo#_r101, con2tag_Foo#_a141)]
- con2tag_Foo#_a141
- Foo1{-r4t,x-}{i}
- = 0#
- con2tag_Foo#_a141
- Foo2{-r4s,x-}{i}
- = 1#
- con2tag_Foo#_a141
- Foo3{-r4u,x-}{i}
- = 2#
- con2tag_Foo#_a141
- Foo4{-r4v,x-}{i}
- = 3#
- con2tag_Foo#_a141
- Foo5{-r4w,x-}{i}
- = 4#
- con2tag_Foo#_a141
- Foo6{-r4x,x-}{i}
- = 5#
- con2tag_Foo#_a141
- Foo7{-r4y,x-}{i}
- = 6#
- con2tag_Foo#_a141
- Foo8{-r4z,x-}{i}
- = 7#
-{- nonrec -}
-{- nonrec -}
-AbsBinds [] [] [([], maxtag_Foo#_r100, maxtag_Foo#_a145)]
- maxtag_Foo#_a145
- = PrelBase.I#{-5b,p-}{i}
- 7#
-{- nonrec -}
-{- nonrec -}
-AbsBinds [] [] [([], tag2con_Foo#_rZZ, tag2con_Foo#_a149)]
- tag2con_Foo#_a149
- (PrelBase.I#{-5b,p-}{i} 0#)
- = Foo1{-r4t,x-}{i}
- tag2con_Foo#_a149
- (PrelBase.I#{-5b,p-}{i} 1#)
- = Foo2{-r4s,x-}{i}
- tag2con_Foo#_a149
- (PrelBase.I#{-5b,p-}{i} 2#)
- = Foo3{-r4u,x-}{i}
- tag2con_Foo#_a149
- (PrelBase.I#{-5b,p-}{i} 3#)
- = Foo4{-r4v,x-}{i}
- tag2con_Foo#_a149
- (PrelBase.I#{-5b,p-}{i} 4#)
- = Foo5{-r4w,x-}{i}
- tag2con_Foo#_a149
- (PrelBase.I#{-5b,p-}{i} 5#)
- = Foo6{-r4x,x-}{i}
- tag2con_Foo#_a149
- (PrelBase.I#{-5b,p-}{i} 6#)
- = Foo7{-r4y,x-}{i}
- tag2con_Foo#_a149
- (PrelBase.I#{-5b,p-}{i} 7#)
- = Foo8{-r4z,x-}{i}
- tag2con_Foo#_a149
- _ = IOBase.error{-87,p-}
- Foo{-r4J,x-}
- "Urk! in TcGenDeriv"
-{- nonrec -}
-
-NOTE: Simplifier still going after 4 iterations; bailing out.
-ghc: module version changed to 1; reason: no old .hi file
+++ /dev/null
---!!! buggy deriving with function type, reported by Sigbjorn Finne
-module ShouldSucceed where
-
-data Foo = Foo (Int -> Int) deriving Eq
+++ /dev/null
-
-drv007.hs:2: No instance for class
- `PrelBase.Eq'
- at type
- `PrelBase.Int -> PrelBase.Int'
-
-drv007.hs:4: No instance for:
- `PrelBase.Eq (PrelBase.Int -> PrelBase.Int)'
- drv007.hs:4:
- at a use of an overloaded identifier: `PrelBase.=='
-
-
-Compilation had errors