Haskell.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

ghc-tickets

Thread Start a new thread
Download
Threads by month
  • ----- 2025 -----
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2015 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2014 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2013 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
ghc-tickets@haskell.org

August 2016

  • 2 participants
  • 1132 discussions
[GHC] #12408: "ghc: panic! (the 'impossible' happened)" only when compiled with "-O"
by GHC 22 Aug '16

22 Aug '16
#12408: "ghc: panic! (the 'impossible' happened)" only when compiled with "-O" -------------------------------------+------------------------------------- Reporter: clinton | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Compile-time Unknown/Multiple | crash Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- On Debian GNU/Linux x86, GHC 8.0.1 crashes compiling the attached code, but only when "-O1" is given. Without optimization, it compiles fine. {{{#!hs {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} module Main where import Prelude hiding ( (.) , (+) , (*) ) import qualified Prelude main :: IO () main = return () x :: Int x = 42 f a b c = (c * (a + b)) == ((c * a) + (c * b)) g = f x x x newtype Sum a = Sum { getSum :: a } newtype Product a = Product { getProduct :: a } type family CatParam t :: * class Semigroupoid p where type CatSrc p t :: * type CatDest p t :: * type CatT p a b :: * (.) :: ( p ~ CatParam catAB, p ~ CatParam catBC, p ~ CatParam catAC, a ~ CatSrc p catAB, b ~ CatSrc p catBC, a ~ CatSrc p catAC, b ~ CatDest p catAB, c ~ CatDest p catBC, c ~ CatDest p catAC, catAB ~ CatT p a b, catBC ~ CatT p b c, catAC ~ CatT p a c ) => catBC -> catAB -> catAC data BasicSumSemigroup (t :: *) :: * type instance CatParam (Sum Int) = BasicSumSemigroup Int instance (Num t) => Semigroupoid (BasicSumSemigroup t) where type CatSrc (BasicSumSemigroup _) _ = () type CatDest (BasicSumSemigroup _) _ = () type CatT (BasicSumSemigroup t) _ _ = Sum t (Sum x) . (Sum y) = Sum ((Prelude.+) x y) data BasicProductSemigroup (t :: *) :: * type instance CatParam (Product Int) = BasicProductSemigroup Int instance (Num t) => Semigroupoid (BasicProductSemigroup t) where type CatSrc (BasicProductSemigroup _) _ = () type CatDest (BasicProductSemigroup _) _ = () type CatT (BasicProductSemigroup t) _ _ = Product t (Product x) . (Product y) = Product ((Prelude.*) x y) type family RingParamFromSum p :: * type family RingParamFromProduct p :: * class NearRingWithoutId t where type SumP t type ProdP t type LeftDistrib t origLeftCat rightArg type RightDistrib t origLeftCat leftArg (+) :: ( t ~ RingParamFromSum sumP, Semigroupoid sumP, p ~ sumP, p ~ CatParam catAB, p ~ CatParam catBC, p ~ CatParam catAC, a ~ CatSrc p catAB, b ~ CatSrc p catBC, a ~ CatSrc p catAC, b ~ CatDest p catAB, c ~ CatDest p catBC, c ~ CatDest p catAC, catAB ~ CatT p a b, catBC ~ CatT p b c, catAC ~ CatT p a c, catAB ~ Sum noSumCatAB, catBC ~ Sum noSumCatBC, catAC ~ Sum noSumCatAC ) => noSumCatBC -> noSumCatAB -> noSumCatAC (+) x y = getSum ((Sum x) . (Sum y)) (*) :: ( t ~ RingParamFromProduct prodP, Semigroupoid prodP, p ~ prodP, p ~ CatParam catAB, p ~ CatParam catBC, p ~ CatParam catAC, a ~ CatSrc p catAB, b ~ CatSrc p catBC, a ~ CatSrc p catAC, b ~ CatDest p catAB, c ~ CatDest p catBC, c ~ CatDest p catAC, catAB ~ CatT p a b, catBC ~ CatT p b c, catAC ~ CatT p a c, catAB ~ Product noProdCatAB, catBC ~ Product noProdCatBC, catAC ~ Product noProdCatAC, sumCatAB ~ Sum noProdCatAB, sumCatBC ~ Sum noProdCatBC, sumCatAC ~ Sum noProdCatAC, ps ~ sumP, ps ~ CatParam sumCatAB, ps ~ CatParam sumCatBC, ps ~ CatParam sumCatAC, sumABSrc ~ CatSrc p sumCatAB, sumBCSrc ~ CatSrc p sumCatBC, sumACSrc ~ CatSrc p sumCatAC, sumABDest ~ CatDest p sumCatAB, sumBCDest ~ CatDest p sumCatBC, sumACDest ~ CatDest p sumCatAC, sumACSrc ~ LeftDistrib t sumBCSrc noProdCatAB, sumACSrc ~ RightDistrib t sumACSrc noProdCatBC, sumACDest ~ LeftDistrib t sumBCDest noProdCatAB, sumACDest ~ RightDistrib t sumACDest noProdCatBC ) => noProdCatBC -> noProdCatAB -> noProdCatAC (*) x y = getProduct ((Product x) . (Product y)) data TestInt type instance RingParamFromSum (BasicSumSemigroup Int) = TestInt type instance RingParamFromProduct (BasicProductSemigroup Int) = TestInt instance NearRingWithoutId TestInt where type SumP TestInt = BasicSumSemigroup Int type ProdP TestInt = BasicProductSemigroup Int type LeftDistrib TestInt _ _ = () type RightDistrib TestInt _ _ = () }}} The following error results: {{{ ghc: panic! (the 'impossible' happened) (GHC version 8.0.1 for x86_64-unknown-linux): Template variable unbound in rewrite rule Variable: cobox_s3PM Rule "SPEC f @ Int @ Int @ Int @ Int @ Int @ Int @ Int" Rule bndrs: [cobox_s3PM, cobox_s3PN, cobox_s3PO, cobox_s3PP, cobox_s3PQ, cobox_s3PR, cobox_s3PS, cobox_s3PT, cobox_s3PU, cobox_s3PV, cobox_s3PW, cobox_s3PX, cobox_s3PY, cobox_s3PZ, cobox_s3Q0, cobox_s3Q1, cobox_s3Q2, cobox_s3Q3, cobox_s3Q4, cobox_s3Q5, cobox_s3Q6, cobox_s3Q7, cobox_s3Q8, cobox_s3Q9, cobox_s3Qa, cobox_s3Qb, cobox_s3Qc, cobox_s3Qd, cobox_s3Qe, cobox_s3Qf, cobox_s3Qg, cobox_s3Qh, cobox_s3Qi, cobox_s3Qj, cobox_s3Qk, cobox_s3Ql, cobox_s3Qm, cobox_s3Qn, cobox_s3Qo, cobox_s3Qp, cobox_s3Qq, cobox_s3Qr, cobox_s3Qs, cobox_s3Qt, cobox_s3Qu, cobox_s3Qv, cobox_s3Qw, cobox_s3Qx, cobox_s3Qy, cobox_s3Qz, cobox_s3QA, cobox_s3QB, $dSemigroupoid_X3SC, $dSemigroupoid_X3SE, $dNearRingWithoutId_s3QE, $dNearRingWithoutId_s3QF, $dEq_s3QG] LHS args: [TYPE: Int, TYPE: Int, TYPE: Int, TYPE: Int, TYPE: Int, TYPE: Int, TYPE: Int, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: <CatDest (CatParam (Sum Int)) (Sum Int)>_N, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: cobox_s3PP, CO: cobox_s3PQ, CO: cobox_s3PR, CO: cobox_s3PS, CO: cobox_s3PT, CO: cobox_s3PU, CO: cobox_s3PV, CO: cobox_s3PW, CO: cobox_s3PX, CO: cobox_s3PY, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: cobox_s3Q0, CO: <CatParam (Product Int)>_N, CO: cobox_s3Q2, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: <CatSrc (CatParam (Product Int)) (Product Int)>_N, CO: <CatParam (Product Int)>_N, CO: cobox_s3Q6, CO: cobox_s3Q7, CO: cobox_s3Q8, CO: cobox_s3Q9, CO: cobox_s3Qa, CO: cobox_s3Qb, CO: cobox_s3Qc, CO: cobox_s3Qd, CO: cobox_s3Qe, CO: <CatParam (Product Int)>_N, CO: cobox_s3Qg, CO: <CatSrc (CatParam (Product Int)) (Product Int)>_N, CO: <CatParam (Product Int)>_N, CO: <CatParam (Sum Int)>_N, CO: cobox_s3Qk, CO: cobox_s3Ql, CO: cobox_s3Qm, CO: <CatDest (CatParam (Sum Int)) (Sum Int)>_N, CO: <CatSrc (CatParam (Sum Int)) (Sum Int)>_N, CO: <CatParam (Sum Int)>_N, CO: <CatParam (Sum Int)>_N, CO: <CatParam (Sum Int)>_N, CO: cobox_s3Qs, CO: <CatParam (Sum Int)>_N, CO: cobox_s3Qu, CO: <CatSrc (CatParam (Sum Int)) (Sum Int)>_N, CO: <CatParam (Sum Int)>_N, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: <CatParam (Product Int)>_N, CO: cobox_s3Qz, CO: <CatSrc (CatParam (Product Int)) (Product Int)>_N, CO: <CatParam (Product Int)>_N, $dSemigroupoid_X3SC, $dSemigroupoid_X3SE, $dNearRingWithoutId_s3QE, $dNearRingWithoutId_s3QF, $dEq_s3QG] Actual args: [TYPE: Int, TYPE: Int, TYPE: Int, TYPE: Int, TYPE: Int, TYPE: Int, TYPE: Int, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: <CatDest (CatParam (Sum Int)) (Sum Int)>_N, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: (CatT D:R:CatParamProduct[0] ((CatSrc D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Product Int>_N) ((CatDest D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Product Int>_N))_N ; D:R:CatTBasicProductSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: (CatT D:R:CatParamProduct[0] ((CatSrc D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Product Int>_N) ((CatDest D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Product Int>_N))_N ; D:R:CatTBasicProductSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: (CatT D:R:CatParamSum[0] ((CatSrc D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatSrcBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N) ((CatDest D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N))_N ; D:R:CatTBasicSumSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: (CatT D:R:CatParamSum[0] ((CatSrc D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatSrcBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N) ((CatDest D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N))_N ; D:R:CatTBasicSumSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: (CatT D:R:CatParamProduct[0] ((CatSrc D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Product Int>_N) ((CatDest D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Product Int>_N))_N ; D:R:CatTBasicProductSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: (CatSrc D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatSrcBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N ; Sym (D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatDest (Sym D:R:CatParamSum[0]) <Sum Int>_N)_N, CO: (RightDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((LeftDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((CatDest D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) <Int>_N)_N ; D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) <Int>_N)_N ; D:R:RightDistribTestInt__1[0] <()>_N <Int>_N ; Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatDest (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N, CO: (CatDest D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N ; Sym (D:R:RightDistribTestInt__1[0] <()>_N <Int>_N) ; (RightDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatDest (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N) <Int>_N)_N, CO: (RightDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((LeftDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((CatSrc D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) <Int>_N)_N ; D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) <Int>_N)_N ; D:R:RightDistribTestInt__1[0] <()>_N <Int>_N ; Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatSrc (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N, CO: (CatSrc D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N ; Sym (D:R:RightDistribTestInt__1[0] <()>_N <Int>_N) ; (RightDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatSrc (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N) <Int>_N)_N, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: (CatSrc D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Product Int>_N ; Sym (D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Product Int>_N) ; (CatDest (Sym D:R:CatParamProduct[0]) <Product Int>_N)_N, CO: <CatParam (Product Int)>_N, CO: (CatT D:R:CatParamProduct[0] ((CatSrc D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Product Int>_N) ((CatDest D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Product Int>_N))_N ; D:R:CatTBasicProductSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: <CatSrc (CatParam (Product Int)) (Product Int)>_N, CO: <CatParam (Product Int)>_N, CO: (RightDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((LeftDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((CatDest D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) <Int>_N)_N ; D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) <Int>_N)_N ; D:R:RightDistribTestInt__1[0] <()>_N <Int>_N ; Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatDest (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N, CO: (CatDest D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N ; Sym (D:R:RightDistribTestInt__1[0] <()>_N <Int>_N) ; (RightDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatDest (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N) <Int>_N)_N, CO: (RightDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((LeftDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((CatSrc D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) <Int>_N)_N ; D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) <Int>_N)_N ; D:R:RightDistribTestInt__1[0] <()>_N <Int>_N ; Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatSrc (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N, CO: (CatSrc D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N ; Sym (D:R:RightDistribTestInt__1[0] <()>_N <Int>_N) ; (RightDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatSrc (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N) <Int>_N)_N, CO: (RightDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((LeftDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((CatDest D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) <Int>_N)_N ; D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) <Int>_N)_N ; D:R:RightDistribTestInt__1[0] <()>_N <Int>_N ; Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatDest (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N, CO: (CatDest D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N ; Sym (D:R:RightDistribTestInt__1[0] <()>_N <Int>_N) ; (RightDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatDest (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N) <Int>_N)_N, CO: (RightDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((LeftDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((CatSrc D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) <Int>_N)_N ; D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) <Int>_N)_N ; D:R:RightDistribTestInt__1[0] <()>_N <Int>_N ; Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatSrc (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N, CO: (CatSrc D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N ; Sym (D:R:RightDistribTestInt__1[0] <()>_N <Int>_N) ; (RightDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatSrc (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N) <Int>_N)_N, CO: (CatT D:R:CatParamProduct[0] ((CatDest D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Product Int>_N) ((CatDest D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Product Int>_N))_N ; D:R:CatTBasicProductSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: <CatParam (Product Int)>_N, CO: (CatT D:R:CatParamProduct[0] ((CatSrc D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Product Int>_N) ((CatDest D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Product Int>_N))_N ; D:R:CatTBasicProductSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: <CatSrc (CatParam (Product Int)) (Product Int)>_N, CO: <CatParam (Product Int)>_N, CO: <CatParam (Sum Int)>_N, CO: (CatT D:R:CatParamSum[0] ((CatDest D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N) ((CatDest D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N))_N ; D:R:CatTBasicSumSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: (CatSrc D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatSrcBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N ; Sym (D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatDest (Sym D:R:CatParamSum[0]) <Sum Int>_N)_N, CO: (CatT D:R:CatParamSum[0] ((CatSrc D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatSrcBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N) ((CatDest D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N))_N ; D:R:CatTBasicSumSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: <CatDest (CatParam (Sum Int)) (Sum Int)>_N, CO: <CatSrc (CatParam (Sum Int)) (Sum Int)>_N, CO: <CatParam (Sum Int)>_N, CO: <CatParam (Sum Int)>_N, CO: <CatParam (Sum Int)>_N, CO: (CatT D:R:CatParamSum[0] ((CatDest D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N) ((CatDest D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N))_N ; D:R:CatTBasicSumSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: <CatParam (Sum Int)>_N, CO: (CatT D:R:CatParamSum[0] ((CatSrc D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatSrcBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N) ((CatDest D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N))_N ; D:R:CatTBasicSumSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: <CatSrc (CatParam (Sum Int)) (Sum Int)>_N, CO: <CatParam (Sum Int)>_N, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: <CatParam (Product Int)>_N, CO: (CatT D:R:CatParamProduct[0] ((CatSrc D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Product Int>_N) ((CatDest D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Product Int>_N))_N ; D:R:CatTBasicProductSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: <CatSrc (CatParam (Product Int)) (Product Int)>_N, CO: <CatParam (Product Int)>_N, ($c._a32V @ Int $fNumInt) `cast` (Sym (N:Semigroupoid[0] <BasicSumSemigroup Int>_N) ; (Semigroupoid (Sym D:R:CatParamSum[0]))_R :: ((forall catAB_awI[sk] catBC_awJ[sk] catAC_awK[sk] a_awL[sk] b_awM[sk] c_awN[sk]. ((BasicSumSemigroup Int :: *) ~ (CatParam catAB_awI[sk] :: *), (BasicSumSemigroup Int :: *) ~ (CatParam catBC_awJ[sk] :: *), (BasicSumSemigroup Int :: *) ~ (CatParam catAC_awK[sk] :: *), (a_awL[sk] :: *) ~ (CatSrc (BasicSumSemigroup Int) catAB_awI[sk] :: *), (b_awM[sk] :: *) ~ (CatSrc (BasicSumSemigroup Int) catBC_awJ[sk] :: *), (a_awL[sk] :: *) ~ (CatSrc (BasicSumSemigroup Int) catAC_awK[sk] :: *), (b_awM[sk] :: *) ~ (CatDest (BasicSumSemigroup Int) catAB_awI[sk] :: *), (c_awN[sk] :: *) ~ (CatDest (BasicSumSemigroup Int) catBC_awJ[sk] :: *), (c_awN[sk] :: *) ~ (CatDest (BasicSumSemigroup Int) catAC_awK[sk] :: *), (catAB_awI[sk] :: *) ~ (CatT (BasicSumSemigroup Int) a_awL[sk] b_awM[sk] :: *), (catBC_awJ[sk] :: *) ~ (CatT (BasicSumSemigroup Int) b_awM[sk] c_awN[sk] :: *), (catAC_awK[sk] :: *) ~ (CatT (BasicSumSemigroup Int) a_awL[sk] c_awN[sk] :: *)) => catBC_awJ[sk] -> catAB_awI[sk] -> catAC_awK[sk]) :: *) ~R# (Semigroupoid (CatParam (Sum Int)) :: Constraint)), ($c._a32m @ Int $fNumInt) `cast` (Sym (N:Semigroupoid[0] <BasicProductSemigroup Int>_N) ; (Semigroupoid (Sym D:R:CatParamProduct[0]))_R :: ((forall catAB_awI[sk] catBC_awJ[sk] catAC_awK[sk] a_awL[sk] b_awM[sk] c_awN[sk]. ((BasicProductSemigroup Int :: *) ~ (CatParam catAB_awI[sk] :: *), (BasicProductSemigroup Int :: *) ~ (CatParam catBC_awJ[sk] :: *), (BasicProductSemigroup Int :: *) ~ (CatParam catAC_awK[sk] :: *), (a_awL[sk] :: *) ~ (CatSrc (BasicProductSemigroup Int) catAB_awI[sk] :: *), (b_awM[sk] :: *) ~ (CatSrc (BasicProductSemigroup Int) catBC_awJ[sk] :: *), (a_awL[sk] :: *) ~ (CatSrc (BasicProductSemigroup Int) catAC_awK[sk] :: *), (b_awM[sk] :: *) ~ (CatDest (BasicProductSemigroup Int) catAB_awI[sk] :: *), (c_awN[sk] :: *) ~ (CatDest (BasicProductSemigroup Int) catBC_awJ[sk] :: *), (c_awN[sk] :: *) ~ (CatDest (BasicProductSemigroup Int) catAC_awK[sk] :: *), (catAB_awI[sk] :: *) ~ (CatT (BasicProductSemigroup Int) a_awL[sk] b_awM[sk] :: *), (catBC_awJ[sk] :: *) ~ (CatT (BasicProductSemigroup Int) b_awM[sk] c_awN[sk] :: *), (catAC_awK[sk] :: *) ~ (CatT (BasicProductSemigroup Int) a_awL[sk] c_awN[sk] :: *)) => catBC_awJ[sk] -> catAB_awI[sk] -> catAC_awK[sk]) :: *) ~R# (Semigroupoid (CatParam (Product Int)) :: Constraint)), $fNearRingWithoutIdTestInt `cast` ((NearRingWithoutId (Sym D:R:RingParamFromSumBasicSumSemigroup[0] ; (RingParamFromSum (Sym D:R:CatParamSum[0]))_N))_R :: (NearRingWithoutId TestInt :: Constraint) ~R# (NearRingWithoutId (RingParamFromSum (CatParam (Sum Int))) :: Constraint)), $fNearRingWithoutIdTestInt `cast` ((NearRingWithoutId (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N))_R :: (NearRingWithoutId TestInt :: Constraint) ~R# (NearRingWithoutId (RingParamFromProduct (CatParam (Product Int))) :: Constraint)), $fEqInt, x, x, x] Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12408> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
1 5
0 0
Re: [GHC] #1257: Bytecode generator can't handle unboxed tuples
by GHC 21 Aug '16

21 Aug '16
#1257: Bytecode generator can't handle unboxed tuples -------------------------------------+------------------------------------- Reporter: igloo | Owner: Type: bug | Status: closed Priority: high | Milestone: 7.4.1 Component: GHCi | Version: 6.6 Resolution: wontfix | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: dsrun014 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by dobenour): I can think of a few options - Auto-generate a bunch of return frames for different length tuples. Doesn't work because unboxed tuples can store unboxed data, so we get an exponential code size blowup. - Write a little interpreter (directly in Cmm) that looks at metadata in stack frame and does the appropriate operations. This one should work. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/1257#comment:12> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
1 0
0 0
[GHC] #12515: Pattern synonyms with non-conid/consym names give poor error messages
by GHC 21 Aug '16

21 Aug '16
#12515: Pattern synonyms with non-conid/consym names give poor error messages -------------------------------------+------------------------------------- Reporter: pkmx | Owner: Type: feature | Status: new request | Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Incorrect Unknown/Multiple | warning at compile-time Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- The following: {{{#!hs {-# LANGUAGE PatternSynonyms #-} -- Correct: pattern P = () pattern p = () }}} gives a rather unhelpful error message: {{{ parse error on input ‘=’ Perhaps you need a 'let' in a 'do' block? e.g. 'let x = 5' instead of 'x = 5' }}} Ideally, it should hint that the name of pattern should follow constructor identifier rules. ---- In the same vein, the following: {{{#!hs {-# LANGUAGE PatternSynonyms #-} -- Correct: pattern (:+) = () pattern (+) = () }}} currently gives: {{{ error: parse error on input ‘+’ }}} It should hint that the operator should begin with a {{{:}}}. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12515> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
1 0
0 0
[GHC] #12510: GHC.Prim.~# shows up unexpectedly in a pattern synonym type
by GHC 21 Aug '16

21 Aug '16
#12510: GHC.Prim.~# shows up unexpectedly in a pattern synonym type -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- When I load {{{ data T a where MkT :: Bool -> T Bool pattern P x <- MkT x }}} into GHCi and ask `:info P`, I get {{{ pattern P :: () => t GHC.Prim.~# Bool => Bool -> T t }}} That should say `t ~ Bool` without `-fprint-equality-relations`. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12510> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
1 2
0 0
[GHC] #12465: Evil idea: Allow empty record field update syntax for types.
by GHC 21 Aug '16

21 Aug '16
#12465: Evil idea: Allow empty record field update syntax for types. -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: feature | Status: new request | Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Use case: Visible type application. I often work with constructors with many arguments, then I want to instantiate type variables with them: {{{#!hs show @(Vector _ _) :: Show a => Vector n a -> String -- Type arguments reversed, see https://github.com/ekmett/distributive/pull/18 cotraverse @_ @(Vector _) :: (NATTY n, Functor f) => (f a -> b) -> (f (Vector n a) -> Vector n a') fmap @(Bazaar _ _ _) :: (t -> t') -> (Bazaar p a b t -> Bazaar p a b t') show @(Magma _ _ _ _) :: (Show a, Show i) => Magma i t b a -> String }}} This makes no sense since types have nothing to do with record or updates thereof but that syntax is often used to avoid parentheses and unneeded wildcard arguments: {{{#!hs isBar (Bar _ _ _ _ _) = True -- ===> isBar Bar{} = True }}} This also means you don't need to worry about the kind of your constructor wrt the type (class) variable it instantiates. ---- Thus the proposal is to allow: {{{#!hs show @Vector{} :: Show a => Vector n a -> String cotraverse @_ @Vector{} :: (NATTY n, Functor f) => (f a -> b) -> (f (Vector n a) -> Vector n a') fmap @Bazaar{} :: (t -> t') -> (Bazaar p a b t -> Bazaar p a b t') show @Magma{} :: (Show a, Show i) => Magma i t b a -> String }}} ---- This would save quite a few keystrokes in my daily coding but more importantly it saves cognitive load but I expect skepticism, especially since GHC would have to determine whether to interpret `show @Vector{}` to `show @Vector`, `show @(Vector _n)` or `show @(Vector _n _a)`. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12465> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
1 4
0 0
[GHC] #12508: Show evaluation step-by-step in GHCi
by GHC 21 Aug '16

21 Aug '16
#12508: Show evaluation step-by-step in GHCi -------------------------------------+------------------------------------- Reporter: Hi-Angel | Owner: Type: feature | Status: new request | Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Keywords: interactive | Operating System: Unknown/Multiple evaluation debugging | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- The ability see every evaluation step for executing a particular code in ghci is needed. Earlier that could have [[http://stackoverflow.com/a/554391/2388257|done in HAT]], or ghc-vis. But as of today, HAT doesn't compile even with stack. And, at least personally for me, neither ghc-vis could be installed. I want to point out that the funcionality is **very** important for the language. Without that ''(i.e. as it is now)'' it is impossible for newcomers to see how a particular construction going to be evaluated, how much memory it going to take. Nowadays newcomers have to deal with memory issues post-mortem: an app takes all system memory, dies, then one build everything for profiling, and start playing a Battleship with the allocation graph; which going to be a hard game, unless you're experienced enough to not even allow that to happen most of the times. However, if there was a way to execute functions in GHCI, looking the evaluation step-by-step, days of hard debugging would turn into a few hours of executing a couple of functions in ghci. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12508> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
1 0
0 0
Re: [GHC] #2893: Implement "Quantified contexts" proposal
by GHC 20 Aug '16

20 Aug '16
#2893: Implement "Quantified contexts" proposal -------------------------------------+------------------------------------- Reporter: porges | Owner: Type: feature request | Status: new Priority: normal | Milestone: ⊥ Component: Compiler | Version: 6.10.1 Resolution: | Keywords: proposal Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Iceland_jack, there are two problems with using typeclasses like these to "solve" this problem: 1. They're based on explicit `Dict` values. As a result, using them requires lots of pattern matching and type variable scoping hullabaloo, which gets annoying pretty quickly. 2. What does it mean to automatically generate instances for `(:=>)`? Do we only generate instances that correspond to actual instance contexts? If so, then the following would typecheck, since there is an `instance () :=> Eq ()`: {{{#!hs ins :: () :- Eq () }}} But the following would //not// typecheck! {{{#!hs ins :: Eq () :- Eq () }}} Because there is no `instance Eq () => Eq ()` anywhere (and thus no `instance Eq () :=> Eq ()`), only `instance Eq ()`. But the implication `Eq () => Eq ()` should obviously hold. Does that mean we should also generate an `instance Eq () :=> Eq ()` automatically? But what about `(Eq (), Ord ()) => Eq ()`? `(Eq (), Ord (), Show ()) => Eq ()`? There is an extremely high number of contexts in which `Eq ()` holds, and generating every possible one of them would result in a combinatorial explosion. While those classes are neat tricks that can get you some of the functionality of `QuantifiedConstraints`/`ImplicationConstraints`, they don't go all the way. I really feel that some compiler smarts would make these features manageable. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/2893#comment:20> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
1 0
0 0
Re: [GHC] #2893: Implement "Quantified contexts" proposal
by GHC 20 Aug '16

20 Aug '16
#2893: Implement "Quantified contexts" proposal -------------------------------------+------------------------------------- Reporter: porges | Owner: Type: feature request | Status: new Priority: normal | Milestone: ⊥ Component: Compiler | Version: 6.10.1 Resolution: | Keywords: proposal Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): Has there been any discussion about GHC generating instances of [https://hackage.haskell.org/package/constraints-0.8/docs/Data- Constraint.html#t::-61--62- :=>] and [https://hackage.haskell.org/package/constraints-0.8/docs/Data- Constraint.html#t:Class Class]: {{{#!hs -- Given -- class Foo a => Bar a -- GHC should generate -- instance Class (Foo a) (Bar a) where -- cls :: Bar a :- Foo a -- cls = Sub Dict class Class b h | h -> b where cls :: h :- b }}} or [https://hackage.haskell.org/package/constraints-0.8/docs/Data- Constraint-Lifting.html#t:Lifting Lifting] {{{#!hs class Lifting p f where lifting :: p a :- p (f a) class Lifting2 p f where lifting2 :: p a :- Lifting p (f a) }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/2893#comment:19> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
1 0
0 0
Re: [GHC] #5927: A type-level "implies" constraint on Constraints
by GHC 20 Aug '16

20 Aug '16
#5927: A type-level "implies" constraint on Constraints -------------------------------------+------------------------------------- Reporter: illissius | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 7.4.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): Would this `Show` instance for [https://www.reddit.com/r/haskell/comments/2ag8h2/recovering_preconditions_f… Fmt] work with `ImplicationConstraints` (`(=>) :: Constraints -> Constraints -> Constraints`): {{{#!hs data Fmt :: (* -> Constraint) -> (* -> *) -> * -> * where Int :: p Int => Fmt p r Int (:&) :: (p a, p b, p (a,b)) => Fmt p r a -> Fmt p r b -> Fmt p r (a,b) Lift :: p (r a) => r a -> Fmt p r a instance (p => Show) => (Show (Fmt ctx r a) where show t = case t of Int -> "Int" l :& r -> show l ++ "&" ++ show r Lift r -> show r }}} A question on `QuantifiedConstraints` on this same example in ticket:2893#comment18. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/5927#comment:19> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
1 0
0 0
Re: [GHC] #2893: Implement "Quantified contexts" proposal
by GHC 20 Aug '16

20 Aug '16
#2893: Implement "Quantified contexts" proposal -------------------------------------+------------------------------------- Reporter: porges | Owner: Type: feature request | Status: new Priority: normal | Milestone: ⊥ Component: Compiler | Version: 6.10.1 Resolution: | Keywords: proposal Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): This functionality does my head in so bear with me. In the definition of [https://www.reddit.com/r/haskell/comments/2ag8h2/recovering_preconditions_f… Fmt], constraints of `(p a, p b, p (a, b))` are assumed for `:&` {{{#!hs data Fmt :: (* -> Constraint) -> (* -> *) -> * -> * where Int :: p Int => Fmt p r Int (:&) :: (p a, p b, p (a,b)) => Fmt p r a -> Fmt p r b -> Fmt p r (a,b) Lift :: p (r a) => r a -> Fmt p r a }}} `(p a, p b)` often implies `p (a, b)`, would this be captured by `QuantifiedConstraints`? {{{#!hs (:&) :: (p a, p b, forall xx yy. (p xx, p yy) => p (xx, yy)) => Fmt p r a -> Fmt p r b -> Fmt p r (a,b) }}} Does this even give us any additional power? Is this more or less powerful than the `:=>` class from [https://hackage.haskell.org/package/constraints constraints]? {{{#!hs class b :=> h | h -> b where ins :: b :- h instance (Eq a, Eq b) :=> Eq (a, b) where ins = Sub Dict instance (Ord a, Ord b) :=> Ord (a, b) where ins = Sub Dict instance (Show a, Show b) :=> Show (a, b) where ins = Sub Dict instance (Read a, Read b) :=> Read (a, b) where ins = Sub Dict instance (Bounded a, Bounded b) :=> Bounded (a, b) where ins = Sub Dict instance (Monoid a, Monoid b) :=> Monoid (a, b) where ins = Sub Dict ... }}} What if we assume that GHC generates instances of `:=>`? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/2893#comment:18> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • ...
  • 114
  • Older →

HyperKitty Powered by HyperKitty version 1.3.9.