[Haskell-cafe] Type error depending on scope of pattern matching

Richard Eisenberg eir at cis.upenn.edu
Mon Aug 3 11:52:27 UTC 2015


And what's Reverse? I happen to know Reifies. But you'll also get a better (and more likely) answer if you reduce dependencies.

Richard

On Aug 1, 2015, at 8:05 PM, htebalaka <goodingm at gmail.com> wrote:

> Alright. The first two examples show the issue and a fix for it; the last two
> have the same issue but existential quantification prevents the fix.
> 
> grad has type "(Num a, Traversable t) => (forall s. Reifies s Tape => t
> (Reverse s a) -> Reverse s a) -> t a -> t a", and I'm basically trying to
> supply a function to it, either by being polymorphic over all Num (of which
> Reverse s a is an instance), or by providing the specific 'Reifies s Tape =>
> ...' type, neither of which are working.
> 
> 
> 
> 
> amindfv wrote
>> You'll probably get more responses if you paste the code inline.
>> 
>> tom
>> 
>> El Aug 1, 2015, a las 11:25, htebalaka <
> 
>> goodingm@
> 
>> > escribió:
>> 
>>> I'm curious if anyone can tell me why moving the pattern matching in
>>> these
>>> two examples makes it fail to compile, and what can be done to resolve
>>> the
>>> same issue in either of the latter two examples. As far as I can tell
>>> these
>>> should be equivalent. Unfortunately the solution used in the first
>>> examples
>>> won't work in the later ones due to the existential quantification. I've
>>> been asking on #haskell for a few days but haven't been able to find
>>> anyone
>>> who knows what the issue is.
>>> 
>>> Code is available here:  http://lpaste.net/137586
>>> <http://lpaste.net/137586>  
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
>>> http://haskell.1045720.n5.nabble.com/Type-error-depending-on-scope-of-pattern-matching-tp5814762.html
>>> Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
>>> _______________________________________________
>>> Haskell-Cafe mailing list
>>> 
> 
>> Haskell-Cafe@
> 
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>> _______________________________________________
>> Haskell-Cafe mailing list
> 
>> Haskell-Cafe@
> 
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> 
> 
> 
> 
> 
> --
> View this message in context: http://haskell.1045720.n5.nabble.com/Type-error-depending-on-scope-of-pattern-matching-tp5814762p5814778.html
> Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> 



More information about the Haskell-Cafe mailing list