I am in progress of learning purescript, and quite enjoying it so far.
Recently I discovered that purescript has typed holes, similar to the typed holes in Idris which I played a little with a few years ago.
I find typed holes very helpful when learning and I use them constantly. Most often, though, I just put a hole at the return value in order to get type insight into the values in the context scope, because the purescript-vim plugin that I am using doesn’t seem to be able to show type information (when coding F# in vim I am used to being able to get the type of a value by putting the cursor on the value and pressing
… Anyhow, when using typed holes I have noticed that it seems to be limited to only showing types for 5 (arbitrary?) values in the context. I have been wondering if this is a hard limitation or if it is something that I somehow can configure to show more values?
instance Apply (Parser e) where apply :: forall a b. Parser e (a -> b) -> Parser e a -> Parser e b apply p1 p2 = Parser \s -> do Tuple s1 fx <- parse p1 s Tuple s2 x <- parse p2 s1 let bar = 42 ?foo
type hole info:
1. Hole 'foo' has the inferred type Either e0 (Tuple String b1) in the following context: bar :: Int fx :: a2 -> b1 p1 :: Parser e0 (a2 -> b1) p2 :: Parser e0 a2 s :: String in value declaration $applyParser5 where e0 is a rigid type variable bound at (line 0, column 0 - line 0, column 0) a2 is a rigid type variable bound at (line 0, column 0 - line 0, column 0) b1 is a rigid type variable bound at (line 0, column 0 - line 0, column 0)
It doesn’t show type info for
x… Of course I am able to deduce the types in my head for this kind of case, but I worry that at some point I will come across a case where I will be struggling to ‘manually’ deduce the types.