Eike Scholz wrote:
mylength = synAttr listLength
$ *Main> :type synAttr
$ synAttr :: (Data b) => ((?stack::[Dyn]) => b -> a) -> Attr a
$ *Main> :type listLength
$ listLength :: (?stack::[Dyn]) => List -> Float
$ *Main> :type (synAttr listLength)
$ (synAttr listLength) :: Attr Float
$ *Main> :type mylength
$ mylength :: (?stack::[Dyn]) => Dyn -> Dyn -> [Dyn] -> Maybe Float
where
type Attr a = Dyn -> Dyn -> [Dyn]-> Maybe a
This may be a bug. But note that both interpretations are legitimate. One
way of applying synAttr to listLength is first to apply ?stack to
listLength, obtaining listLength' :: List -> Float and creating a
(?stack::[Dyn]) constraint on the application node, then specializing
listLength' to the type (?stack::a) => List -> Float, then passing that to
synAttr.
Again, I recommend that you not try to use implicit parameters.
-- Ben
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe