-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Consider this example:
type Show a = Show { show : a -> String }
showInt : Show Int
showInt = Show { show = $showInt }
showList : Show a => Show [a]
showList = (Show d) => Show { show = ... }We have Show instances for Int and [], and the latter is parameterised by an implicit Show a. The problem arises when we try to use showList.
main = putLine (show [1,2,3])First, note that Kite can't currently infer function calls as implicit solutions, e.g. it can't automatically insert showList showInt : Show [Int]. We need to help it out a bit by providing the showList call:
main = let showListInt : Show [Int]
showListInt = showList
in putLine (show [1,2,3])Kite should solve the implicit argument to showList, producing showList showInt, but it doesn't. This is because implicits are only solved in applications, and showList on its own is not an application.
We need to fix this to make implicits a bit more usable.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels