[Haskell-cafe] Type error depending on scope of pattern matching
goodingm at gmail.com
Mon Aug 3 18:30:43 UTC 2015
Yeah, that seems to be the issue, but pattern matching with let doesn't seem
to work well with existentials, (GHC's brain explodes, and informs me to use
a case statement), so the fix there doesn't seem to work either :(
David Kraeutmann wrote
> I guess that pattern matching on (P f) removes the universal
> quantification you placed on it and it just defaults to Integer. Seems to
> be related to https://ghc.haskell.org/trac/ghc/ticket/10450.
> On 8/3/2015 6:43 PM, htebalaka wrote:
>> I managed to remove the Data.Reflection and Numeric.AD dependency
>> In this case, Reverse is just a newtyped Num with a phantom variable
>> Still, the same issue occurs. In one case the type gets defaulted to
>> if I try to pass a "forall a. Num a => t a -> a" to grad (which has type
>> "Num a, Traversable t => (forall s. t (Reverse s a) -> Reverse s a) -> t
>> -> t a"). Then it complains that Integer isn't Reverse s a, and won't
>> In the other where I try to specifically pass the a value with type
>> s. t (Reverse s a) -> Reverse s a" it think the type variable would
>> its scope, but I don't see why it should, or how to prevent that in the
>> "doesnt3" example.
>> I have no idea how to apply the fix used in the first two examples to the
>> later two, or why it should even be necessary.
>> View this message in context:
>> Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
>> Haskell-Cafe mailing list
> Haskell-Cafe mailing list
> smime.p7s (5K)
View this message in context: http://haskell.1045720.n5.nabble.com/Type-error-depending-on-scope-of-pattern-matching-tp5814762p5814912.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
More information about the Haskell-Cafe